gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r757 - doodle/src/doodle


From: grothoff
Subject: [GNUnet-SVN] r757 - doodle/src/doodle
Date: Sat, 7 May 2005 09:39:43 -0700 (PDT)

Author: grothoff
Date: 2005-05-07 09:39:40 -0700 (Sat, 07 May 2005)
New Revision: 757

Modified:
   doodle/src/doodle/tree.c
Log:
signed

Modified: doodle/src/doodle/tree.c
===================================================================
--- doodle/src/doodle/tree.c    2005-05-07 10:23:51 UTC (rev 756)
+++ doodle/src/doodle/tree.c    2005-05-07 16:39:40 UTC (rev 757)
@@ -164,7 +164,7 @@
   unsigned long long fsize;
   unsigned long long bstart;
   unsigned long long bsize;
-  char * buffer;
+  signed char * buffer;
   unsigned long long dirty;
 } BIO;
 
@@ -172,7 +172,7 @@
                    void * context,
                    int fd,
                    unsigned long long off,
-                   char * buf,
+                   signed char * buf,
                    unsigned long long cnt) {
   int ret;
   if (off != lseek(fd, off, SEEK_SET)) {
@@ -203,7 +203,7 @@
                      void * context,
                      int fd,
                      unsigned long long off,
-                     const char * buf,
+                     const signed char * buf,
                      unsigned long long cnt) {
   int ret;
   if (off != lseek(fd, off, SEEK_SET)) {
@@ -404,10 +404,10 @@
 
 static int READUINT(BIO * fd,
                    unsigned int * val) {
-  char c;
-  char d;
+  signed char c;
+  signed char d;
   unsigned char v[4];
-  if (-1 == READALL(fd, &c, sizeof(char)))
+  if (-1 == READALL(fd, &c, sizeof(signed char)))
     return -1;
   if ( (c > 4) || (c < 0) ) {
     fd->log(fd->context,
@@ -426,10 +426,10 @@
 
 static int READULONG(BIO * fd,
                     unsigned long long * val) {
-  char c;
-  char d;
+  signed char c;
+  signed char d;
   unsigned char v[8];
-  if (-1 == READALL(fd, &c, sizeof(char)))
+  if (-1 == READALL(fd, &c, sizeof(signed char)))
     return -1;
   if ( (c > 8) || (c < 0) ) {
     fd->log(fd->context,
@@ -450,7 +450,7 @@
                        unsigned int * val1,
                        unsigned int * val2) {
   unsigned char c;
-  char d;
+  signed char d;
   unsigned char v[4];
 
   if (-1 == READALL(fd, &c, sizeof(unsigned char)))
@@ -479,7 +479,7 @@
                         unsigned long long * val1,
                         unsigned long long * val2) {
   unsigned char c;
-  char d;
+  signed char d;
   unsigned char v[8];
 
   if (-1 == READALL(fd, &c, sizeof(unsigned char)))
@@ -508,7 +508,7 @@
                          unsigned int val1,
                          unsigned int val2) {
   unsigned char c;
-  char d;
+  signed char d;
   unsigned char v[4];
   unsigned int xval;
 
@@ -537,7 +537,7 @@
                           unsigned long long val1,
                           unsigned long long val2) {
   unsigned char c;
-  char d;
+  signed char d;
   unsigned char v[8];
   unsigned long long xval;
 
@@ -564,8 +564,8 @@
 
 static void WRITEUINT(BIO * fd,
                      unsigned int val) {
-  char c;
-  char d;
+  signed char c;
+  signed char d;
   unsigned char v[4];
   unsigned int xval;
 
@@ -575,7 +575,7 @@
     val = val >> 8;
     c++;
   }
-  WRITEALL(fd, &c, sizeof(char));
+  WRITEALL(fd, &c, sizeof(signed char));
   for (d=c-1;d>=0;d--)
     v[(unsigned char)d] = (unsigned char) (xval >> (8*d));
   WRITEALL(fd, &v[0], (int) c);
@@ -583,8 +583,8 @@
 
 static void WRITEULONG(BIO * fd,
                       unsigned long long val) {
-  char c;
-  char d;
+  signed char c;
+  signed char d;
   unsigned char v[8];
   unsigned long long xval;
 
@@ -594,15 +594,15 @@
     val = val >> 8;
     c++;
   }
-  WRITEALL(fd, &c, sizeof(char));
+  WRITEALL(fd, &c, sizeof(signed char));
   for (d=c-1;d>=0;d--)
     v[(unsigned char)d] = (unsigned char) (xval >> (8*d));
   WRITEALL(fd, &v[0], (int) c);
 }
 
-static char * readZT(BIO * fd) {
+static signed char * readZT(BIO * fd) {
   unsigned int len;
-  char * buf;
+  signed char * buf;
 
   if (-1 == READUINT(fd, &len))
     return NULL;
@@ -616,7 +616,7 @@
 }
 
 static void writeZT(BIO * fd,
-                   char * buf) {
+                   signed char * buf) {
   unsigned int len;
 
   len = strlen(buf);
@@ -624,13 +624,13 @@
   WRITEALL(fd, buf, strlen(buf));
 }
 
-static char * readFN(BIO * fd,
-                    char ** pathTab,
+static signed char * readFN(BIO * fd,
+                    signed char ** pathTab,
                     const unsigned int ptc) {
   unsigned int pid;
   unsigned int fnl;
   int slen;
-  char * buf;
+  signed char * buf;
 
   if (-1 == READUINT(fd, &pid))
     return NULL;
@@ -660,7 +660,7 @@
 }
 
 static void writeFN(BIO * fd,
-                   char ** pathTab,
+                   signed char ** pathTab,
                    const unsigned int ptc,
                    const char * fn) {
   int i;
@@ -746,7 +746,7 @@
   /* context */
   void * context;
   /* name of the database file */
-  char * database;
+  signed char * database;
   /* file handle for database file */
   BIO * fd;
   /* size of filenames array */
@@ -1084,12 +1084,12 @@
   LSEEK(tree->fd, off, SEEK_SET);
   if (-1 == READALL(tree->fd,
                    &c_length,
-                   sizeof(char)))
+                   sizeof(signed char)))
     return NULL;
   if (c_length == 0) {
     if (-1 == READALL(tree->fd,
                      &mls_size,
-                     sizeof(char)))
+                     sizeof(signed char)))
       return NULL;
     if (mls_size == 0) { /* not legal! */
       tree->log(tree->context,
@@ -1516,14 +1516,14 @@
  * time introducing the 'mls' node groups (which has the potential
  * to significantly improve performance).
  */
-static char * MAGIC = "DOO\0000006";
+static signed char * MAGIC = "DOO\0000006";
 
 /**
  * Magic string to indicate an temporary doodle database that
  * could not be completely created (the indexing/building process
  * was aborted).
  */
-static char * TRAGIC = "XOO\0000001";
+static signed char * TRAGIC = "XOO\0000001";
 
 /**
  * Create a suffix-tree (and store in file named database).
@@ -1538,9 +1538,9 @@
   struct stat buf;
   int i;
   unsigned long long off;
-  char ** pathTab;
+  signed char ** pathTab;
   unsigned int ptc;
-  char magic[8];
+  signed char magic[8];
 
   ret = MALLOC(sizeof(SuffixTree));
   ret->log = log;
@@ -1633,7 +1633,7 @@
       return NULL;
     }
     if (ptc != 0) {
-      pathTab = MALLOC(ptc * sizeof(char*));
+      pathTab = MALLOC(ptc * sizeof(signed char*));
       for (i=ptc-1;i>=0;i--) {
        pathTab[i] = readZT(fd);
        if (pathTab[i] == NULL) {
@@ -1721,7 +1721,7 @@
     }
     ret->cisLen = ret->cisPos;
     if (ret->cisLen > 0)
-      ret->cis = MALLOC(ret->cisLen * sizeof(char*));
+      ret->cis = MALLOC(ret->cisLen * sizeof(signed char*));
     else
       ret->cis = NULL;
     for (i=ret->cisPos-1;i>=0;i--) {
@@ -1876,7 +1876,7 @@
   int j;
   unsigned long long off;
   off_t wpos;
-  char ** pathTab;
+  signed char ** pathTab;
   unsigned int ptc;
   STNode * tmp;
 
@@ -1886,7 +1886,7 @@
         ( (tree->root != NULL) &&
           (tree->root->modified != 0) ) ) ) {
     int fdt;
-    char * tdatabase;
+    signed char * tdatabase;
 
     tree->force_dump = 1; /* force re-dump everything! */
     tdatabase = MALLOC(strlen(tree->database) + 2);
@@ -1926,7 +1926,7 @@
     ptc = 0;
     pathTab = NULL;
     for (i=tree->fnc-1;i>=0;i--) {
-      char * fn;
+      signed char * fn;
       int slen;
       int xslen;
 
@@ -2251,7 +2251,7 @@
   STNode * spos;
   unsigned char * cisp;
   const unsigned char * cisp0;
-  char * sharedName;
+  signed char * sharedName;
   int i;
   int cix;
   struct stat sbuf;
@@ -3005,7 +3005,7 @@
 
   for (i=DOODLE_getFileCount(tree)-1;i>=0;i--) {
     struct stat sbuf;
-    char * fn;
+                               char * fn;
     int keep;
 
     keep = 1;
@@ -3370,11 +3370,11 @@
  */
 static void jni_logger(JNICTX * ctx,
                       unsigned int level,
-                      const char * message,
+                      const signed char * message,
                       ...) {
   size_t n;
   va_list ap;
-  char * buf;
+  signed char * buf;
   jstring arg;
   jmethodID log;
   jclass logger;
@@ -3411,7 +3411,7 @@
 JNIEXPORT jlong JNICALL Java_org_ovmj_doodle_Doodle_open
 (JNIEnv * env, jclass cl, jstring filename, jobject logger) {
   JNICTX * ret;
-  const char * database;
+  const signed char * database;
   jboolean isCopy;
 
   database = (*env)->GetStringUTFChars(env,
@@ -3454,7 +3454,7 @@
 JNIEXPORT void JNICALL Java_org_ovmj_doodle_Doodle_truncate
 (JNIEnv * env, jclass cl, jlong handle, jstring filename) {
   JNICTX * ret = (JNICTX*) (long) handle;
-  const char * fn;
+  const signed char * fn;
   jboolean isCopy;
 
   fn = (*env)->GetStringUTFChars(env,
@@ -3476,8 +3476,8 @@
 (JNIEnv * env, jclass cl, jlong handle, jstring key, jstring filename) {
   JNICTX * ret = (JNICTX*) (long) handle;
   int i;
-  const char * fn;
-  const char * ky;
+  const signed char * fn;
+  const signed char * ky;
   jboolean isCopy;
 
   fn = (*env)->GetStringUTFChars(env,
@@ -3507,7 +3507,7 @@
 (JNIEnv * env, jclass cl, jlong handle, jstring filename) {
   JNICTX * ret = (JNICTX*) (long) handle;
   int i;
-  const char * fn;
+  const signed char * fn;
   const DOODLE_FileInfo * f;
   jboolean isCopy;
 
@@ -3557,7 +3557,7 @@
   JNICTX * ret = (JNICTX*) (long) handle;
   jclass vector;
   SearchClosure cls;
-  const char * ky;
+  const signed char * ky;
   int i;
   jboolean isCopy;
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]