]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Avoid Metaware's High-C warning "'=' encountered where '==' may have been intended."
authorGisle Vanem <gvanem@broadpark.no>
Tue, 29 Aug 2006 21:11:55 +0000 (21:11 +0000)
committerGisle Vanem <gvanem@broadpark.no>
Tue, 29 Aug 2006 21:11:55 +0000 (21:11 +0000)
lib/dict.c
lib/formdata.c
lib/ftp.c
lib/hostip4.c

index 86d00c961e11f37a3d627405615f3a4a3d4154f1..6a5697952bbba891fcf390ab55650d8d0aa0aed4 100644 (file)
@@ -106,7 +106,7 @@ static char *unescape_word(struct SessionHandle *data, char *inp)
     /* According to RFC2229 section 2.2, these letters need to be escaped with
        \[letter] */
     for(ptr = newp;
-        (byte = (unsigned char)*ptr);
+        (byte = (unsigned char)*ptr) != 0;
         ptr++) {
       if ((byte <= 32) || (byte == 127) ||
           (byte == '\'') || (byte == '\"') || (byte == '\\')) {
index 201bdcaa5770b19eb486570bab556be5ec5959c9..4c53045f257246310eccc04514ebc942ac8d0235 100644 (file)
@@ -528,8 +528,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
         if (current_form->value) {
           if (current_form->flags & HTTPPOST_FILENAME) {
             if (filename) {
-              if (!(current_form = AddFormInfo(strdup(filename),
-                                               NULL, current_form)))
+              if ((current_form = AddFormInfo(strdup(filename),
+                                              NULL, current_form)) == NULL)
                 return_value = CURL_FORMADD_MEMORY;
             }
             else
@@ -562,8 +562,8 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
         if (current_form->value) {
           if (current_form->flags & HTTPPOST_BUFFER) {
             if (filename) {
-              if (!(current_form = AddFormInfo(strdup(filename),
-                                               NULL, current_form)))
+              if ((current_form = AddFormInfo(strdup(filename),
+                                              NULL, current_form)) == NULL)
                 return_value = CURL_FORMADD_MEMORY;
             }
             else
@@ -614,9 +614,9 @@ CURLFORMcode FormAdd(struct curl_httppost **httppost,
         if (current_form->contenttype) {
           if (current_form->flags & HTTPPOST_FILENAME) {
             if (contenttype) {
-              if (!(current_form = AddFormInfo(NULL,
-                                               strdup(contenttype),
-                                               current_form)))
+              if ((current_form = AddFormInfo(NULL,
+                                              strdup(contenttype),
+                                              current_form)) == NULL)
                 return_value = CURL_FORMADD_MEMORY;
             }
             else
@@ -884,7 +884,7 @@ void Curl_formclean(struct FormData *form)
     free(form->line); /* free the line */
     free(form);       /* free the struct */
 
-  } while((form=next)); /* continue */
+  } while ((form = next) != NULL); /* continue */
 }
 
 /*
@@ -961,7 +961,7 @@ void curl_formfree(struct curl_httppost *form)
       free(form->showfilename); /* free the faked file name */
     free(form);       /* free the struct */
 
-  } while((form=next)); /* continue */
+  } while ((form = next) != NULL); /* continue */
 }
 
 #ifndef HAVE_BASENAME
@@ -1231,7 +1231,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
              */
             size_t nread;
             char buffer[512];
-            while((nread = fread(buffer, 1, sizeof(buffer), fileread))) {
+            while ((nread = fread(buffer, 1, sizeof(buffer), fileread)) != 0) {
               result = AddFormData(&form, FORM_DATA, buffer, nread, &size);
               if (result)
                 break;
@@ -1268,7 +1268,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
         if (result)
           break;
       }
-    } while((file = file->more)); /* for each specified file for this field */
+    } while ((file = file->more) != NULL); /* for each specified file for this field */
     if (result) {
       Curl_formclean(firstform);
       free(boundary);
@@ -1286,7 +1286,7 @@ CURLcode Curl_getFormData(struct FormData **finalform,
         break;
     }
 
-  } while((post=post->next)); /* for each field */
+  } while ((post = post->next) != NULL); /* for each field */
   if (result) {
     Curl_formclean(firstform);
     free(boundary);
index bfa34bae846198ab2d14e8d3a6a79a9a73be24e1..bc069a2b002b2d9dadc9f6a7181a98bdb88c3c50 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -138,8 +138,10 @@ static int ftp_need_type(struct connectdata *conn,
                                         bool ascii);
 
 /* easy-to-use macro: */
-#define FTPSENDF(x,y,z) if((result = Curl_ftpsendf(x,y,z))) return result
-#define NBFTPSENDF(x,y,z) if((result = Curl_nbftpsendf(x,y,z))) return result
+#define FTPSENDF(x,y,z)    if ((result = Curl_ftpsendf(x,y,z)) != CURLE_OK) \
+                              return result
+#define NBFTPSENDF(x,y,z)  if ((result = Curl_nbftpsendf(x,y,z)) != CURLE_OK) \
+                              return result
 
 static void freedirs(struct FTP *ftp)
 {
@@ -3878,7 +3880,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
       return CURLE_OUT_OF_MEMORY;
 
     /* parse the URL path into separate path components */
-    while((slash_pos=strchr(cur_pos, '/'))) {
+    while ((slash_pos = strchr(cur_pos, '/')) != NULL) {
       /* 1 or 0 to indicate absolute directory */
       bool absolute_dir = (cur_pos - conn->path > 0) && (ftp->dirdepth == 0);
 
index cbb00ab2dc5b7316c9b268f9fc543df76b9edad9..08565cd869ec36471d189d7b6690901706950aea 100644 (file)
@@ -348,7 +348,7 @@ Curl_addrinfo *Curl_he2ai(const struct hostent *he, int port)
     /* no input == no output! */
     return NULL;
 
-  for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]); i++) {
+  for(i=0; (curr = (struct in_addr *)he->h_addr_list[i]) != NULL; i++) {
 
     ai = calloc(1, sizeof(Curl_addrinfo) + sizeof(struct sockaddr_in));