Fixed compiler warnings
authorArjen Baart <arjen@andromeda.nl>
Thu, 2 May 2019 17:42:30 +0000 (19:42 +0200)
committerArjen Baart <arjen@andromeda.nl>
Thu, 2 May 2019 17:42:30 +0000 (19:42 +0200)
demos/timesheet.cpp
src/Makefile.am
src/String.h
src/button.h
src/color.h
src/font.h
src/frame.h
src/parsedate.c
src/xappl.cpp
src/xwindow.cpp
src/xwindow.h

index fc34ecf..82f03fc 100644 (file)
@@ -1,4 +1,4 @@
-#include <AXE/date.h>
+#include "date.h"
 
 class activity
 {
index 80fbaf2..10b96ab 100644 (file)
@@ -6,8 +6,8 @@ lib_LIBRARIES = libAXE.a
 
 libAXE_a_SOURCES = xappl.cpp xwindow.cpp font.cpp menu.cpp frame.cpp \
          filedialog.cpp \
-         parsedate.c datelex.c dateyacc.y \
          button.cpp edit.cpp scroll.cpp table.cpp geometry.cpp icon.cpp \
+         parsedate.c datelex.c dateyacc.y \
          string.cpp regex.cpp integer.cpp date.cpp hour.cpp utc.cpp \
          amount.cpp out.cpp \
          configuration.cpp
index 6369fa8..a9b7177 100644 (file)
@@ -351,7 +351,7 @@ class substring
 
 public:
    String& operator=(const String &); 
-   String& operator=(char *s)
+   String& operator=(const char *s)
    {
       *this = String(s);
       return *str;
index 25d02c8..61f80cb 100644 (file)
@@ -54,7 +54,7 @@ class button : public frame
 
 public:
 
-   button(window &par, int x, int y,char *label) : frame(par, x, y, label)
+   button(window &par, int x, int y, const char label[]) : frame(par, x, y, label)
    {
       SelectInput(ButtonReleaseMask|ButtonPressMask, 1);
    }
@@ -77,7 +77,7 @@ class touch_button : public button
 
 public:
 
-   touch_button(window &par, int x, int y, char *label)
+   touch_button(window &par, int x, int y, const char label[])
           : button(par, x, y, label)
    {
    }
@@ -95,7 +95,7 @@ class toggle_button : public touch_button
 
 public:
 
-   toggle_button(window &par, int x, int y, char *label)
+   toggle_button(window &par, int x, int y, const char label[])
           : touch_button(par, x, y, label)
    {
       state = State_Off;
@@ -112,7 +112,7 @@ class command_button : public button
 
 public:
 
-   command_button(window &par, int x, int y, char *label, int cc = 0)
+   command_button(window &par, int x, int y, const char label[], int cc = 0)
                   : button(par, x, y, label)
    {
       command_code = cc;
index e0f4852..f52a290 100644 (file)
@@ -70,7 +70,7 @@ public:
       XAllocColor(stddpy, stddpy.ColMap(), &xcol);
    }
 
-   color(char *colorname)
+   color(const char colorname[])
    {
        XColor  exact;
 
index c4455d9..401f28c 100644 (file)
@@ -65,7 +65,7 @@ public:
       fs = 0;
    }
 
-   font(char *name)
+   font(const char name[])
    {
       fs = XLoadQueryFont(stddpy.Dpy(), name);
       if (fs == NULL)
@@ -85,7 +85,7 @@ public:
       return fs != 0;
    }
 
-   void Load(char *name)
+   void Load(const char name[])
    {
       if (fs)
          XFreeFont(stddpy.Dpy(), fs);
index f7242c1..29f4080 100644 (file)
@@ -70,7 +70,7 @@ enum   ver_alignment { Top, Middle, Bottom };
 
 class frame : public window
 {
-   char      *text;
+   const char      *text;
 
    hor_alignment halign;
    ver_alignment valign;
@@ -98,7 +98,7 @@ public:
       SelectInput(ExposureMask, 1);
    }
 
-   frame(window &par, int x, int y, char *t) : window(par, x, y, 80, 30)
+   frame(window &par, int x, int y, const char t[]) : window(par, x, y, 80, 30)
    {
       Background(inside_3D);
       strength = 5;
index 61de4b1..dd83de4 100644 (file)
  */
 
 #include <stdio.h>
+#include <string.h>
 #include "parsedate.h"
 
 static char *RCSID = "$Id: parsedate.c,v 1.2 2002-09-28 06:58:45 arjen Exp $";
 
 extern int yyparse();
 
-compute_unixtime (register struct parseddate *pd);
+void compute_unixtime (register struct parseddate *pd);
 
 /* Number of seconds in various time intervals. */
 #define SEC_PER_MIN  60
@@ -141,7 +142,7 @@ struct parseddate * parsedate (char *date)
  *     far future may turn out to be incorrect if any changes are made
  *     to the calendar between now and then.
  */
-compute_unixtime (register struct parseddate *pd)
+void compute_unixtime (register struct parseddate *pd)
 {
     register int weekday, n, l, a;
 
@@ -206,7 +207,7 @@ compute_unixtime (register struct parseddate *pd)
  *     ute", "second", and "weekday" fields.  The "dst" and "error"
  *     fields of the structure are not used or modified.
  */
-break_down_unixtime (pd)
+void break_down_unixtime (pd)
     register struct parseddate *pd;
 {   register unsigned long timevalue;
     register int m, n;
index 684bbba..67fa65b 100644 (file)
@@ -36,10 +36,13 @@ static const char *RCSID = "$Id: xappl.cpp,v 1.1 2002-07-25 08:01:27 arjen Exp $
 
 static char dim_bits[] =
 {
-   0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA
+   '\x55', '\xAA', '\x55', '\xAA', '\x55', '\xAA', '\x55', '\xAA'
 };
 
+extern "C"
+{
 #include "nopicture.xpm"
+}
 
 xapplication *XApp;
 display     stddpy;
index cc6aae9..19d9225 100644 (file)
@@ -332,7 +332,7 @@ int window::ParentResized(int w, int h)
 confused with event masks above.  They start from 2 because 0 and 1
 are reserved in the protocol for errors and replies. */
 
-static char * event_names[] =
+static const char *event_names[] =
 {
    " Undefined(0)",
    " Undefined(1)",
index 36f8e42..b3471a8 100644 (file)
@@ -333,7 +333,7 @@ public:
 
    }
 
-   managed_window(char *name)
+   managed_window(const char name[])
    {
       WM_Delete_Command = 0;
       Atom    wm_delete;