aboutsummaryrefslogtreecommitdiffstats
path: root/sync_pipe_write.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
committerGuy Harris <guy@alum.mit.edu>2012-12-26 05:57:06 +0000
commit8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch)
treead4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /sync_pipe_write.c
parent8ede6b7dc09aa636f87147ab432a137c209e8aca (diff)
Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
Diffstat (limited to 'sync_pipe_write.c')
-rw-r--r--sync_pipe_write.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sync_pipe_write.c b/sync_pipe_write.c
index c301da7e5c..40bb2c1ce8 100644
--- a/sync_pipe_write.c
+++ b/sync_pipe_write.c
@@ -43,7 +43,7 @@
/* write a single message header to the recipient pipe */
-int
+size_t
pipe_write_header(int pipe_fd, char indicator, int length)
{
guchar header[1+3]; /* indicator + 3-byte len */
@@ -69,7 +69,7 @@ pipe_write_header(int pipe_fd, char indicator, int length)
void
pipe_write_block(int pipe_fd, char indicator, const char *msg)
{
- int ret;
+ ssize_t ret;
int len;
/*g_warning("write %d enter", pipe_fd);*/
@@ -89,7 +89,7 @@ pipe_write_block(int pipe_fd, char indicator, const char *msg)
/* write value (if we have one) */
if(len) {
/*g_warning("write %d indicator: %c value len: %u msg: %s", pipe_fd, indicator, len, msg);*/
- ret = (int) write(pipe_fd, msg, len);
+ ret = write(pipe_fd, msg, len);
if(ret == -1) {
return;
}