Mercurial > dwindows
diff gtk3/dw.c @ 986:87dc0f5f96d0
Fix return type of dw_listbox_selected() to be "int" instead of "unsigned int" to allow -1 return.
Changed return values of a number of functions to be consistent across platforms and use the defines.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 07 May 2011 05:14:06 +0000 |
parents | ab244c6f9386 |
children | f1c7b03f944d |
line wrap: on
line diff
--- a/gtk3/dw.c Sat May 07 02:15:50 2011 +0000 +++ b/gtk3/dw.c Sat May 07 05:14:06 2011 +0000 @@ -5374,7 +5374,7 @@ gtk_widget_show(tree); free(array); DW_MUTEX_UNLOCK; - return TRUE; + return DW_ERROR_NONE; } /* @@ -5415,7 +5415,7 @@ if ( newtitles) free(newtitles); if ( newflags ) free(newflags); - return TRUE; + return DW_ERROR_NONE; } /* @@ -7266,14 +7266,14 @@ int dw_event_reset (HEV eve) { if(!eve) - return FALSE; + return DW_ERROR_NON_INIT; pthread_mutex_lock (&(eve->mutex)); pthread_cond_broadcast (&(eve->event)); pthread_cond_init (&(eve->event), NULL); eve->posted = 0; pthread_mutex_unlock (&(eve->mutex)); - return 0; + return DW_ERROR_NONE; } /* @@ -7285,13 +7285,13 @@ int dw_event_post (HEV eve) { if(!eve) - return FALSE; + return DW_ERROR_NON_INIT; pthread_mutex_lock (&(eve->mutex)); pthread_cond_broadcast (&(eve->event)); eve->posted = 1; pthread_mutex_unlock (&(eve->mutex)); - return 0; + return DW_ERROR_NONE; } /* @@ -7307,10 +7307,10 @@ struct timespec timeo; if(!eve) - return FALSE; + return DW_ERROR_NON_INIT; if(eve->posted) - return 0; + return DW_ERROR_GENERAL; pthread_mutex_lock (&(eve->mutex)); gettimeofday(&now, 0); @@ -7319,10 +7319,10 @@ rc = pthread_cond_timedwait (&(eve->event), &(eve->mutex), &timeo); pthread_mutex_unlock (&(eve->mutex)); if(!rc) - return 1; + return DW_ERROR_NONE; if(rc == ETIMEDOUT) - return -1; - return 0; + return DW_ERROR_TIMEOUT; + return DW_ERROR_GENERAL; } /* @@ -7333,7 +7333,7 @@ int dw_event_close(HEV *eve) { if(!eve || !(*eve)) - return FALSE; + return DW_ERROR_NON_INIT; pthread_mutex_lock (&((*eve)->mutex)); pthread_cond_destroy (&((*eve)->event)); @@ -7342,7 +7342,7 @@ free(*eve); *eve = NULL; - return TRUE; + return DW_ERROR_NONE; } struct _seminfo { @@ -8887,7 +8887,7 @@ * Parameters: * handle: Handle to the listbox to be queried. */ -unsigned int dw_listbox_selected(HWND handle) +int dw_listbox_selected(HWND handle) { GtkWidget *handle2 = handle; GtkListStore *store = NULL;