Cleanup of -Wpointer-compare warnings.
[oweals/cde.git] / cde / lib / DtHelp / Helpos.c
index 7f6188f2450946b1a54b31f0f01acff09b7310be..fd4285a24256c02a7f4199db599202518c8cdbc5 100644 (file)
@@ -1,3 +1,25 @@
+/*
+ * CDE - Common Desktop Environment
+ *
+ * Copyright (c) 1993-2012, The Open Group. All rights reserved.
+ *
+ * These libraries and programs are free software; you can
+ * redistribute them and/or modify them under the terms of the GNU
+ * Lesser General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option)
+ * any later version.
+ *
+ * These libraries and programs are distributed in the hope that
+ * they will be useful, but WITHOUT ANY WARRANTY; without even the
+ * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with these libraries and programs; if not, write
+ * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
+ * Floor, Boston, MA 02110-1301 USA
+ */
 /* $TOG: Helpos.c /main/13 1998/07/30 12:08:32 mgreess $ */
 /************************************<+>*************************************
  ****************************************************************************
@@ -231,38 +253,10 @@ void DtHelpSetCatalogName(
   if (catFile == NULL)
     {
       /* Setup the short and long versions */
-#ifdef __ultrix
-      CatFileName = strdup("DtHelp.cat");  
-#else
       CatFileName = strdup("DtHelp");
-#endif
     }
   else
-    { 
-#ifdef __ultrix
-
-      /* If we have a full path, just use it */
-      if (*catFile == '/')
-        CatFileName = strdup(catFile);
-      else
-        {
-          /* We don't have a full path, and the ultirx os needs the 
-           * ".cat" extention so let's make sure its there.
-           */
-          if (strcmp(&catFile[strlen(catFile) -4], ".cat") == 0)
-            CatFileName = strdup(catFile);
-          else
-            {
-              /* Create our CatFileName with the extention */
-              CatFileName = malloc (strlen(catFile) + 5);    
-                                    /* +5, 1 for NULL, 4 for ".cat" */
-              strcpy(CatFileName, catFile);
-              strcat(CatFileName, ".cat");
-           }
-         }
-
-        
-#else
+    {
 
       /* If we have a full path, just use it */
       if (*catFile == '/')
@@ -272,7 +266,7 @@ void DtHelpSetCatalogName(
           /* hp-ux os does not work with the ".cat" extention, so
            * if one exists, remove it.
            */
-          
+
            if (strcmp(&catFile[strlen(catFile) -4], ".cat") != 0)
             CatFileName = strdup(catFile);
           else
@@ -284,7 +278,6 @@ void DtHelpSetCatalogName(
               CatFileName[len]= '\0';
             }
         }
-#endif
     }
   _DtHelpProcessUnlock();
 }
@@ -318,22 +311,18 @@ char *_DtHelpGetMessage(
    static nl_catd nlmsg_fd;
 
    _DtHelpProcessLock();
-   if ( first ) 
+   if ( first )
    {
 
      /* Setup our default message catalog names if none have been set! */
      if (CatFileName  == NULL)
        {
          /* Setup the short and long versions */
-#ifdef __ultrix
-         CatFileName = strdup("DtHelp.cat"); 
-#else 
          CatFileName = strdup("DtHelp");
-#endif
        }
-               
+
      loc = _DtHelpGetLocale();
-     if (!loc || !(strcmp (loc, "C"))) 
+     if (!loc || !(strcmp (loc, "C")))
        /*
         * If LANG is not set or if LANG=C, then there
         * is no need to open the message catalog - just
@@ -368,7 +357,7 @@ char *_DtHelpGetMessage(
  *                 If that is NULL, returns NULL.
  *
  *****************************************************************************/
-char *_DtHelpGetLocale()
+char *_DtHelpGetLocale(void)
 {
     char *loc;