MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to
- Michael Polak, Svojsikova 7, 169 00 Praha 6 Czech Republic */
-/* ------------------------------------------------------------------- */
+ You should have received a copy of the GNU Lesser General Public License
+ along with C<<1 header file; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+ ------------------------------------------------------------------- */
#ifndef __CLL1H__
#define __CLL1H__
/* 3. C<<1 iterators - updated 2008-01-07 by xCh. */
/* ------------------------------------------------------------------- */
#define loop while(TRUE)
-#define repeat(N) _NEW_I for_range(_I,1,N)
-#define for_range(VAR,FROM,TO) for(VAR=FROM; FROM<=TO?VAR<=TO:VAR>=TO; FROM<=TO?VAR++:VAR--)
+#define repeat(N) if(N>0) _NEW_I for_range(_I,1,N)
+#define for_range(VAR,FROM,TO) for( VAR=FROM ; FROM<=TO?VAR<=TO:VAR>=TO ; FROM<=TO?VAR++:VAR--)
#define for_each(A,B) for(A=B; A; A=A->_next)
#define for_search(A,B,C) for_each(A,B) if(C)
/*to do: #define for_file_lines(STR,F) _NEW_F for() */