changeset 306:7a76f872ce73

- Eliminated gcc 4.2.3 warnings on 64bit OS.
author jcid
date Tue, 12 Aug 2008 22:24:37 +0200
parents 43ba970f42cf
children e556e012244e
files dlib/dlib.h dpi/datauri.c dpi/downloads.cc dpi/dpiutil.c dpi/dpiutil.h dpip/dpip.c dpip/dpip.h src/IO/IO.c src/dns.c src/misc.c src/misc.h
diffstat 11 files changed, 25 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/dlib/dlib.h	Wed Aug 06 14:58:39 2008 +0200
+++ b/dlib/dlib.h	Tue Aug 12 22:24:37 2008 +0200
@@ -35,7 +35,7 @@
 /* TODO: include a void* size test in configure.in */
 /* (long) works for both 32bit and 64bit */
 #define VOIDP2INT(p)    ((long)(p))
-#define INT2VOIDP(i)    ((void*)(i))
+#define INT2VOIDP(i)    ((void*)((long)(i)))
 
 /*
  *-- Memory -------------------------------------------------------------------
--- a/dpi/datauri.c	Wed Aug 06 14:58:39 2008 +0200
+++ b/dpi/datauri.c	Tue Aug 12 22:24:37 2008 +0200
@@ -296,7 +296,7 @@
    data = datauri_get_data(url, &data_size);
 
    MSG("mime_type: %s\n", mime_type);
-   MSG("data_size: %d\n", data_size);
+   MSG("data_size: %d\n", (int)data_size);
    MSG("data: {%s}\n", data);
 
    if (mime_type && data) {
--- a/dpi/downloads.cc	Wed Aug 06 14:58:39 2008 +0200
+++ b/dpi/downloads.cc	Tue Aug 12 22:24:37 2008 +0200
@@ -134,14 +134,14 @@
    void child_init();
    void father_init();
    void update_size(int new_sz);
-   void log_text_add(char *buf, ssize_t st);
+   void log_text_add(const char *buf, ssize_t st);
    void log_text_show();
    void abort_dl();
    void prButton_cb();
    pid_t pid() { return mPid; }
    void pid(pid_t p) { mPid = p; }
    void child_finished(int status);
-   void status_msg(char *msg) { prBar->message(msg); }
+   void status_msg(const char *msg) { prBar->message((char*)msg); }
    Widget *get_widget() { return group; }
    int widget_done() { return WidgetDone; }
    void widget_done(int val) { WidgetDone = val; }
@@ -325,15 +325,15 @@
       Filter_smtp_hack(esc_url);
    dl_argv = new char*[8];
    int i = 0;
-   dl_argv[i++] = "wget";
+   dl_argv[i++] = (char*)"wget";
    if (action == DL_CONTINUE) {
       if (stat(fullname, &ss) == 0)
          init_bytesize = (int)ss.st_size;
-      dl_argv[i++] = "-c";
+      dl_argv[i++] = (char*)"-c";
    }
-   dl_argv[i++] = "--load-cookies";
+   dl_argv[i++] = (char*)"--load-cookies";
    dl_argv[i++] = dStrconcat(dGethomedir(), "/.dillo/cookies.txt", NULL);
-   dl_argv[i++] = "-O";
+   dl_argv[i++] = (char*)"-O";
    dl_argv[i++] = fullname;
    dl_argv[i++] = esc_url;
    dl_argv[i++] = NULL;
@@ -481,9 +481,10 @@
    prSize->redraw_label();
 }
 
-void DLItem::log_text_add(char *buf, ssize_t st)
+void DLItem::log_text_add(const char *buf, ssize_t st)
 {
-   char *p, *q, *d, num[64];
+   const char *p;
+   char *q, *d, num[64];
 
    // Make room...
    if (log_len + st >= log_max) {
@@ -941,8 +942,8 @@
  */
 static void dlwin_esc_cb(Widget *, void *)
 {
-   char *msg = "There are running downloads.\n"
-               "ABORT them and EXIT anyway?";
+   const char *msg = "There are running downloads.\n"
+                     "ABORT them and EXIT anyway?";
 
    if (dl_win && dl_win->num_running() > 0) {
       int ch = fltk::choice(msg, "Yes", "*No", "Cancel");
--- a/dpi/dpiutil.c	Wed Aug 06 14:58:39 2008 +0200
+++ b/dpi/dpiutil.c	Tue Aug 12 22:24:37 2008 +0200
@@ -33,10 +33,10 @@
  * Escape URI characters in 'esc_set' as %XX sequences.
  * Return value: New escaped string.
  */
-char *Escape_uri_str(const char *str, char *p_esc_set)
+char *Escape_uri_str(const char *str, const char *p_esc_set)
 {
-   static const char *hex = "0123456789ABCDEF";
-   char *p, *esc_set;
+   static const char *esc_set, *hex = "0123456789ABCDEF";
+   char *p;
    Dstr *dstr;
    int i;
 
--- a/dpi/dpiutil.h	Wed Aug 06 14:58:39 2008 +0200
+++ b/dpi/dpiutil.h	Tue Aug 12 22:24:37 2008 +0200
@@ -69,7 +69,7 @@
  * Escape URI characters in 'esc_set' as %XX sequences.
  * Return value: New escaped string.
  */
-char *Escape_uri_str(const char *str, char *p_esc_set);
+char *Escape_uri_str(const char *str, const char *p_esc_set);
 
 /*
  * Escape unsafe characters as html entities.
--- a/dpip/dpip.c	Wed Aug 06 14:58:39 2008 +0200
+++ b/dpip/dpip.c	Tue Aug 12 22:24:37 2008 +0200
@@ -111,7 +111,7 @@
  *       (stuffing of ' is removed here)
  * Return value: the attribute value, or NULL if not present or malformed.
  */
-char *a_Dpip_get_attr(char *tag, size_t tagsize, char *attrname)
+char *a_Dpip_get_attr(char *tag, size_t tagsize, const char *attrname)
 {
    uint_t i, n = 0, found = 0;
    char *p, *q, *start, *val = NULL;
--- a/dpip/dpip.h	Wed Aug 06 14:58:39 2008 +0200
+++ b/dpip/dpip.h	Tue Aug 12 22:24:37 2008 +0200
@@ -23,7 +23,7 @@
  *       (dpip character escaping is removed here)
  * Return value: the attribute value, or NULL if not present or malformed.
  */
-char *a_Dpip_get_attr(char *tag, size_t tagsize, char *attrname);
+char *a_Dpip_get_attr(char *tag, size_t tagsize, const char *attrname);
 
 
 #ifdef __cplusplus
--- a/src/IO/IO.c	Wed Aug 06 14:58:39 2008 +0200
+++ b/src/IO/IO.c	Tue Aug 12 22:24:37 2008 +0200
@@ -330,11 +330,11 @@
 
    if (r_io->Op == IORead) {
       a_IOwatch_add_fd(r_io->FD, DIO_READ,
-                       IO_fd_read_cb, (void*)(r_io->Key));
+                       IO_fd_read_cb, INT2VOIDP(r_io->Key));
 
    } else if (r_io->Op == IOWrite) {
       a_IOwatch_add_fd(r_io->FD, DIO_WRITE,
-                       IO_fd_write_cb, (void*)(r_io->Key));
+                       IO_fd_write_cb, INT2VOIDP(r_io->Key));
    }
 }
 
--- a/src/dns.c	Wed Aug 06 14:58:39 2008 +0200
+++ b/src/dns.c	Tue Aug 12 22:24:37 2008 +0200
@@ -336,7 +336,8 @@
    dns_server[channel].hostname = dStrdup(hostname);
 
    /* Let's set a timeout client to poll the server channel (5 times/sec) */
-   a_Timeout_add(0.2,Dns_timeout_client,(void*)(dns_server[channel].channel));
+   a_Timeout_add(0.2,Dns_timeout_client,
+                 INT2VOIDP(dns_server[channel].channel));
 
 #ifdef D_DNS_THREADED
    /* set the thread attribute to the detached state */
--- a/src/misc.c	Wed Aug 06 14:58:39 2008 +0200
+++ b/src/misc.c	Tue Aug 12 22:24:37 2008 +0200
@@ -24,7 +24,7 @@
  * Escape characters as %XX sequences.
  * Return value: New string.
  */
-char *a_Misc_escape_chars(const char *str, char *esc_set)
+char *a_Misc_escape_chars(const char *str, const char *esc_set)
 {
    static const char *hex = "0123456789ABCDEF";
    char *p = NULL;
--- a/src/misc.h	Wed Aug 06 14:58:39 2008 +0200
+++ b/src/misc.h	Tue Aug 12 22:24:37 2008 +0200
@@ -9,7 +9,7 @@
 #endif /* __cplusplus */
 
 
-char *a_Misc_escape_chars(const char *str, char *esc_set);
+char *a_Misc_escape_chars(const char *str, const char *esc_set);
 char *a_Misc_expand_tabs(const char *str);
 int a_Misc_get_content_type_from_data(void *Data, size_t Size,const char **PT);
 int a_Misc_content_type_check(const char *EntryType, const char *DetectedType);