diff os2/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 2b1b9b995748
children 3d898b78c2ad
line wrap: on
line diff
--- a/os2/dw.c	Sat May 07 02:15:50 2011 +0000
+++ b/os2/dw.c	Sat May 07 05:14:06 2011 +0000
@@ -2634,7 +2634,7 @@
                         if(_recursing == 0 && (tmp->window == conthwnd || (!id && tmp->window == (HWND)mp2)))
                         {
                            char buf1[500];
-                           unsigned int index = dw_listbox_selected(tmp->window);
+                           int index = dw_listbox_selected(tmp->window);
 
                            dw_listbox_get_text(tmp->window, index, buf1, 500);
 
@@ -6288,7 +6288,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)
 {
       return (unsigned int)WinSendMsg(handle,
                               LM_QUERYSELECTION,
@@ -7062,7 +7062,7 @@
    WinSendMsg(handle, CM_SETCNRINFO, &cnri, MPFROMLONG(CMA_FLWINDOWATTR | CMA_SLBITMAPORICON));
 
    free(offStruct);
-   return TRUE;
+   return DW_ERROR_NONE;
 }
 
 /*
@@ -7091,7 +7091,7 @@
 
    free(newtitles);
    free(newflags);
-   return TRUE;
+   return DW_ERROR_NONE;
 }
 
 /*
@@ -8849,8 +8849,8 @@
    ULONG count;
 
    if(DosResetEventSem(eve, &count))
-      return FALSE;
-   return TRUE;
+      return DW_ERROR_GENERAL;
+   return DW_ERROR_NONE;
 }
 
 /*
@@ -8862,8 +8862,8 @@
 int API dw_event_post(HEV eve)
 {
    if(DosPostEventSem(eve))
-      return FALSE;
-   return TRUE;
+      return DW_ERROR_GENERAL;
+   return DW_ERROR_NONE;
 }
 
 
@@ -8877,10 +8877,10 @@
 {
    int rc = DosWaitEventSem(eve, timeout);
    if(!rc)
-      return 1;
+      return DW_ERROR_NONE;
    if(rc == ERROR_TIMEOUT)
-      return -1;
-   return 0;
+      return DW_ERROR_TIMEOUT;
+   return DW_ERROR_GENERAL;
 }
 
 /*
@@ -8891,8 +8891,8 @@
 int API dw_event_close(HEV *eve)
 {
    if(!eve || ~DosCloseEventSem(*eve))
-      return FALSE;
-   return TRUE;
+      return DW_ERROR_GENERAL;
+   return DW_ERROR_NONE;
 }
 
 /* Create a named event semaphore which can be