fixing segv
[oweals/gnunet.git] / src / datacache / plugin_datacache_mysql.c
index d83d18cd6c217e8a6b80a96cc478a0654f2c7999..8241fb5f85af2d9ae1bccd02e0356c3b2bed71a9 100644 (file)
          ON gnunet.* TO $USER@localhost;
       SET PASSWORD FOR $USER@localhost=PASSWORD('$the_password_you_like');
       FLUSH PRIVILEGES;
* @endverbatim
  @endverbatim
  * 2) In the $HOME directory of $USER, create a ".my.cnf" file
  *    with the following lines
  * @verbatim
       [client]
       user=$USER
       password=$the_password_you_like
* @endverbatim
  @endverbatim
  *
  * Thats it -- now you can configure your datastores in GNUnet to
  * use MySQL. Note that .my.cnf file is a security risk unless its on
@@ -61,7 +61,7 @@
  * @verbatim
       $ mysql -u $USER -p $the_password_you_like
       mysql> use gnunet;
* @endverbatim
  @endverbatim
  *
  *    If you get the message "Database changed" it probably works.
  *
@@ -479,7 +479,7 @@ init_params (struct Plugin *plugin,
   memset (qbind, 0, sizeof (qbind));
   off = 0;
   ft = 0;
-  while ((pc > 0) && (-1 != (ft = va_arg (ap, enum enum_field_types))))
+  while ( (pc > 0) && (-1 != (int) (ft = va_arg (ap, enum enum_field_types))) )
     {
       qbind[off].buffer_type = ft;
       switch (ft)
@@ -510,7 +510,7 @@ init_params (struct Plugin *plugin,
       pc--;
       off++;
     }
-  if (!((pc == 0) && (ft != -1) && (va_arg (ap, int) == -1)))
+  if (! ( (pc == 0) && (-1 != (int) ft) && (va_arg (ap, int) == -1)) )
     {
       GNUNET_break (0);
       return GNUNET_SYSERR;
@@ -721,10 +721,10 @@ itable (struct Plugin *plugin)
  * @param discard_time when to discard the value in any case
  * @return 0 on error, number of bytes used otherwise
  */
-static uint32_t 
+static size_t 
 mysql_plugin_put (void *cls,
                  const GNUNET_HashCode * key,
-                 uint32_t size,
+                 size_t size,
                  const char *data,
                  enum GNUNET_BLOCK_Type type,
                  struct GNUNET_TIME_Absolute discard_time)