aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
Commit message (Collapse)AuthorAgeFilesLines
* Welcome in 2015Pascal Quantin2015-01-011-1/+1
| | | | | | Change-Id: Ib581b9383b211ea8dbcea1cadf98a2b8c3548ab5 Reviewed-on: https://code.wireshark.org/review/6204 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
* Use setlocale() to get the current locale.Guy Harris2014-12-311-6/+18
| | | | | | | | | | | | | | | | | This: 1) should work on Windows; 2) reflects what the C environment is actually set up to use, rather than what the environment variables for locale are set up to use - C programs default to the C locale and only pick up the setting from the environment variables etc. if you explicitly request the system locale with a setlocale() call. Change-Id: Iee064237e70501a5450d4daa9ab849391f200efd Reviewed-on: https://code.wireshark.org/review/6195 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Swallow get_glib_version_info() into get_compiled_version_info().Guy Harris2014-12-311-18/+9
| | | | | | | | It's not that complicated, so we might as well just do it in line. Change-Id: I10809db554e668a853d28e7dca48b2de0ed51ad3 Reviewed-on: https://code.wireshark.org/review/6190 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* "#else", not "#elif", for the last part of a chain of conditionals.Guy Harris2014-12-311-2/+24
| | | | | | | | | Also give more details, for future reference, on how to determine whether the processor supports CPUID. Change-Id: I01e7173e45b0079f02338e51248238c05302dbd2 Reviewed-on: https://code.wireshark.org/review/6189 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* ws_cpuid() returns a success/failure indication; make it gboolean.Guy Harris2014-12-311-10/+10
| | | | | | Change-Id: I03403ce29c4ac343d56fc2cf33aa8da90a082cbb Reviewed-on: https://code.wireshark.org/review/6185 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Distinguish between IA-32 and non-x86.Guy Harris2014-12-311-3/+9
| | | | | | | | | In case we make ws_cpuid() work on IA-32 processors, add a separate "always returns no" version of ws_cpuid() for non-x86 processors. Change-Id: Id6fbd3e5c7d4f04063bc9bcd8f1644cd617b297e Reviewed-on: https://code.wireshark.org/review/6184 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Move some routines into ws_version_info.c.Guy Harris2014-12-3111-492/+153
| | | | | | | | | | The routines to get compiler, GLib version, CPU, and memory info are used only in routines in ws_version_info.c; move them into ws_version_info.c and make them static. Change-Id: I58edd18da3301095012d2c7a3c5198e5a7073964 Reviewed-on: https://code.wireshark.org/review/6183 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Do the full string in get_{compiled,runtime}_version_info().Guy Harris2014-12-312-24/+46
| | | | | | | | | Have them start the string with "Compiled" or "Running on", and return the string when done. Change-Id: Ic4d290c963621fa0385dc5aab766fd4ad31d3810 Reviewed-on: https://code.wireshark.org/review/6155 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Move the version_info.c stuff to wsutil/ws_version_info.c.Guy Harris2014-12-312-1/+135
| | | | | | Change-Id: I3a5c7e219974bfb924819b43b4d445eaf00e5bde Reviewed-on: https://code.wireshark.org/review/6153 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Restore string.h to os_version.cMartin Mathieson2014-12-291-0/+1
| | | | | | Change-Id: I810a38c56829d5d3beaccc0171fc76f26ad79b52 Reviewed-on: https://code.wireshark.org/review/6108 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Add back string.h to sha1.c and sober128.cMartin Mathieson2014-12-292-0/+2
| | | | | | Change-Id: Idd8963717eab804f7d76652d1baf029be8b5997f Reviewed-on: https://code.wireshark.org/review/6105 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Restore string.h to md4.cMartin Mathieson2014-12-291-0/+1
| | | | | | Change-Id: I1a2c57ea20bcb1fd22c0379f3f43d3589e497c1b Reviewed-on: https://code.wireshark.org/review/6104 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Add string.h back to rc4.cMartin Mathieson2014-12-291-0/+1
| | | | | | Change-Id: Idea9369742373e4a50edb3f391bdabfeeb3a2ca7 Reviewed-on: https://code.wireshark.org/review/6103 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Add back string.hMartin Mathieson2014-12-291-0/+1
| | | | | | Change-Id: Ia61c72c7e8d1ef92ec5a38d534620fc225eef365 Reviewed-on: https://code.wireshark.org/review/6102 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Add a couple of more needed includesMartin Mathieson2014-12-282-1/+2
| | | | | | Change-Id: Ie160f81544c6c9b381078b555e91602617cb2700 Reviewed-on: https://code.wireshark.org/review/6101 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Restore string.h as OS X misses it for strlen()Martin Mathieson2014-12-281-0/+1
| | | | | | Change-Id: If1a968d54eed97fae915b8546d8d7a65a56b82db Reviewed-on: https://code.wireshark.org/review/6100 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Deleting unnecessary #includes from wsutil.Martin Mathieson2014-12-2823-34/+1
| | | | | | | | Will look at cleaning up and committing script afterwards. Change-Id: Id785e581740ab62fe9258ecfcb0926761ad9c527 Reviewed-on: https://code.wireshark.org/review/6086 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
* Removed duplicated #include linesDario Lombardo2014-12-282-2/+0
| | | | | | | | Change-Id: I9cafa3cd5c74121168777d8c656e7e94e89efd3c Reviewed-on: https://code.wireshark.org/review/6065 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
* Check for getopt_long(), not getopt().Guy Harris2014-12-251-1/+1
| | | | | | | | | | | | | | | | | We support three types of platforms: 1) UN*Xes that have both getopt() and getopt_long(); 2) UN*Xes that have getopt() but not getopt_long(); 3) Windows, which has neither. Checking for getopt_long() lets us distinguish between 1) and 2) and build getopt_long() for them. Change-Id: Iaf0f142f9bebaa2eed2128d544ec9786711def45 Reviewed-on: https://code.wireshark.org/review/6045 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Include some files based on whether the functions they define are present.Guy Harris2014-12-251-3/+12
| | | | | | | | | | | | | | | Rather than including wsgetopt.c, inet_aton.c, and strptime.c iff we're building for Windows: include wsgetopt.c iff we don't have getopt(); include inet_aton.c iff we don't have inet_aton(); include strptime.c iff we don't have strptime(). Change-Id: Ibd68306ac372a4ae102c3220a94cdf6ecb04e58c Reviewed-on: https://code.wireshark.org/review/6044 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Don't use extra variables for ws_mempbrk_sse42.c and popcount.cGuy Harris2014-12-241-14/+8
| | | | | | | | Instead, just add to WSUTIL_FILES as necessary. Change-Id: Iecadbd9a66ec54ee5d90aecfbfe5e636ae56e27e Reviewed-on: https://code.wireshark.org/review/6043 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Move twelve show_version() functions from the varoius programs andStephen Fisher2014-12-242-0/+20
| | | | | | | | Wireshark UI files into a single one in wsutil. Change-Id: I0a64f0cc8106bd681bd185289c36272c4c43baad Reviewed-on: https://code.wireshark.org/review/6026 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* Cmake: check for popcount, and build it from wsutil/popcount.c if missing.Guy Harris2014-12-231-0/+7
| | | | | | Change-Id: Id646a9f0b1fc6acafa99a78725e3f0ec8a48c170 Reviewed-on: https://code.wireshark.org/review/6006 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Try to fix Windows build for popcount() unresolved external symbolStephen Fisher2014-12-231-0/+1
| | | | | | Change-Id: Ie154caa1967ce4016dd52eefcf757e2e58d7ac68 Reviewed-on: https://code.wireshark.org/review/6005 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* Move popcount() to an optionally built part of wsutil for systems thatStephen Fisher2014-12-233-0/+77
| | | | | | | | | provide their own popcount(). Change-Id: Ic26f3b50cf0bd2b4af0d42e9c27488ebbac1ab33 Reviewed-on: https://code.wireshark.org/review/5998 Petri-Dish: Stephen Fisher <sfisher@sdf.org> Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* Fix unknown command tag name [-Wdocumentation-unknown-command]Alexis La Goutte2014-12-221-1/+2
| | | | | | Change-Id: I6c2564a86e13d9321001856ba1f51681a9f20976 Reviewed-on: https://code.wireshark.org/review/5979 Reviewed-by: Evan Huus <eapache@gmail.com>
* Don't bother with __builtin_floorl().Guy Harris2014-12-201-11/+0
| | | | | | | | | | | | | | | | | | | At least as I read the GCC documentation, if GCC supports a builtin floorl() at all, it will always treat floorl() and __builtin_floorl() the same (it's reserved in C90 and defined in C99, so nobody should ever write C code assuming floorl() won't be treated in that afshion). In addition, the GCC 3.3.6 manual says nothing about __builtin_floorl(), so it probably won't help to use it. If it appears to help, there's probably something else going on. Also, GCC appears not to like "#ifdef (__GNUC__)", as the parentheses mean it's testing an expression, not a macro name. Change-Id: Ib88b52c366d7f3b1637bb408fb18d04b67c27e4b Reviewed-on: https://code.wireshark.org/review/5909 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Include <math.h> to declare floor().Guy Harris2014-12-201-0/+2
| | | | | | Change-Id: I39de31c3e38b83aaec76396048e6960f609bc63e Reviewed-on: https://code.wireshark.org/review/5907 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Remove trailing white space.Guy Harris2014-12-202-2/+2
| | | | | | Change-Id: I0777945a5234cf380e2f3bc2461cc638c316f499 Reviewed-on: https://code.wireshark.org/review/5906 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Rename wsutil/floor.[ch] to wsutil/floorl.[ch].Guy Harris2014-12-203-7/+7
| | | | | | | | | | That better indicates what they do - they don't supply floor(), as that's a standard math.h feature dating back before C89, they supply floorl(). Change-Id: Ib1278c51cdfc57680c28c51de87eafb2cb50c8eb Reviewed-on: https://code.wireshark.org/review/5905 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* If we don't have GCC, fall back on using floor().Guy Harris2014-12-201-2/+10
| | | | | | | | Add the closing brace for the function body while we're at it. Change-Id: I73170fdc0885972dce531b553ff8601cceea182e Reviewed-on: https://code.wireshark.org/review/5902 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Handle floorl() the same way we handle other not-on-all-platforms functions.Guy Harris2014-12-202-4/+11
| | | | | | | | | | | | | | Use AC_CHECK_FUNC() for it, define FLOORL_LO to floorl.lo if we *don't* have it, add FLOORL_LO to the list of items conditionally built in libwsutil, and include "wsutil/floor.h" only if HAVE_FLOORL is *not* defined, as that means it's *not* supplied by the platform and thus *not* declared in <math.h>. Also, use the standard export stuff in wsutil/floor.h. Change-Id: Ic24aa69f65f2d15450d8b84b0c2b0c58f38edebe Reviewed-on: https://code.wireshark.org/review/5901 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Include floor.c and floor.h in the source tarball.Guy Harris2014-12-201-0/+2
| | | | | | Change-Id: Iabc0403643a05eaa7dbd525a94bc720d100d54d5 Reviewed-on: https://code.wireshark.org/review/5899 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Another missing changeStephen Fisher2014-12-201-2/+1
| | | | | | Change-Id: Icaaaeda75f411ecc7cf3027440c8af2b85021be3 Reviewed-on: https://code.wireshark.org/review/5897 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* Add missing files from last commitStephen Fisher2014-12-192-0/+70
| | | | | | Change-Id: I4a6dd1b60893d19b91f5bc0f85be9ee99cd3eb5e Reviewed-on: https://code.wireshark.org/review/5892 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* Revert "Provide a floorl() function (which is currently only able to call ↵Stephen Fisher2014-12-191-2/+0
| | | | | | | | | | GCC's __builtin_floorl() function) for systems which don't provide one." because I left off the new wsutil/floor.[ch] files This reverts commit e2586ec36d0d924b933d2127e809918b980cb413. Change-Id: Ie38b7f32b2d21e3beba5173eec22ca12b7f5da91 Reviewed-on: https://code.wireshark.org/review/5891 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* Provide a floorl() function (which is currently only able to call GCC'sStephen Fisher2014-12-191-0/+2
| | | | | | | | __builtin_floorl() function) for systems which don't provide one. Change-Id: Ie0140ff195f0eae525c7bd70c7c3e23039fde569 Reviewed-on: https://code.wireshark.org/review/5889 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* Update the URL for the CPUID instruction documentation.Stephen Fisher2014-11-261-1/+2
| | | | | | Change-Id: I9729b3aa11027783a3557468743e91e180a6de8d Reviewed-on: https://code.wireshark.org/review/5509 Reviewed-by: Stephen Fisher <sfisher@sdf.org>
* [pedantic] Replace usage of 'long' and 'long long'Bill Meier2014-11-192-3/+3
| | | | | | Change-Id: I78fc82c1a83eb04d78a11fc76710c92dfc916208 Reviewed-on: https://code.wireshark.org/review/5395 Reviewed-by: Bill Meier <wmeier@newsguy.com>
* ws_mempbrk_sse42.c: remove inclusion of stdint.h as it's no more required ↵Pascal Quantin2014-11-051-1/+0
| | | | | | | | | | after g79e4da4 Change-Id: I48776a286ba1d412ecda55857938d9daa77fd3f7 Reviewed-on: https://code.wireshark.org/review/5136 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
* Fix compilation error on FreeBSD 10.0-RELEASE (with clang): change int8_t toStephen Fisher2014-11-041-1/+1
| | | | | | | | | gint. Change-Id: I7974497a8f50e5d18ec74aa7554f058056a6022c Reviewed-on: https://code.wireshark.org/review/5115 Petri-Dish: Stephen Fisher <stephenfisher@centurylink.net> Reviewed-by: Stephen Fisher <stephenfisher@centurylink.net>
* Don't use -msse4.2 with MSVC.Guy Harris2014-11-031-5/+17
| | | | | | Change-Id: I457d45d9ad05e0eb851e78a7342e666ef9df8ffd Reviewed-on: https://code.wireshark.org/review/5086 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Add identification of Windows (Server) 10Pascal Quantin2014-11-021-0/+3
| | | | | | Change-Id: I5ab7a4dc67ceac644faead0d9e460e3babaf6355 Reviewed-on: https://code.wireshark.org/review/5067 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
* Validate no_of_bits in ws_sign_ext32 and ws_sign_ext64Stig Bjørlykke2014-11-011-0/+10
| | | | | | | | | | | The result of the '<<' expression is undefined if no_of_bits - 1 is negative. Change-Id: I3fff09afe414bdd9d6736ee351f1c542c503b93d Reviewed-on: https://code.wireshark.org/review/4698 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
* Remove the optional strncasecmp.{h,c} target (for systems that don't have ↵Jeff Morriss2014-10-305-115/+6
| | | | | | | | | | | | that API). strncasecmp() has been prohibited for years (in favor of the g_ascii_ version). Change-Id: I64b7c29099b1c5240757e2026fe3490096a84755 Reviewed-on: https://code.wireshark.org/review/4980 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
* Rename the strnatcmp.c routines and make them use the g_ascii_XXX() routines.Guy Harris2014-10-292-8/+15
| | | | | | | | | | | | | | Rename strnatcmp()/strnatcasecmp() to ws_ascii_XXX(), and make them use the g_ascii_XXX() routines rather than ctype.h routines, to eliminate locale-dependent behavior. (If you want locale-dependent "natural order" sorting, you probably want "dictionary order" sorting, which is more complicated than just natural order sorting.) Change-Id: I837f2776b2a909b547dc9a6072e497911b5380e5 Reviewed-on: https://code.wireshark.org/review/4985 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* strptime.c needs ctype.h.Guy Harris2014-10-171-0/+1
| | | | | | Change-Id: Icf4020426d3a5e0a6bd2012a266cf07be9928abf Reviewed-on: https://code.wireshark.org/review/4793 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Get rid of unnecessary includes of ctype.h.Guy Harris2014-10-174-5/+0
| | | | | | Change-Id: Ic23203f13fd6627b664e8ed1438d328c46328b9f Reviewed-on: https://code.wireshark.org/review/4790 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Don't use ctype.h routines.Guy Harris2014-10-171-3/+1
| | | | | | | | | That avoids locale dependency and handles possibly-signed chars (which we weren't doing before). Change-Id: I189222eff624ad2d2e960bc0b69f3f22d35f351f Reviewed-on: https://code.wireshark.org/review/4787 Reviewed-by: Guy Harris <guy@alum.mit.edu>
* Eliminate include of <ctype.h>.Guy Harris2014-10-171-11/+0
| | | | | | | | | This is not built if we have glibc (as we already have getopt() from it), and it's not part of glibc, so.... Change-Id: Iae4ff944c78fc55a8cd2eaf523a3696c47b741d7 Reviewed-on: https://code.wireshark.org/review/4769 Reviewed-by: Guy Harris <guy@alum.mit.edu>