Commit Graph

15 Commits

Author SHA1 Message Date
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris dd3fcb36ec Include <string.h> to declare string functions that we use.
svn path=/trunk/; revision=3695
2001-07-12 07:06:25 +00:00
Guy Harris 90eccd89b8 Some compilers, e.g. Microsoft Visual C++, don't define __STDC__ unless
extensions to ANSI C are disabled if they may cause strictly conforming
programs not to compile, or to work differently if those extensions are
enabled.  (Other compilers #define it as 0, e.g.  Sun's and, I think,
other AT&T-derived compilers; still others cheerfully define it as 1
even when those extensions are enabled, e.g. GCC.)

As such, checking whether __STDC__ is defined, or is defined as a
non-zero value, isn't the right way to check whether function prototypes
are supported; MSVC++ 6.0 supports them, but, by default, leaves
extensions of the sort described above enabled, and thus doesn't define
__STDC__.  This means that the compiler warns about arguments to
"snprintf()" when compiling it, as the declaration is an old-style
declaration.

As Ethereal uses function prototypes, there's not much point in making
it possible for its private "snprintf()" to be compiled or used when
function prototypes aren't supported; just get rid of the tests for
__STDC__, so that it's compiled with function prototypes regardless of
whether __STDC__ is defined or not.

While we're at it, have "snprintf()" give it a "__attribute__((format
(printf, 3, 4))))" when compiled by GCC 2.x or later, so that
format/argument checks can be done even on platforms lacking
"snprintf()".

svn path=/trunk/; revision=2689
2000-11-21 21:24:52 +00:00
Guy Harris e18d6c34c9 Give them RCS IDs.
Fix a typo in the LGPL in the initial comment.

Move the includes of <stdlib.h> and <ctype.h> out of "snprintf-imp.h"
into "snprintf.c", and put them *before* the include of "snprintf.h", so
that "size_t" is defined before "snprintf.h" is included ("snprintf.h"
uses "size_t").

svn path=/trunk/; revision=2257
2000-08-11 22:03:03 +00:00
Laurent Deniel 6a480953a9 Miscellaneous code cleaning
- add <stdarg.h> or <varargs.h> in snprintf.h
  and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes

- remove the check of multiple inclusions in source (.c)  code
  (there is a bit loss of _cpp_ performance, but I prefer the gain of
   code reading and maintenance; and nowadays, disk caches and VM are
   correctly optimized ;-).

- protect all (well almost) header files against multiple inclusions

- add header (i.e. GPL license) in some include files

- reorganize a bit the way header files are included:

  First:
  #include <system_include_files>
  #include <external_package_include_files (e.g. gtk, glib etc.)>
  Then
  #include "ethereal_include_files"

  with the correct HAVE_XXX or NEED_XXX protections.

- add some HAVE_XXX checks before including some system header files

- add the same HAVE_XXX in wiretap as in ethereal

Please forgive me, if I break something (I've only compiled and regression
tested on Linux).

svn path=/trunk/; revision=2254
2000-08-11 13:37:21 +00:00
Guy Harris d9b5291990 Cast arguments to "isxdigit()", "isdigit()", and "isflag()" to "unsigned
char" so that if it has the 8th bit set it won't get sign-extended; this
squelches a GCC complaint.

svn path=/trunk/; revision=2223
2000-08-07 23:05:43 +00:00
Gilbert Ramirez f9a8a11ef5 Integrate Ed Meaney's <emeaney@altiga.com> changes for using libpcap
from WinDump with Ethereal. We now have packet capturing on Win32. :)

svn path=/trunk/; revision=1612
2000-02-09 19:18:42 +00:00
Guy Harris 06ba47b45b Put the "0[xX]" prefix for "%#[Xx]", and the "0" prefix for "%#o",
*before* any padding "0"s.

svn path=/trunk/; revision=1245
1999-12-08 21:44:33 +00:00
Gilbert Ramirez 499eff7b0d Changed two #include <>'s to #include "" 's, for stylistic reasons only.
svn path=/trunk/; revision=471
1999-08-11 17:02:28 +00:00
Guy Harris 58778fd8ad Add support for "%i" (it's the same as "%d", according to the ANSI C
standard).

svn path=/trunk/; revision=189
1999-02-15 06:36:19 +00:00
Gilbert Ramirez 69458d2e92 Added guy's time and DHCP patch.
svn path=/trunk/; revision=177
1999-01-28 21:29:36 +00:00
Gerald Combs c2eeef9467 * Fix for unsigned overflows on Solaris
svn path=/trunk/; revision=81
1998-11-08 00:05:45 +00:00
Guy Harris d0b809aa74 Squelch a number of "-Wall" errors by:
1) renaming "snprintf.h" to "snprintf-imp.h" (it contains stuff
	   used by the "snprintf()" *implementation*, but not stuff it
	   *exports*);

	2) creating a new "snprintf.h" to declare "vsnprintf()" and
	   "snprintf()";

	3) removing an unused variable;

	4) fixing a call to "add_item_to_tree()" to handle the
	   possibility of "ntohl()" returning a "long" rather than an
	   "int".

svn path=/trunk/; revision=47
1998-10-13 07:03:37 +00:00
Gerald Combs 86534f46e1 Initial revision
svn path=/trunk/; revision=2
1998-09-16 02:39:15 +00:00