OSSP CVS Repository

ossp - Check-in [2731]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 2731
Date: 2002-Nov-05 15:52:24 (local)
2002-Nov-05 14:52:24 (UTC)
User:mlelstv
Branch:
Comment: fix parameter remove compiler warning (signed/unsigned comparison)

PR: Submitted by: Reviewed by: Approved by: Obtained from:

Tickets:
Inspections:
Files:
ossp-pkg/sio/al_test.c      1.15 -> 1.16     5 inserted, 4 deleted

ossp-pkg/sio/al_test.c 1.15 -> 1.16

--- al_test.c    2002/10/23 16:49:29     1.15
+++ al_test.c    2002/11/05 14:52:24     1.16
@@ -46,10 +46,11 @@
 static const char *fill(char *p, int n)
 {
     static char buf[4 * 80 + 1];
+    int max = sizeof(buf)-5;
     int k;
 
     k=0;
-    while (n > 0 && k < sizeof(buf)-5) {
+    while (n > 0 && k < max) {
         if (isprint(*p)) {
             buf[k] = *p;
             k += 1;
@@ -95,11 +96,10 @@
 
 static void print(const char *tag, al_t *al)
 {
+#if 0
     char *buf;
     size_t n, len;
 
-    return;
-
     n = al_bytes(al);
     buf = (char *)malloc(n);
     if (buf == NULL) abort();
@@ -113,6 +113,7 @@
     printf("\n\n");
 
     free(buf);
+#endif
 }
 
 static void checklen(const char *tag, al_t *al)
@@ -124,7 +125,7 @@
     total = 0;
 
     al_txalloc(al, &tx);
-    al_traverse(al, 0, -1, AL_FORWARD, NULL, tx);
+    al_traverse(al, 0, al_bytes(al), AL_FORWARD, NULL, tx);
     while (al_traverse_next(al, tx, &cur) == AL_OK)
         total += al_chunk_len(cur);
     al_traverse_end(al, tx, 1);

CVSTrac 2.0.1