changeset 442:68639eb89297

- Reduced warnings with gcc-4.3.
author jcid
date Thu, 30 Oct 2008 18:23:03 +0100
parents 60b949325f58
children 7330f61dce7d
files ChangeLog dpi/downloads.cc dw/findtext.hh dw/style.hh lout/object.cc src/dialog.cc src/html.cc src/uicmd.cc src/url.h
diffstat 9 files changed, 26 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Oct 28 00:00:10 2008 +0100
+++ b/ChangeLog	Thu Oct 30 18:23:03 2008 +0100
@@ -20,6 +20,8 @@
 +- Allowed compilation with older machines by removing a few C99isms.
  - Added use of inttypes.h when stdint.h isn't found.
    Patches: Dan Fandrich
++- Reduced warnings with gcc-4.3.
+   Patch: Thomas Orgis
 +- Added the "middle_click_drags_page" dillorc option.
    Patch: Jorge Arellano, Thomas Orgis
 +- Set the File menu label to hide when the File menu-button is shown.
--- a/dpi/downloads.cc	Tue Oct 28 00:00:10 2008 +0100
+++ b/dpi/downloads.cc	Thu Oct 30 18:23:03 2008 +0100
@@ -513,7 +513,7 @@
          if (isdigit(*q++ = *p)) {
             // keep here
          } else if (*p == 'K') {
-            for(--q; isdigit(q[-1]); --q); log_state = ST_discard;
+            for(--q; isdigit(q[-1]); --q) ; log_state = ST_discard;
          } else {
             log_state = ST_copy;
          }
--- a/dw/findtext.hh	Tue Oct 28 00:00:10 2008 +0100
+++ b/dw/findtext.hh	Thu Oct 30 18:23:03 2008 +0100
@@ -65,7 +65,7 @@
 
    inline static bool charsEqual (char c1, char c2, bool caseSens)
    { return caseSens ? c1 == c2 : tolower (c1) == tolower (c2) ||
-      isspace (c1) && isspace (c2); }
+      (isspace (c1) && isspace (c2)); }
 
 public:
    FindtextState ();
--- a/dw/style.hh	Tue Oct 28 00:00:10 2008 +0100
+++ b/dw/style.hh	Thu Oct 30 18:23:03 2008 +0100
@@ -346,11 +346,11 @@
 
 /** \brief Returns a percentage, \em v is relative to 1, not to 100. */
 inline Length createPerLength(double v) {
-   return (int)(v * (1 << 18)) & ~3 | 2; }
+   return ((int)(v * (1 << 18)) & ~3) | 2; }
 
 /** \brief Returns a relative length. */
 inline Length createRelLength(double v) {
-   return (int)(v * (1 << 18)) & ~3 | 3; }
+   return ((int)(v * (1 << 18)) & ~3) | 3; }
 
 /** \brief Returns true if \em l is an absolute length. */
 inline bool isAbsLength(Length l) { return (l & 3) == 1; }
--- a/lout/object.cc	Tue Oct 28 00:00:10 2008 +0100
+++ b/lout/object.cc	Thu Oct 30 18:23:03 2008 +0100
@@ -251,7 +251,7 @@
 
    return
       // Identical?
-      this == other ||
+      this == other || (
       (// Both first parts are NULL, ...
          (first == NULL && otherPair->first == NULL) ||
          // ... or both first parts are not NULL and equal
@@ -260,7 +260,7 @@
       // Same with second part.
       ((second == NULL && otherPair->second == NULL) ||
        (second != NULL && otherPair->second != NULL
-        && second->equals (otherPair->second)));
+        && second->equals (otherPair->second))));
 }
 
 int PairBase::hashValue()
--- a/src/dialog.cc	Tue Oct 28 00:00:10 2008 +0100
+++ b/src/dialog.cc	Thu Oct 30 18:23:03 2008 +0100
@@ -193,7 +193,7 @@
    txt[0] = txt[6] = NULL;
    txt[1] = alt1; txt[2] = alt2; txt[3] = alt3;
    txt[4] = alt4; txt[5] = alt5;
-   for (int i=1; txt[i]; ++i, ++nb);
+   for (int i=1; txt[i]; ++i, ++nb) ;
 
    Window *window = new Window(ww,wh,"Choice5");
    window->begin();
