changeset 2162:a3f105431028

OS2: Switch to using DW_UNUSED() instead of old hack.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Wed, 30 Sep 2020 05:53:45 +0000
parents a1bf891d5990
children 98db0e81a514
files os2/dw.c
diffstat 1 files changed, 27 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Tue Sep 29 22:54:26 2020 +0000
+++ b/os2/dw.c	Wed Sep 30 05:53:45 2020 +0000
@@ -278,11 +278,8 @@
 } CNRITEM, *PCNRITEM;
 
 
-int _null_key(HWND window, int key, void *data)
-{
-   window = window; /* keep compiler happy */
-   key = key; /* keep compiler happy */
-   data = data; /* keep compiler happy */
+int _null_key(HWND DW_UNUSED(window), int DW_UNUSED(key), void * DW_UNUSED(data))
+{
    return TRUE;
 }
 
@@ -9190,11 +9187,10 @@
  *          handle: Handle to the tree containing the item.
  *          item: Handle of the item to be modified.
  */
-char * API dw_tree_get_title(HWND handle, HTREEITEM item)
+char * API dw_tree_get_title(HWND DW_UNUSED(handle), HTREEITEM item)
 {
    PCNRITEM pci = (PCNRITEM)item;
 
-   handle = handle; /* keep compiler happy */
    if(pci && pci->rc.pszIcon)
       return strdup((char *)pci->rc.pszIcon);
    return NULL;
@@ -9206,11 +9202,10 @@
  *          handle: Handle to the tree containing the item.
  *          item: Handle of the item to be modified.
  */
-HTREEITEM API dw_tree_get_parent(HWND handle, HTREEITEM item)
+HTREEITEM API dw_tree_get_parent(HWND DW_UNUSED(handle), HTREEITEM item)
 {
    PCNRITEM pci = (PCNRITEM)item;
 
-   handle = handle; /* keep compiler happy */
    if(pci)
       return pci->parent;
    return (HTREEITEM)0;
@@ -9223,11 +9218,10 @@
  *          item: Handle of the item to be modified.
  *          itemdata: User defined data to be associated with item.
  */
-void API dw_tree_item_set_data(HWND handle, HTREEITEM item, void *itemdata)
+void API dw_tree_item_set_data(HWND DW_UNUSED(handle), HTREEITEM item, void *itemdata)
 {
    PCNRITEM pci = (PCNRITEM)item;
 
-   handle = handle; /* keep compiler happy */
    if(!pci)
       return;
 
@@ -9240,11 +9234,10 @@
  *          handle: Handle to the tree containing the item.
  *          item: Handle of the item to be modified.
  */
-void * API dw_tree_item_get_data(HWND handle, HTREEITEM item)
+void * API dw_tree_item_get_data(HWND DW_UNUSED(handle), HTREEITEM item)
 {
    PCNRITEM pci = (PCNRITEM)item;
 
-   handle = handle; /* keep compiler happy */
    if(!pci)
       return NULL;
    return pci->user;
@@ -9999,7 +9992,7 @@
  *                    DW_RGB_TRANSPARENT will disable coloring rows.
  *                    DW_CLR_DEFAULT will use the system default alternating row colors.
  */
-void API dw_container_set_stripe(HWND handle, unsigned long oddcolor, unsigned long evencolor)
+void API dw_container_set_stripe(HWND DW_UNUSED(handle), unsigned long DW_UNUSED(oddcolor), unsigned long DW_UNUSED(evencolor))
 {
     /* Don't think this is possible on OS/2 */
 }
@@ -10011,11 +10004,8 @@
  *          column: Zero based column of width being set.
  *          width: Width of column in pixels.
  */
-void API dw_container_set_column_width(HWND handle, int column, int width)
-{
-   handle = handle; /* keep compiler happy */
-   column = column; /* keep compiler happy */
-   width = width; /* keep compiler happy */
+void API dw_container_set_column_width(HWND DW_UNUSED(handle), int DW_UNUSED(column), int DW_UNUSED(width))
+{
 }
 
 /*
@@ -10266,9 +10256,8 @@
  *                  DW_SCROLL_BOTTOM. (rows is ignored for last two)
  *       rows: The number of rows to be scrolled.
  */
-void API dw_container_scroll(HWND handle, int direction, long rows)
-{
-   rows = rows; /* keep compiler happy */
+void API dw_container_scroll(HWND handle, int direction, long DW_UNUSED(rows))
+{
    switch(direction)
    {
    case DW_SCROLL_TOP:
@@ -11597,7 +11586,7 @@
 int API dw_module_close(HMOD handle)
 {
    DosFreeModule(handle);
-   return 0;
+   return DW_ERROR_NONE;
 }
 
 /*
@@ -12406,7 +12395,7 @@
  *          This will create a system notification that will show in the notifaction panel
  *          on supported systems, which may be clicked to perform another task.
  */
-HWND API dw_notification_new(const char *title, const char *imagepath, const char *description, ...)
+HWND API dw_notification_new(const char * DW_UNUSED(title), const char * DW_UNUSED(imagepath), const char * DW_UNUSED(description), ...)
 {
    return 0;
 }
@@ -12418,7 +12407,7 @@
  * Returns:
  *         DW_ERROR_NONE on success, DW_ERROR_UNKNOWN on error or not supported.
  */
-int API dw_notification_send(HWND notification)
+int API dw_notification_send(HWND DW_UNUSED(notification))
 {
    return DW_ERROR_UNKNOWN;
 }
@@ -12779,9 +12768,8 @@
  * Returns:
  *       -1 on error.
  */
-int API dw_exec(const char *program, int type, char **params)
-{
-   type = type; /* keep compiler happy */
+int API dw_exec(const char *program, int DW_UNUSED(type), char **params)
+{
 #ifdef __EMX__
    return spawnvp(P_NOWAIT, program, (char * const *)params);
 #else
@@ -12856,10 +12844,8 @@
  *       handle: Handle to the window.
  *       action: One of the DW_HTML_* constants.
  */
-void API dw_html_action(HWND handle, int action)
-{
-   handle = handle;
-   action = action;
+void API dw_html_action(HWND DW_UNUSED(handle), int DW_UNUSED(action))
+{
 }
 
 /*
@@ -12871,10 +12857,8 @@
  * Returns:
  *       0 on success.
  */
-int API dw_html_raw(HWND handle, const char *string)
-{
-   handle = handle;
-   string = string;
+int API dw_html_raw(HWND DW_UNUSED(handle), const char * DW_UNUSED(string))
+{
    return DW_ERROR_UNKNOWN;
 }
 
@@ -12887,10 +12871,8 @@
  * Returns:
  *       0 on success.
  */
-int API dw_html_url(HWND handle, const char *url)
-{
-   handle = handle;
-   url = url;
+int API dw_html_url(HWND DW_UNUSED(handle), const char * DW_UNUSED(url))
+{
    return DW_ERROR_UNKNOWN;
 }
 
@@ -12904,11 +12886,8 @@
  * Returns:
  *       DW_ERROR_NONE (0) on success.
  */
-int dw_html_javascript_run(HWND handle, const char *script, void *scriptdata)
-{
-   handle = handle;
-   script = script;
-   scriptdata = scriptdata;
+int dw_html_javascript_run(HWND DW_UNUSED(handle), const char * DW_UNUSED(script), void * DW_UNUSED(scriptdata))
+{
    return DW_ERROR_UNKNOWN;
 }
 
@@ -12919,9 +12898,8 @@
  *       text: The default text to be in the entryfield widget.
  *       id: An ID to be used with dw_window_from_id() or 0L.
  */
-HWND API dw_html_new(unsigned long id)
-{
-   id = id;
+HWND API dw_html_new(unsigned long DW_UNUSED(id))
+{
    dw_debug("HTML widget not available; OS/2 currently does not support it.\n");
    return 0;
 }
@@ -13323,7 +13301,7 @@
  *          The appname is only required on Windows.  If NULL is passed the detected
  *          application name will be used, but a prettier name may be desired.
  */
-int API dw_app_id_set(const char *appid, const char *appname)
+int API dw_app_id_set(const char * DW_UNUSED(appid), const char * DW_UNUSED(appname))
 {
     return DW_ERROR_UNKNOWN;
 }