diff mac/dw.m @ 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 6abf763838c6
children 6de00477d627
line wrap: on
line diff
--- a/mac/dw.m	Sat May 07 02:15:50 2011 +0000
+++ b/mac/dw.m	Sat May 07 05:14:06 2011 +0000
@@ -4070,7 +4070,7 @@
  * Parameters:
  *          handle: Handle to the listbox to be queried.
  */
-unsigned int API dw_listbox_selected(HWND handle)
+int API dw_listbox_selected(HWND handle)
 {
     id object = handle;
 
@@ -5225,7 +5225,7 @@
         [column release];
     }
     DW_MUTEX_UNLOCK;
-    return TRUE;
+    return DW_ERROR_NONE;
 }
 
 /*
@@ -5254,7 +5254,7 @@
 
     free(newtitles);
     free(newflags);
-    return TRUE;
+    return DW_ERROR_NONE;
 }
 
 /*
@@ -8283,14 +8283,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;
 }
 
 /*
@@ -8324,10 +8324,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);
@@ -8336,10 +8336,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;
 }
 
 /*
@@ -8350,7 +8350,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));
@@ -8359,7 +8359,7 @@
    free(*eve);
    *eve = NULL;
 
-   return TRUE;
+   return DW_ERROR_NONE;
 }
 
 struct _seminfo {