tFix various compile issues - vaccinewars - be a doctor and try to vaccinate the world
 (HTM) git clone git://src.adamsgaard.dk/vaccinewars
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 6b41f20d284976f94b6e33c71b08dd539fa8ea57
 (DIR) parent 9e973bc12da1ce013e292e240f95b9029670d591
 (HTM) Author: Ben Webb <ben@salilab.org>
       Date:   Thu, 26 Nov 2020 23:38:01 -0800
       
       Fix various compile issues
       
       Diffstat:
         M src/gtkport/clist.c                 |       8 ++++----
         M src/gtkport/gtkport.c               |      19 ++++++++++---------
         M src/gtkport/gtkport.h               |       4 ++--
         M src/gtkport/gtktypes.h              |       2 +-
         M src/gtkport/itemfactory.h           |       2 ++
         M src/gtkport/treeview.c              |       2 +-
         M src/gtkport/treeview.h              |       1 +
       
       7 files changed, 21 insertions(+), 17 deletions(-)
       ---
 (DIR) diff --git a/src/gtkport/clist.c b/src/gtkport/clist.c
       t@@ -149,11 +149,11 @@ gboolean gtk_clist_wndproc(GtkWidget *widget, UINT msg, WPARAM wParam,
                return FALSE;
              case HDN_ITEMCLICKA:
                phdr = (HD_NOTIFYA FAR *)lParam;
       -        gtk_signal_emit(GTK_OBJECT(widget), "click-column", (gint)phdr->iItem);
       +        gtk_signal_emit(G_OBJECT(widget), "click-column", (gint)phdr->iItem);
                return FALSE;
              case HDN_ITEMCLICKW:
                phdrw = (HD_NOTIFYW FAR *)lParam;
       -        gtk_signal_emit(GTK_OBJECT(widget), "click-column", (gint)phdrw->iItem);
       +        gtk_signal_emit(G_OBJECT(widget), "click-column", (gint)phdrw->iItem);
                return FALSE;
              default:
                break;
       t@@ -830,7 +830,7 @@ void gtk_clist_update_selection(GtkWidget *widget)
              gint row = GPOINTER_TO_INT(selpt->data);
        
              if (!g_list_find(clist->selection, GINT_TO_POINTER(row))) {
       -        gtk_signal_emit(GTK_OBJECT(widget), "unselect_row", row, 0, NULL);
       +        gtk_signal_emit(G_OBJECT(widget), "unselect_row", row, 0, NULL);
              }
            }
        
       t@@ -838,7 +838,7 @@ void gtk_clist_update_selection(GtkWidget *widget)
              gint row = GPOINTER_TO_INT(selpt->data);
        
              if (!g_list_find(oldsel, GINT_TO_POINTER(row))) {
       -        gtk_signal_emit(GTK_OBJECT(widget), "select_row", row, 0, NULL);
       +        gtk_signal_emit(G_OBJECT(widget), "select_row", row, 0, NULL);
              }
            }
          }
 (DIR) diff --git a/src/gtkport/gtkport.c b/src/gtkport/gtkport.c
       t@@ -444,7 +444,7 @@ static GtkSignalType GtkComboBoxSignals[] = {
          {"", NULL, NULL}
        };
        
       -static GtkClass GtkComboxBoxClass = {
       +static GtkClass GtkComboBoxClass = {
          "combobox", &GtkWidgetClass, sizeof(GtkComboBox),
          GtkComboBoxSignals, NULL
        };
       t@@ -611,7 +611,7 @@ static GtkSignalType GtkWindowSignals[] = {
          {"show", gtk_marshal_VOID__VOID, gtk_window_show},
          {"hide", gtk_marshal_VOID__VOID, gtk_window_hide},
          {"delete_event", gtk_marshal_BOOL__GPOIN,
       -   GTK_SIGNAL_FUNC(gtk_window_delete_event)},
       +   G_CALLBACK(gtk_window_delete_event)},
          {"", NULL, NULL}
        };
        
       t@@ -1324,7 +1324,7 @@ void gtk_widget_show(GtkWidget *widget)
        
        gboolean gtk_widget_get_visible(GtkWidget *widget)
        {
       -  return GTK_WIDGET_FLAGS(widget) & GTK_VISIBLE != 0;
       +  return (GTK_WIDGET_FLAGS(widget) & GTK_VISIBLE) != 0;
        }
        
        void gtk_widget_show_full(GtkWidget *widget, gboolean recurse)
       t@@ -1936,7 +1936,7 @@ GtkWidget *gtk_box_new(GtkOrientation orientation, gint spacing)
          return GTK_WIDGET(box);
        }
        
       -void gtk_box_set_homogeneous(GtkBox *box, gboolean homogenenous)
       +void gtk_box_set_homogeneous(GtkBox *box, gboolean homogeneous)
        {
          box->homogeneous = homogeneous;
        }
       t@@ -4733,9 +4733,10 @@ void gtk_combo_box_set_model(GtkComboBox *combo_box, GtkTreeModel *model)
          if (hWnd && combo_box->model_column >= 0) {
            int nrow;
            int col = combo_box->model_column;
       -    assert(model->coltype[col] == G_TYPE_STRING);
       +    g_assert(model->coltype[col] == G_TYPE_STRING);
            for (nrow = 0; nrow < combo_box->model->rows->len; ++nrow) {
       -      row = &g_array_index(combo_box->model->rows, GtkListStoreRow, nrow);
       +      GtkListStoreRow *row = &g_array_index(combo_box->model->rows,
       +                                            GtkListStoreRow, nrow);
              myComboBox_AddString(hWnd, row->data[col]);
            }
            mySendMessage(hWnd, CB_SETCURSEL, (WPARAM)combo_box->active, 0);
       t@@ -4753,7 +4754,7 @@ void gtk_combo_box_set_active(GtkComboBox *combo_box, gint index)
        }
        
        gboolean gtk_combo_box_get_active_iter(GtkComboBox *combo_box,
       -                                       GtkTreeIter *iter);
       +                                       GtkTreeIter *iter)
        {
          if (combo_box->active >= 0) {
            *iter = combo_box->active;
       t@@ -5168,8 +5169,8 @@ GtkWidget *gtk_button_box_new(GtkOrientation orientation)
            /* Add a spacer so that all hboxes are right-aligned */
            spacer = gtk_label_new("");
            gtk_box_pack_start(GTK_BOX(bbox), spacer, TRUE, TRUE, 0);
       -  } else {
       -  return hbbox;
       +  }
       +  return bbox;
        }
        
        void gtk_box_set_spacing(GtkBox *box, gint spacing)
 (DIR) diff --git a/src/gtkport/gtkport.h b/src/gtkport/gtkport.h
       t@@ -331,7 +331,7 @@ extern HINSTANCE hInst;
        #define GTK_PROGRESS_BAR(obj) ((GtkProgressBar *)(obj))
        #define G_CALLBACK(f) ((GCallback) (f))
        
       -#define GTK_OBJECT_FLAGS(obj) (GTK_OBJECT(obj)->flags)
       +#define GTK_OBJECT_FLAGS(obj) (G_OBJECT(obj)->flags)
        #define GTK_WIDGET_FLAGS(wid) (GTK_OBJECT_FLAGS(wid))
        #define GTK_WIDGET_REALIZED(wid) ((GTK_WIDGET_FLAGS(wid)&GTK_REALIZED) != 0)
        #define GTK_WIDGET_SENSITIVE(wid) ((GTK_WIDGET_FLAGS(wid)&GTK_SENSITIVE) != 0)
       t@@ -369,7 +369,7 @@ void gtk_container_set_border_width(GtkContainer *container,
        GtkWidget *gtk_button_new_with_label(const gchar *label);
        GtkWidget *gtk_label_new(const gchar *text);
        GtkWidget *gtk_box_new(GtkOrientation orientation, gint spacing);
       -void gtk_box_set_homogeneous(GtkBox *box, gboolean homogenenous);
       +void gtk_box_set_homogeneous(GtkBox *box, gboolean homogeneous);
        GtkWidget *gtk_check_button_new_with_label(const gchar *label);
        GtkWidget *gtk_radio_button_new_with_label(GSList *group,
                                                   const gchar *label);
 (DIR) diff --git a/src/gtkport/gtktypes.h b/src/gtkport/gtktypes.h
       t@@ -62,7 +62,7 @@ typedef struct _GtkWidget GtkWidget;
        typedef struct _GtkSignalType GtkSignalType;
        typedef struct _GtkContainer GtkContainer;
        
       -typedef void (*GCallback) (void);
       +typedef void (*GCallback) ();
        typedef void (*GtkSignalMarshaller) (GObject *object, GSList *actions,
                                             GCallback default_action,
                                             va_list args);
 (DIR) diff --git a/src/gtkport/itemfactory.h b/src/gtkport/itemfactory.h
       t@@ -34,6 +34,8 @@
        #include <glib.h>
        
        #ifdef CYGWIN
       +#include <winsock2.h>
       +#include <windows.h>
        #include "gtktypes.h"
        #else
        #include <gtk/gtk.h>
 (DIR) diff --git a/src/gtkport/treeview.c b/src/gtkport/treeview.c
       t@@ -433,7 +433,7 @@ static void gtk_tree_view_column_free(gpointer data)
          g_free(col);
        }
        
       -static void gtk_tree_model_free(GtkTreeModel *model)
       +void gtk_tree_model_free(GtkTreeModel *model)
        {
          gtk_list_store_clear(model);  /* Remove all rows */
          g_array_free(model->rows, TRUE);
 (DIR) diff --git a/src/gtkport/treeview.h b/src/gtkport/treeview.h
       t@@ -147,6 +147,7 @@ gpointer g_object_ref(gpointer object);
        
        /* Private functions */
        void InitTreeViewClass(HINSTANCE hInstance);
       +void gtk_tree_model_free(GtkTreeModel *model);
        #endif /* CYGWIN */
        
        #endif