Mercurial > dillo_port1.3
changeset 335:4a6db4341660
- Made several cleanups according to compiler warnings with "-W -Wall".
author | jcid |
---|---|
date | Sun, 14 Sep 2008 16:07:12 +0200 |
parents | 619177c88430 |
children | 3dcac1f10b96 |
files | dpi/bookmarks.c dpi/file.c dpid/dpid.c dpid/main.c src/IO/IO.c src/bw.c src/bw.h src/chain.c src/dicache.c src/dicache.h src/gif.c src/jpeg.c src/png.c src/uicmd.cc |
diffstat | 14 files changed, 30 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/dpi/bookmarks.c Sun Sep 14 15:10:41 2008 +0200 +++ b/dpi/bookmarks.c Sun Sep 14 16:07:12 2008 +0200 @@ -1107,7 +1107,7 @@ * Parse a delete bms request, delete them, and update bm file. * Return code: { 0:OK, 1:Abort } */ -static int Bmsrv_modify_delete(SockHandler *sh, char *url) +static int Bmsrv_modify_delete(char *url) { char *p; int nb, ns, key; @@ -1153,7 +1153,7 @@ * Parse a move urls request, move and update bm file. * Return code: { 0:OK, 1:Abort } */ -static int Bmsrv_modify_move(SockHandler *sh, char *url) +static int Bmsrv_modify_move(char *url) { char *p; int n, section = 0, key; @@ -1192,7 +1192,7 @@ * Parse a modify request: update urls and sections, then save. * Return code: { 0:OK, 1:Abort } */ -static int Bmsrv_modify_update(SockHandler *sh, char *url) +static int Bmsrv_modify_update(char *url) { char *p, *q, *title; int i, key; @@ -1247,7 +1247,7 @@ * Parse an "add section" request, and update the bm file. * Return code: { 0:OK, 1:Abort } */ -static int Bmsrv_modify_add_section(SockHandler *sh, char *url) +static int Bmsrv_modify_add_section(char *url) { char *p, *title = NULL; @@ -1400,13 +1400,13 @@ return 2; if (strstr(url, "operation=delete&")) { - if (Bmsrv_modify_delete(sh, url) == 1) + if (Bmsrv_modify_delete(url) == 1) return 1; if (Bmsrv_send_reload_request(sh, "dpi:/bm/modify") == 1) return 1; } else if (strstr(url, "operation=move&")) { - if (Bmsrv_modify_move(sh, url) == 1) + if (Bmsrv_modify_move(url) == 1) return 1; if (Bmsrv_send_reload_request(sh, "dpi:/bm/modify") == 1) return 1; @@ -1419,7 +1419,7 @@ return 1; } else if (strstr(url, "operation=modify2&")) { - if (Bmsrv_modify_update(sh, url) == 1) + if (Bmsrv_modify_update(url) == 1) return 1; if (Bmsrv_send_reload_request(sh, "dpi:/bm/modify") == 1) return 1; @@ -1431,7 +1431,7 @@ return 1; } else if (strstr(url, "operation=add_section&")) { - if (Bmsrv_modify_add_section(sh, url) == 1) + if (Bmsrv_modify_add_section(url) == 1) return 1; if (Bmsrv_send_reload_request(sh, "dpi:/bm/modify") == 1) return 1;
--- a/dpi/file.c Sun Sep 14 15:10:41 2008 +0200 +++ b/dpi/file.c Sun Sep 14 16:07:12 2008 +0200 @@ -318,8 +318,7 @@ /* * Return a HTML-line from file info. */ -static void File_info2html(ClientInfo *Client, - FileInfo *finfo, const char *dirname, int n) +static void File_info2html(ClientInfo *Client, FileInfo *finfo, int n) { int size; char *sizeunits; @@ -451,7 +450,7 @@ /* Output entries */ for (n = 0; n < dList_length(Ddir->flist); ++n) { - File_info2html(Client, dList_nth_data(Ddir->flist,n),Ddir->dirname,n+1); + File_info2html(Client, dList_nth_data(Ddir->flist,n), n+1); } if (dList_length(Ddir->flist)) {
--- a/dpid/dpid.c Sun Sep 14 15:10:41 2008 +0200 +++ b/dpid/dpid.c Sun Sep 14 16:07:12 2008 +0200 @@ -671,7 +671,8 @@ */ void dpi_sigchld(int sig) { - caught_sigchld = 1; + if (sig == SIGCHLD) + caught_sigchld = 1; } /*! Called by main loop when caught_sigchld == 1 */
--- a/dpid/main.c Sun Sep 14 15:10:41 2008 +0200 +++ b/dpid/main.c Sun Sep 14 16:07:12 2008 +0200 @@ -146,7 +146,7 @@ * \Return * command code on success, -1 on failure */ -static int get_command(int sock, char *dpi_tag, struct dp *dpi_attr_list) +static int get_command(int sock, char *dpi_tag) { char *cmd, *d_cmd; int COMMAND; @@ -337,7 +337,7 @@ int command; req = get_request(sock); - command = get_command(sock, req, dpi_attr_list); + command = get_command(sock, req); switch (command) { case BYE_CMD: stop_active_dpis(dpi_attr_list, numdpis);
--- a/src/IO/IO.c Sun Sep 14 15:10:41 2008 +0200 +++ b/src/IO/IO.c Sun Sep 14 16:07:12 2008 +0200 @@ -259,7 +259,7 @@ * Handle background IO for a given FD (reads | writes) * (This function gets called when there's activity in the FD) */ -static int IO_callback(int fd, IOData_t *io) +static int IO_callback(IOData_t *io) { bool_t ret = FALSE; @@ -288,7 +288,7 @@ a_IOwatch_remove_fd(fd, DIO_READ); } else { - if (IO_callback(fd, io) == 0) + if (IO_callback(io) == 0) a_IOwatch_remove_fd(fd, DIO_READ); } } @@ -307,7 +307,7 @@ a_IOwatch_remove_fd(fd, DIO_WRITE); } else { - if (IO_callback(fd, io) == 0) + if (IO_callback(io) == 0) a_IOwatch_remove_fd(fd, DIO_WRITE); } }
--- a/src/bw.c Sun Sep 14 15:10:41 2008 +0200 +++ b/src/bw.c Sun Sep 14 16:07:12 2008 +0200 @@ -40,7 +40,7 @@ * Create a new browser window and return it. * (the new window is stored in browser_window[]) */ -BrowserWindow *a_Bw_new(int width, int height, uint32_t xid) +BrowserWindow *a_Bw_new() { BrowserWindow *bw; @@ -57,12 +57,6 @@ bw->nav_expecting = FALSE; bw->nav_expect_url = NULL; -// if (!xid) -// bw->main_window = gtk_window_new(GTK_WINDOW_TOPLEVEL); -// else -// bw->main_window = gtk_plug_new(xid); - - bw->redirect_level = 0; bw->sens_idle_up = 0;
--- a/src/bw.h Sun Sep 14 15:10:41 2008 +0200 +++ b/src/bw.h Sun Sep 14 16:07:12 2008 +0200 @@ -73,7 +73,7 @@ void a_Bw_init(void); -BrowserWindow *a_Bw_new(int width, int height, uint32_t xid); +BrowserWindow *a_Bw_new(); void a_Bw_free(BrowserWindow *bw); BrowserWindow *a_Bw_get();
--- a/src/chain.c Sun Sep 14 15:10:41 2008 +0200 +++ b/src/chain.c Sun Sep 14 16:07:12 2008 +0200 @@ -20,18 +20,19 @@ /* * Show debugging info */ +#if VERBOSE static void Chain_debug_msg(char *FuncStr, int Op, int Branch, int Dir, ChainLink *Info) { -#if VERBOSE const char *StrOps[] = {"", "OpStart", "OpSend", "OpStop", "OpEnd", "OpAbort"}; MSG("%-*s: %-*s [%d%s] Info=%p Flags=%d\n", 12, FuncStr, 7, StrOps[Op], Branch, (Dir == 1) ? "F" : "B", Info, Info ? Info->Flags : -1); +} +#else +static void Chain_debug_msg() { } #endif -} - /* * Create and initialize a new chain-link */
--- a/src/dicache.c Sun Sep 14 15:10:41 2008 +0200 +++ b/src/dicache.c Sun Sep 14 16:07:12 2008 +0200 @@ -387,10 +387,9 @@ * (Write a scan line into the Dicache entry) * buf: row buffer * Y : row number - * x : horizontal offset? (always zero) */ void a_Dicache_write(DilloImage *Image, DilloUrl *url, int version, - const uchar_t *buf, int x, uint_t Y) + const uchar_t *buf, uint_t Y) { DICacheEntry *DicEntry;
--- a/src/dicache.h Sun Sep 14 15:10:41 2008 +0200 +++ b/src/dicache.h Sun Sep 14 16:07:12 2008 +0200 @@ -56,7 +56,7 @@ int num_colors_max, int bg_index); void a_Dicache_new_scan(DilloImage *image, const DilloUrl *url, int version); void a_Dicache_write(DilloImage *Image, DilloUrl *url, int version, - const uchar_t *buf, int x, uint_t Y); + const uchar_t *buf, uint_t Y); void a_Dicache_close(DilloUrl *url, int version, CacheClient_t *Client); void a_Dicache_invalidate_entry(const DilloUrl *Url);
--- a/src/gif.c Sun Sep 14 15:10:41 2008 +0200 +++ b/src/gif.c Sun Sep 14 16:07:12 2008 +0200 @@ -421,7 +421,7 @@ */ static void Gif_emit_line(DilloGif *gif, const uchar_t *linebuf) { - a_Dicache_write(gif->Image, gif->url, gif->version, linebuf, 0, gif->y); + a_Dicache_write(gif->Image, gif->url, gif->version, linebuf, gif->y); if (gif->Flags & INTERLACE) { switch (gif->pass) { case 0:
--- a/src/jpeg.c Sun Sep 14 15:10:41 2008 +0200 +++ b/src/jpeg.c Sun Sep 14 16:07:12 2008 +0200 @@ -350,7 +350,7 @@ break; } a_Dicache_write(jpeg->Image, jpeg->url, jpeg->version, - linebuf, 0, jpeg->y); + linebuf, jpeg->y); jpeg->y++;
--- a/src/png.c Sun Sep 14 15:10:41 2008 +0200 +++ b/src/png.c Sun Sep 14 16:07:12 2008 +0200 @@ -240,7 +240,7 @@ case 3: a_Dicache_write(png->Image, png->url, png->version, png->image_data + (row_num * png->rowbytes), - 0, (uint_t)row_num); + (uint_t)row_num); break; case 4: { @@ -277,7 +277,7 @@ } } a_Dicache_write(png->Image, png->url, png->version, - png->linebuf, 0, (uint_t)row_num); + png->linebuf, (uint_t)row_num); break; } default:
--- a/src/uicmd.cc Sun Sep 14 15:10:41 2008 +0200 +++ b/src/uicmd.cc Sun Sep 14 16:07:12 2008 +0200 @@ -93,7 +93,7 @@ viewport->setScrollStep((int) rint(14.0 * prefs.font_factor)); // Now, create a new browser window structure - BrowserWindow *new_bw = a_Bw_new(ww, wh, 0); + BrowserWindow *new_bw = a_Bw_new(); // Set new_bw as callback data for UI new_ui->user_data(new_bw);