[haiku-commits] r35900 - haiku/trunk/src/add-ons/kernel/file_systems/googlefs

  • From: revol@xxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 18 Mar 2010 16:45:03 +0100 (CET)

Author: mmu_man
Date: 2010-03-18 16:45:02 +0100 (Thu, 18 Mar 2010)
New Revision: 35900
Changeset: http://dev.haiku-os.org/changeset/35900/haiku

Modified:
   haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c
   haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.c
   haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.h
   haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.h
   haiku/trunk/src/add-ons/kernel/file_systems/googlefs/vnidpool.c
Log:
Fix various warnings.


Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c        
2010-03-18 12:33:23 UTC (rev 35899)
+++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/attrs.c        
2010-03-18 15:45:02 UTC (rev 35900)
@@ -355,8 +355,8 @@
 
 struct attr_entry root_folder_attrs[] = {
 { "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', 
SZSTR("application/x-vnd.Be-directory") },
-{ "BEOS:M:STD_ICON", 'MICN', 16*16, google_icon_M },
-{ "BEOS:L:STD_ICON", 'ICON', 32*32, google_icon_L },
+{ "BEOS:M:STD_ICON", 'MICN', 16*16, (char *)google_icon_M },
+{ "BEOS:L:STD_ICON", 'ICON', 32*32, (char *)google_icon_L },
 { "BEOS:V:STD_ICON", 'zICO', sizeof(google_icon_SVG), google_icon_SVG },
 { "BEOS:D:STD_ICON", 0x6949434F, sizeof(root_folder_attrs_1), 
&root_folder_attrs_1 },
 { "BEOS:ICON", 'VICN', sizeof(google_icon_HVIF), google_icon_HVIF },
@@ -404,7 +404,7 @@
 };
 
 /* for debugging */