--- a/src/html.cc	Tue Oct 28 00:00:10 2008 +0100
+++ b/src/html.cc	Thu Oct 30 18:23:03 2008 +0100
@@ -1007,7 +1007,7 @@
 
    } else if (isalpha(*s)) {
       /* character entity reference */
-      while (*++s && (isalnum(*s) || strchr(":_.-", *s)));
+      while (*++s && (isalnum(*s) || strchr(":_.-", *s))) ;
       c = *s;
       *s = 0;
 
@@ -1187,10 +1187,10 @@
       Pword = a_Html_parse_entities(html, word, size);
       for (start = i = 0; Pword[i]; start = i)
          if (isspace(Pword[i])) {
-            while (Pword[++i] && isspace(Pword[i]));
+            while (Pword[++i] && isspace(Pword[i])) ;
             Html_process_space(html, Pword + start, i - start);
          } else {
-            while (Pword[++i] && !isspace(Pword[i]));
+            while (Pword[++i] && !isspace(Pword[i])) ;
             ch = Pword[i];
             Pword[i] = 0;
             DW2TB(html->dw)->addText(Pword, S_TOP(html)->style);
@@ -1209,7 +1209,7 @@
          Pword = a_Html_parse_entities(html, word, size);
          for (i = 0; Pword[i]; ++i)
             if (strchr("\t\f\n\r", Pword[i]))
-               for (j = i; (Pword[j] = Pword[j+1]); ++j);
+               for (j = i; (Pword[j] = Pword[j+1]); ++j) ;
    
          DW2TB(html->dw)->addText(Pword, S_TOP(html)->style);
          dFree(Pword);
@@ -1331,8 +1331,8 @@
           (cmp = (new_idx != html->stack->getRef(stack_idx)->tag_idx)) &&
           ((w3c_mode &&
             Tags[html->stack->getRef(stack_idx)->tag_idx].EndTag == 'O') ||
-           (!w3c_mode &&
-            (Tags[html->stack->getRef(stack_idx)->tag_idx].EndTag == 'O') ||
+           ((!w3c_mode &&
+            (Tags[html->stack->getRef(stack_idx)->tag_idx].EndTag == 'O')) ||
              Tags[html->stack->getRef(stack_idx)->tag_idx].TagLevel <
              Tags[new_idx].TagLevel))) {
       --stack_idx;
@@ -1516,7 +1516,7 @@
     * and replace '\n' and '\r' with ' ' inside quoted strings. */
    for (i = 0, p = ntag; *p; ++p) {
       if (isspace(*p)) {
-         for (ntag[i++] = ' '; isspace(p[1]); ++p);
+         for (ntag[i++] = ' '; isspace(p[1]); ++p) ;
       } else if ((quote = *p) == '"' || *p == '\'') {
          for (ntag[i++] = *p++; (ntag[i++] = *p) && *p != quote; ++p) {
             if (*p == '\n' || *p == '\r')
@@ -2945,7 +2945,7 @@
             sprintf(delay_str, ".");
 
          /* Skip to anything after "URL=" */
-         while (*content && *(content++) != '=');
+         while (*content && *(content++) != '=') ;
 
          /* Send a custom HTML message.
           * TODO: This is a hairy hack,
@@ -3766,7 +3766,7 @@
 
       if (isspace(buf[buf_index])) {
          /* whitespace: group all available whitespace */
-         while (++buf_index < bufsize && isspace(buf[buf_index]));
+         while (++buf_index < bufsize && isspace(buf[buf_index])) ;
          Html_process_space(html, buf + token_start, buf_index - token_start);
          token_start = buf_index;
 
--- a/src/uicmd.cc	Tue Oct 28 00:00:10 2008 +0100
+++ b/src/uicmd.cc	Thu Oct 30 18:23:03 2008 +0100
@@ -85,11 +85,12 @@
    void remove (Widget *w) {
       TabGroup::remove (w);
       /* fixup resizable in case we just removed it */
-      if (resizable () == w)
+      if (resizable () == w) {
          if (children () > 0)
             resizable (child (children () - 1));
          else
             resizable (NULL);
+      }
 
       if (children () < 2)
          hideLabels ();
--- a/src/url.h	Tue Oct 28 00:00:10 2008 +0100
+++ b/src/url.h	Thu Oct 30 18:23:03 2008 +0100
@@ -95,12 +95,12 @@
 struct _DilloUrl {
    Dstr  *url_string;
    const char *buffer;
-   const char *scheme;            //
-   const char *authority;         //
-   const char *path;              // These are references only
-   const char *query;             // (no need to free them)
-   const char *fragment;          //
-   const char *hostname;          //
+   const char *scheme;            /**/
+   const char *authority;         /**/
+   const char *path;              /* These are references only */
+   const char *query;             /* (no need to free them) */
+   const char *fragment;          /**/
+   const char *hostname;          /**/
    int port;
    int flags;
    Dstr *data;                    /* POST */