diff --git a/src/add-ons/kernel/file_systems/googlefs/attrs.c b/src/add-ons/kernel/file_systems/googlefs/attrs.c index bf145942bc..203e59aefb 100644 --- a/src/add-ons/kernel/file_systems/googlefs/attrs.c +++ b/src/add-ons/kernel/file_systems/googlefs/attrs.c @@ -355,8 +355,8 @@ uint64 root_folder_attrs_2 = 0xdeadbeef50385038LL; // volume id, just in case 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 @@ struct attr_entry bookmark_attrs[] = { }; /* 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_8[] = { 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 @@ static uint8 template_1_attrs_10[] = { 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, diff --git a/src/add-ons/kernel/file_systems/googlefs/google_request.c b/src/add-ons/kernel/file_systems/googlefs/google_request.c index f39ec17612..bb175fd403 100644 --- a/src/add-ons/kernel/file_systems/googlefs/google_request.c +++ b/src/add-ons/kernel/file_systems/googlefs/google_request.c @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -12,9 +13,11 @@ #include #include #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 @@ static kinet_aton(const char *in, struct in_addr *addr) } -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 @@ status_t google_request_process(struct google_request *req) 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 @@ status_t google_request_process(struct google_request *req) 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 @@ status_t google_request_process(struct google_request *req) 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 @@ status_t google_request_free(struct google_request *req) return EINVAL; free(req->query_string); free(req); + return B_OK; } diff --git a/src/add-ons/kernel/file_systems/googlefs/google_request.h b/src/add-ons/kernel/file_systems/googlefs/google_request.h index eca76b50b6..bb0dcbfca2 100644 --- a/src/add-ons/kernel/file_systems/googlefs/google_request.h +++ b/src/add-ons/kernel/file_systems/googlefs/google_request.h @@ -30,8 +30,8 @@ struct google_result { 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); diff --git a/src/add-ons/kernel/file_systems/googlefs/googlefs.h b/src/add-ons/kernel/file_systems/googlefs/googlefs.h index cc7cff15b4..2aaef36567 100644 --- a/src/add-ons/kernel/file_systems/googlefs/googlefs.h +++ b/src/add-ons/kernel/file_systems/googlefs/googlefs.h @@ -52,6 +52,7 @@ struct attr_entry { void *value; }; +#undef ASSERT #define ASSERT(op) if (!(op)) panic("ASSERT: %s in %s:%s", #op, __FILE__, __FUNCTION__) struct mount_fs_params diff --git a/src/add-ons/kernel/file_systems/googlefs/vnidpool.c b/src/add-ons/kernel/file_systems/googlefs/vnidpool.c index 449824b1f0..e3a33d24fc 100644 --- a/src/add-ons/kernel/file_systems/googlefs/vnidpool.c +++ b/src/add-ons/kernel/file_systems/googlefs/vnidpool.c @@ -4,6 +4,8 @@ */ #include +#include +#include #include "vnidpool.h" /* primary type for the bitmap */ @@ -34,7 +36,7 @@ status_t vnidpool_alloc(struct vnidpool **pool, size_t size) 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_get(struct vnidpool *pool, ino_t *vnid) 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)