-static int32 fake_bm_attr_1 = 1;
+//static int32 fake_bm_attr_1 = 1;
 struct attr_entry fake_bookmark_attrs[] = {
 { "BEOS:TYPE", /*B_MIME_STRING_TYPE*/'MIMS', 
SZSTR("application/x-vnd.Be-bookmark") },
 { "META:title", 'CSTR', SZSTR("Plop!") },
@@ -442,7 +442,7 @@
 static uint8 template_1_attrs_9[] = {
  0x00, 0x00, 0x00, 0x00, 0x58, 0x10, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x48, 0x44, 
  0x00, 0x00, 0x0c, 0x44 };
-static uint8 template_1_attrs_10[] = {
+/*static uint8 template_1_attrs_10[] = {
  0x52, 0x56, 0xf2, 0x4f, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x54, 
0x69, 0x74, 0x6c, 
  0x65, 0x00, 0x00, 0x00, 0x20, 0x42, 0x00, 0x00, 0x50, 0x43, 0x00, 0x00, 0x00, 
0x00, 0x0a, 0x00, 
  0x00, 0x00, 0x4d, 0x45, 0x54, 0x41, 0x3a, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x00, 
0x52, 0x7d, 0xfb, 
@@ -461,7 +461,7 @@
  0x67, 0x6c, 0x65, 0x20, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x00, 0xc0, 0x55, 
0x44, 0x00, 0x00, 
  0x70, 0x41, 0x01, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x47, 0x4f, 0x4f, 
0x47, 0x4c, 0x45, 
  0x3a, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x00, 0x47, 0xde, 0xef, 0xfc, 0x47, 0x4e, 
0x4f, 0x4c, 0x00, 
- 0x00 };
+ 0x00 };*/
 static uint8 template_1_attrs_11[] = {
  0x52, 0xf5, 0x5e, 0x6f, 0x0a, 0x00, 0x00, 0x00, 0x74, 0x73, 0x6c, 0x54, 0x00, 
0x00, 0x00, 0x00, 
  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x00, 

Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.c       
2010-03-18 12:33:23 UTC (rev 35899)
+++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.c       
2010-03-18 15:45:02 UTC (rev 35900)
@@ -5,6 +5,7 @@
 
 #include <OS.h>
 #include <KernelExport.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <netinet/in.h>
@@ -12,9 +13,11 @@
 #include <malloc.h>
 #include <sys/socket.h>
 #include "http_cnx.h"
+#include "googlefs.h"
 #include "google_request.h"
 #include "lists2.h"
 #include "settings.h"
+#include "string_utils.h"
 
 #define DO_PUBLISH
 //#define FAKE_INPUT "/boot/home/devel/drivers/googlefs/log2.html"
@@ -35,14 +38,14 @@
 extern int google_parse_results(const char *html, size_t htmlsize, struct 
google_result **results);
 
 // move that to ksocket inlined
-static kinet_aton(const char *in, struct in_addr *addr)
+static int kinet_aton(const char *in, struct in_addr *addr)
 {
        int i;
        unsigned long a;
        uint32 inaddr = 0L;
        const char *p = in;
        for (i = 0; i < 4; i++) {
-               a = strtoul(p, &p, 10);
+               a = strtoul(p, (char **)&p, 10);
                if (!p)
                        return -1;
                inaddr = (inaddr >> 8) | ((a & 0x0ff) << 24);
@@ -55,14 +58,14 @@
 }
 
 
-status_t google_request_init()
+status_t google_request_init(void)
 {
        status_t err;
        err = http_init();
        return err;
 }
 
-status_t google_request_uninit()
+status_t google_request_uninit(void)
 {
        status_t err;
        err = http_uninit();
@@ -74,8 +77,8 @@
        struct sockaddr_in sin;
        struct http_cnx *cnx = NULL;
        struct google_result *res;
-       int err, i, count;
-       size_t len;
+       status_t err;
+       int count;
        char *p = NULL;
        char *url = NULL;
        
@@ -106,7 +109,7 @@
        if (!url)
                goto err_url;
        strcpy(url, BASEURL);
-       sprintf(url+strlen(url), FMT_NUM, max_results);
+       sprintf(url+strlen(url), FMT_NUM, (unsigned int)max_results);
        sprintf(url+strlen(url), FMT_Q, p);
        
        dprintf("google_request: final URL: %s\n", url);
@@ -115,7 +118,7 @@
        dprintf("google_request: http_get: error 0x%08lx\n", err);
        if (err < 0)
                goto err_url2;
-       dprintf("google_request: http_get: HEADERS %d:%s\n", cnx->headerslen, 
cnx->headers);
+       dprintf("google_request: http_get: HEADERS %ld:%s\n", cnx->headerslen, 
cnx->headers);
        //dprintf("DATA: %d:%s\n", cnx->datalen, cnx->data);
        
        dprintf("google_request: buffer @ %p, len %ld\n", cnx->data, 
cnx->datalen);
@@ -216,4 +219,5 @@
                return EINVAL;
        free(req->query_string);
        free(req);
+       return B_OK;
 }

Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.h       
2010-03-18 12:33:23 UTC (rev 35899)
+++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/google_request.h       
2010-03-18 15:45:02 UTC (rev 35900)
@@ -30,8 +30,8 @@
        char similar_url[GR_MAX_URL];
 };
 
-extern status_t google_request_init();
-extern status_t google_request_uninit();
+extern status_t google_request_init(void);
+extern status_t google_request_uninit(void);
 extern status_t google_request_process(struct google_request *req);
 extern status_t google_request_process_async(struct google_request *req);
 extern status_t google_request_close(struct google_request *req);

Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.h
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.h     
2010-03-18 12:33:23 UTC (rev 35899)
+++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/googlefs.h     
2010-03-18 15:45:02 UTC (rev 35900)
@@ -52,6 +52,7 @@
        void *value;
 };
 
+#undef ASSERT
 #define ASSERT(op) if (!(op)) panic("ASSERT: %s in %s:%s", #op, __FILE__, 
__FUNCTION__)
 
 struct mount_fs_params

Modified: haiku/trunk/src/add-ons/kernel/file_systems/googlefs/vnidpool.c
===================================================================
--- haiku/trunk/src/add-ons/kernel/file_systems/googlefs/vnidpool.c     
2010-03-18 12:33:23 UTC (rev 35899)
+++ haiku/trunk/src/add-ons/kernel/file_systems/googlefs/vnidpool.c     
2010-03-18 15:45:02 UTC (rev 35900)
@@ -4,6 +4,8 @@
  */
 
 #include <malloc.h>
+#include <string.h>
+#include <KernelExport.h>
 #include "vnidpool.h"
 
 /* primary type for the bitmap */
@@ -34,7 +36,7 @@
        p->bitmap = (BMT *)(p + 1);
        p->bmsize = size;
        memset(p->bitmap, 0, size / sizeof(BMT));
-       dprintf("vnidpool_alloc: pool @ %p, bitmap @ %p, size %d\n", p, 
p->bitmap, p->bmsize);
+       dprintf("vnidpool_alloc: pool @ %p, bitmap @ %p, size %ld\n", p, 
p->bitmap, p->bmsize);
        *pool = p;
        return B_OK;
 }
@@ -84,7 +86,6 @@
 status_t vnidpool_put(struct vnidpool *pool, ino_t vnid)
 {
        status_t err = B_ERROR;
-       uint32 i;
        if (!pool)
                return EINVAL;
        if (LOCK(&pool->lock) < B_OK)


Other related posts: