diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-12-26 05:57:06 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-12-26 05:57:06 +0000 |
commit | 8ed7a73e22c049a2e013bb436e599bff41fc5b9b (patch) | |
tree | ad4a4cc6fb4ff4d3e3ffe3a3f8e3d056e441ae46 /pcapio.h | |
parent | 8ede6b7dc09aa636f87147ab432a137c209e8aca (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 'pcapio.h')
-rw-r--r-- | pcapio.h | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -29,16 +29,16 @@ Returns TRUE on success, FALSE on failure. Sets "*err" to an error code, or 0 for a short write, on failure*/ extern gboolean -libpcap_write_file_header(FILE *fp, int linktype, int snaplen, gboolean ts_nsecs, long *bytes_written, int *err); +libpcap_write_file_header(FILE *fp, int linktype, int snaplen, gboolean ts_nsecs, guint64 *bytes_written, int *err); /** Write a record for a packet to a dump file. Returns TRUE on success, FALSE on failure. */ extern gboolean libpcap_write_packet(FILE *fp, - guint32 sec, guint32 usec, + time_t sec, guint32 usec, guint32 caplen, guint32 len, - const unsigned char *pd, - long *bytes_written, int *err); + const guint8 *pd, + guint64 *bytes_written, int *err); /** Write a section header block (SHB) * @@ -58,7 +58,7 @@ libpcap_write_session_header_block(FILE *fp, /**< File pointer */ * An UTF-8 string containing the name of the application used to create this section. */ guint64 section_length, - long *bytes_written, + guint64 *bytes_written, int *err); extern gboolean @@ -70,7 +70,7 @@ libpcap_write_interface_description_block(FILE *fp, const char *os, /* IDB_OS 12 */ int link_type, int snap_len, - long *bytes_written, + guint64 *bytes_written, guint64 if_speed, /* IDB_IF_SPEED 8 */ guint8 tsresol, /* IDB_TSRESOL 9 */ int *err); @@ -78,7 +78,7 @@ libpcap_write_interface_description_block(FILE *fp, extern gboolean libpcap_write_interface_statistics_block(FILE *fp, guint32 interface_id, - long *bytes_written, + guint64 *bytes_written, const char *comment, /* OPT_COMMENT 1 */ guint64 isb_starttime, /* ISB_STARTTIME 2 */ guint64 isb_endtime, /* ISB_ENDTIME 3 */ @@ -89,11 +89,11 @@ libpcap_write_interface_statistics_block(FILE *fp, extern gboolean libpcap_write_enhanced_packet_block(FILE *fp, const char *comment, - guint32 sec, guint32 usec, + time_t sec, guint32 usec, guint32 caplen, guint32 len, guint32 interface_id, guint ts_mul, - const unsigned char *pd, + const guint8 *pd, guint32 flags, - long *bytes_written, + guint64 *bytes_written, int *err); |