Fix warnings on FreeBSD
[oweals/cde.git] / cde / lib / DtHelp / XInterface.c
index 4983393031aba8bd98813d0a9a44c52833434b13..aff1a2b9950ae1627f90b1cbac674be90a42a54a 100644 (file)
@@ -16,7 +16,7 @@
  * details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * 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
  */
@@ -29,7 +29,7 @@
  **   Project:     Cde Help System
  **
  **   Description: This is the UI dependant layer to the Help System.
- **               It recieves requests from the Core Engine for
+ **               It receives requests from the Core Engine for
  **               information or to do rendering.  It does the
  **               appropriate work based on a Motif and X Lib
  **               interface.
@@ -337,7 +337,7 @@ static      SpecialSymbolTable SpcTable[] =
  {"[spades]", {'\252','\0'}, SymbolString}, /*ISOpub , spades suit symbol    */ 
  {"[sub   ]", {'\314','\0'}, SymbolString}, /*ISOtech, subset/is implied by  */ 
  {"[sube  ]", {'\315','\0'}, SymbolString}, /*ISOtech, subset, equals        */ 
-/*"[sung  ]", { ??   ,'\0'},             }, /*ISOnum , musical note(sung txt)*/ 
+/*"[sung  ]", { ??   ,'\0'},             },  *ISOnum , musical note(sung txt)*/
  {"[sup   ]", {'\311','\0'}, SymbolString}, /*ISOtech, superset or implies   */ 
  {"[sup1  ]", {'\271','\0'}, IsoString   }, /*ISOnum , superscript one       */ 
  {"[sup2  ]", {'\262','\0'}, IsoString   }, /*ISOnum , superscript two       */ 
