Static analyzer bug fixes
[silc.git] / apps / irssi / src / silc / core / silc-queries.c
index 0da01d6b6918a9c6eec30a4a08c5ab4d395dbc82..18ddf04dee9fa69301b3235773d0ce512922b808 100644 (file)
@@ -4,7 +4,7 @@
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2002 - 2007 Pekka Riikonen
+  Copyright (C) 2002 - 2008 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@
 #include "fe-common/core/keyboard.h"
 #include "fe-common/silc/module-formats.h"
 
-static void silc_query_attributes_print_final(bool success, void *context);
+static void silc_query_attributes_print_final(SilcBool success, void *context);
 static void silc_query_attributes_accept(const char *line, void *context,
                SilcKeyboardPromptStatus reason);
 
@@ -70,7 +70,7 @@ void command_attr(const char *data, SILC_SERVER_REC *server,
   SilcUInt32 argc;
   SilcUInt32 *argv_lens, *argv_types;
   const char *sv;
-  bool allowed;
+  SilcBool allowed;
 
   /* Now parse all arguments */
   tmp = g_strconcat("ATTR", " ", data, NULL);
@@ -254,7 +254,7 @@ void silc_query_attributes_default(SilcClient client,
   SilcAttributeObjDevice dev;
   SilcAttributeObjPk pk;
   SilcVCardStruct vcard;
-  bool allowed;
+  SilcBool allowed;
 
   memset(&service, 0, sizeof(service));
   memset(&geo, 0, sizeof(geo));
@@ -366,7 +366,8 @@ void silc_query_attributes_default(SilcClient client,
        mask |= SILC_ATTRIBUTE_MOOD_ANXIOUS;
     }
     silc_client_attribute_add(silc_client, conn,
-                             SILC_ATTRIBUTE_STATUS_MOOD, (void *)mask,
+                             SILC_ATTRIBUTE_STATUS_MOOD,
+                             SILC_32_TO_PTR(mask),
                              sizeof(SilcUInt32));
     g_strfreev(list);
   }
@@ -437,7 +438,8 @@ void silc_query_attributes_default(SilcClient client,
        mask |= SILC_ATTRIBUTE_CONTACT_VIDEO;
     }
     silc_client_attribute_add(silc_client, conn,
-                             SILC_ATTRIBUTE_PREFERRED_CONTACT, (void *)mask,
+                             SILC_ATTRIBUTE_PREFERRED_CONTACT,
+                             SILC_32_TO_PTR(mask),
                              sizeof(SilcUInt32));
     g_strfreev(list);
   }
@@ -559,8 +561,8 @@ typedef struct {
   SilcVCardStruct vcard;
   SilcMime message;
   SilcMime extension;
-  bool nopk;
-  bool autoaccept;
+  SilcBool nopk;
+  SilcBool autoaccept;
 } *AttrVerify;
 
 void silc_query_attributes_print(SILC_SERVER_REC *server,
@@ -920,7 +922,7 @@ void silc_query_attributes_print(SILC_SERVER_REC *server,
   }
 }
 
-static void silc_query_attributes_print_final(bool success, void *context)
+static void silc_query_attributes_print_final(SilcBool success, void *context)
 {
   AttrVerify verify = context;
   SILC_SERVER_REC *server = verify->server;
@@ -970,7 +972,7 @@ static void silc_query_attributes_print_final(bool success, void *context)
                            format, 0, verify, &server->prompt_op);
   } else {
     /* Save new data to existing directory */
-        verify->autoaccept = TRUE; /* Ensure we don't twiddle the async context */
+    verify->autoaccept = TRUE; /* Ensure we don't twiddle the async context */
     silc_query_attributes_accept("Y", verify, KeyboardCompletionSuccess);
   }
 
@@ -987,7 +989,7 @@ static void silc_query_attributes_accept(const char *line, void *context,
   unsigned char filename[256], filename2[256], *fingerprint = NULL, *tmp;
   SilcUInt32 len;
   int i;
-  bool success = (reason == KeyboardCompletionSuccess);
+  SilcBool success = (reason == KeyboardCompletionSuccess);
 
   if (success && (line[0] == 'Y' || line[0] == 'y')) {
     /* Save the attributes */