From f47ea91e2d1b04aea2c23f40c98801e948d7a950 Mon Sep 17 00:00:00 2001 From: PA4WDH Date: Mon, 26 Aug 2024 19:56:17 +0200 Subject: Add more compiler warnings --- sysfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'sysfs.c') diff --git a/sysfs.c b/sysfs.c index d6e4d60..6ea7701 100644 --- a/sysfs.c +++ b/sysfs.c @@ -12,7 +12,7 @@ extern struct s_config config; int sysfs_read_str(char *sysfs_file,char *buf,size_t bufsize) { int sysfs_handle; - size_t datalen; + ssize_t datalen; DEBUG1_SYSFS("Reading sysfs file %s\n",sysfs_file); @@ -35,7 +35,7 @@ int sysfs_read_str(char *sysfs_file,char *buf,size_t bufsize) buf[datalen]=0; } - return datalen; + return (int) datalen; } long int sysfs_read_long_int(char *sysfs_file) @@ -54,7 +54,7 @@ long int sysfs_read_long_int(char *sysfs_file) int sysfs_write_str(char *sysfs_file,char *value,long int checkdelay) { int sysfs_handle; - size_t len; + ssize_t len; char buf[255]; DEBUG1_SYSFS("Writing %s to sysfs file %s\n",value,sysfs_file); @@ -75,7 +75,7 @@ int sysfs_write_str(char *sysfs_file,char *value,long int checkdelay) DEBUG2_SYSFS("Written %zd bytes\n",len); // Wait if instructed to - if (checkdelay>0) usleep(checkdelay); + if (checkdelay>0) usleep((unsigned int) checkdelay); // Validate we actually set what we want to set sysfs_read_str(sysfs_file,buf,sizeof(buf)); -- cgit v1.2.3