@@ -731,9 +731,9 @@ MyDrawString (
     Display    *dpy,
     Drawable    d,
     GC          gc,
-    int                 font_index,
-    int                 x,
-    int                 y,
+    long        font_index,
+    long        x,
+    long        y,
     const void *string,
     int                 length,
     int          wc,
@@ -802,7 +802,7 @@ ResolveFont (
     char               *lang,
     const char         *charset,
     _DtHelpFontHints    font_attr,
-    int                        *ret_idx )
+    long               *ret_idx )
 {
     int    result = -1;
     char  *xlfdSpec = font_attr.xlfd;
@@ -947,10 +947,10 @@ DADrawLine (
  *             box_x,box_y     Specifies the upper left hand corner of
  *                             the bounding box for this string. This
  *                             includes any traversal and/or link offsets
- *                             relevent for the line this segment occupies.
+ *                             relevant for the line this segment occupies.
  *             box_height      Specifies the maximum height of the bounding
  *                             box for this string. This includes any
- *                             traversal and/or offsets relevent to this
+ *                             traversal and/or offsets relevant to this
  *                             line.
  *             old_flags       Specifies .............
  *             new_flags       Specifies .............
@@ -1246,8 +1246,8 @@ DADrawString (
     if (strWidth)
       {
         MyDrawString (dpy, win, drawGC,
-                       (int) font_ptr,
-                       (int) x, (int) y, string, byte_len,
+                       (long) font_ptr,
+                       (long) x, (long) y, string, byte_len,
                        wc, False, pDAS->font_info);
 
        if (pDAS->dtinfo && NULL != pSCD) {
@@ -1336,10 +1336,10 @@ DADrawString (
  *             box_x,box_y     Specifies the upper left hand corner of
  *                             the bounding box for this string. This
  *                             includes any traversal and/or link offsets
- *                             relevent for the line this segment occupies.
+ *                             relevant for the line this segment occupies.
  *             box_height      Specifies the maximum height of the bounding
  *                             box for this string. This includes any
- *                             traversal and/or offsets relevent to this
+ *                             traversal and/or offsets relevant to this
  *                             line.
  *             link_type       Specifies the link type if this spc is
  *                             part of a link.
@@ -1365,7 +1365,7 @@ DADrawSpc (
     _DtCvFlags  new_flags )
 {
     int                          i;
-    int                          spcLstIdx = (int) spc_handle;
+    long                 spcLstIdx = (long) spc_handle;
     _DtCvUnit            ascent;
     _DtCvUnit            descent;
     const char          *spcStr;
@@ -1693,7 +1693,7 @@ DABuildSelectedSpc (
     _DtCvUnit           space,
     _DtCvFlags          flags )
 {
-    int    spcIdx = (int) spc_handle;
+    long   spcIdx = (long) spc_handle;
     int    i;
     int    totalLen;
     int    spaceNum  = 0;
@@ -1792,7 +1792,7 @@ _DtHelpDAResolveFont (
      * note - if the mod_string comes in with a NULL pointer,
      * it came from our own call rather than the Core Engine.
      */
-    int idx;
+    long idx;
 
     (void) ResolveFont(client_data, lang, charset, font_attr, &idx);
     *ret_font = (_DtCvPointer) idx;
@@ -1822,8 +1822,8 @@ _DtHelpDAResolveSpc (
 {
     register int          i = 0;
     int                          result = -1;
-    int                          fontIdx;
-    int                          spcTbIdx = 0;
+    long                 fontIdx;
+    long                 spcTbIdx = 0;
     _DtCvUnit            ascent;
     _DtCvUnit            descent;
     const char          *newSet;
@@ -1842,7 +1842,7 @@ _DtHelpDAResolveSpc (
 
     if (result == 0)
       {
-       int              spcLstIdx = 0;
+       long             spcLstIdx = 0;
        _DtCvUnit        maxWidth;
        _DtHelpDARegion *pReg;
 
@@ -2068,7 +2068,7 @@ _DtHelpDALoadGraphic (
     if (fileName != file_xid)
        free (fileName);
 
-    if (pGS->pix == NULL)
+    if (pGS->pix == 0)
       {
        free(pReg);
        free(pGS);
@@ -2108,7 +2108,6 @@ _DtHelpDADestroyGraphic (
     _DtCvPointer       graphic_ptr )
 {
     Arg   args[5];
-    int          i;
 
     Colormap colormap;
 
@@ -2155,7 +2154,7 @@ _DtHelpDADestroySpc (
     _DtCvPointer       client_data,
     _DtCvPointer       spc_handle)
 {
-    int                          spc_index = (int) spc_handle;
+    long                 spc_index = (long) spc_handle;
     DtHelpDispAreaStruct *pDAS      = (DtHelpDispAreaStruct *) client_data;
 
     if (pDAS->max_spc == 0)
@@ -2179,7 +2178,6 @@ _DtHelpDADestroyRegion (
     _DtCvPointer       client_data,
     _DtCvPointer       reg_info)
 {
-    DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
     _DtHelpDARegion      *pReg = (_DtHelpDARegion *) reg_info;
 
     if (True == pReg->inited)
@@ -2326,7 +2324,7 @@ _DtHelpDAGetFontMetrics (
 {
     DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
 
-    __DtHelpFontMetrics (pDAS->font_info, (int) font_ptr,
+    __DtHelpFontMetrics (pDAS->font_info, (long) font_ptr,
                ret_ascent, ret_descent, ret_width, ret_super, ret_sub);
 }
 
@@ -2348,7 +2346,7 @@ _DtHelpDAGetStrWidth (
 {
     DtHelpDispAreaStruct *pDAS = (DtHelpDispAreaStruct *) client_data;
     int   length;
-    int   font_index;
+    long  font_index;
     _DtCvStringInfo *strInfo;
 
     if (elem_type != _DtCvSTRING_TYPE)
@@ -2364,7 +2362,7 @@ _DtHelpDAGetStrWidth (
      * was opened for this string.  Use the X11R5 I18N routine to figure
      * out its length.  Otherwise use the standard X11 text width call.
      */
-    font_index = (int) strInfo->font_ptr;
+    font_index = (long) strInfo->font_ptr;
     if (font_index < 0)
       {
        if (0 == strInfo->wc)