From b3c405408fb7abaad6039b65d86ef701b12c9f0a Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 21 Mar 2010 11:19:22 +0100 Subject: Fix a few compiler warnings (-Wall -Wextra) --- src/feh.h | 1 + src/ipc.c | 2 +- src/ipc.h | 2 +- src/options.c | 3 +-- src/options.h | 4 ++-- src/thumbnail.c | 7 +++---- src/winwidget.c | 5 +++-- 7 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/feh.h b/src/feh.h index 2e278e5..c9a6c86 100644 --- a/src/feh.h +++ b/src/feh.h @@ -136,6 +136,7 @@ void cb_reload_timer(void *data); char *feh_http_load_image(char *url); int feh_load_image_char(Imlib_Image * im, char *filename); void feh_draw_filename(winwidget w); +void feh_draw_actions(winwidget w); void feh_draw_caption(winwidget w); void feh_display_status(char stat); void real_loadables_mode(int loadable); diff --git a/src/ipc.c b/src/ipc.c index 3ed8119..a0d97a3 100644 --- a/src/ipc.c +++ b/src/ipc.c @@ -31,7 +31,7 @@ static int session_id = 0; static char *socket_name; static int socket_fd = 0; -int feh_ipc_create_socket(void) +void feh_ipc_create_socket(void) { struct sockaddr_un saddr; int i; diff --git a/src/ipc.h b/src/ipc.h index 78c0d9f..395b150 100644 --- a/src/ipc.h +++ b/src/ipc.h @@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define FEH_IPC_VERSION 0x100; -int feh_ipc_create_socket(void); +void feh_ipc_create_socket(void); int feh_ipc_get_session_id(void); typedef struct { diff --git a/src/options.c b/src/options.c index 6deaf85..63d71d9 100644 --- a/src/options.c +++ b/src/options.c @@ -396,8 +396,7 @@ static void feh_parse_option_array(int argc, char **argv) {"index-dim", 1, 0, 232}, {0, 0, 0, 0} }; - int optch = 0, cmdx = 0, i = 0; - int geomret; + int optch = 0, cmdx = 0; D_ENTER(4); diff --git a/src/options.h b/src/options.h index a06643f..55b997f 100644 --- a/src/options.h +++ b/src/options.h @@ -114,8 +114,8 @@ struct __fehoptions { int geom_flags; int geom_x; int geom_y; - int geom_w; - int geom_h; + unsigned int geom_w; + unsigned int geom_h; int default_zoom; int menu_border; unsigned char adjust_reload; diff --git a/src/thumbnail.c b/src/thumbnail.c index 7c5dad3..a2246ac 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -781,7 +781,7 @@ char *feh_thumbnail_get_name_md5(char *uri) /* generate the md5 sum */ md5_init(&pms); - md5_append(&pms, uri, strlen(uri)); + md5_append(&pms, (unsigned char *)uri, strlen(uri)); md5_finish(&pms, digest); /* print the md5 as hex to a string */ @@ -798,7 +798,6 @@ int feh_thumbnail_generate(Imlib_Image * image, feh_file * file, char *thumb_file, char *uri) { int w, h, thumb_w, thumb_h; - char *c_mtime; Imlib_Image im_temp; struct stat sb; @@ -820,8 +819,8 @@ int feh_thumbnail_generate(Imlib_Image * image, feh_file * file, thumb_w, thumb_h, 1); if (!stat(file->filename, &sb)) { - char c_mtime[256]; - sprintf(c_mtime, "%d", sb.st_mtime); + char c_mtime[128]; + sprintf(c_mtime, "%d", (int)sb.st_mtime); feh_png_write_png(*image, thumb_file, "Thumb::URI", uri, "Thumb::MTime", c_mtime); } diff --git a/src/winwidget.c b/src/winwidget.c index dd0adbb..40d9fd2 100644 --- a/src/winwidget.c +++ b/src/winwidget.c @@ -259,7 +259,8 @@ void winwidget_create_window(winwidget ret, int w, int h) ev.xclient.data.l[0] = (ret->full_screen ? 1 : 0); ev.xclient.data.l[1] = prop_fs; - XChangeProperty(disp, ret->win, prop_state, XA_ATOM, 32, PropModeReplace, &prop_fs, 1); + XChangeProperty(disp, ret->win, prop_state, XA_ATOM, 32, + PropModeReplace, (unsigned char *) &prop_fs, 1); } XSetWMProtocols(disp, ret->win, &wmDeleteWindow, 1); @@ -976,7 +977,7 @@ int winwidget_get_height(winwidget winwid) void winwidget_get_geometry(winwidget winwid, int *rect) { - int bw, bp; + unsigned int bw, bp; Window child; D_ENTER(4); if (!rect) -- cgit v1.2.3