aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/nstime.c
AgeCommit message (Collapse)AuthorFilesLines
2016-05-09Fix up the compare chain in nstime_delta().Guy Harris1-1/+1
The first case handles the two time stamps having the same seconds value, so, in the subsequent cases, they're guaranteed not to have the same seconds value; check for b->secs < a->secs, not for b->secs <= a->secs (the two tests will always get the same value, as b->secs != a->secs), to make it clearer what's being done. Change-Id: I6d3806237dae0ea12af92ea0344a31a2c5322b12 Reviewed-on: https://code.wireshark.org/review/15325 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-10-09nstime: fix -Wshift-negative-valuePeter Wu1-6/+2
Even if the result of the negative shift (in TIME_T_MIN) is not used because the signedness check happens before, it still causes a compile-time warning. Fix this by shifting on an unsigned value, then truncate by casting it. While at it, remove a "fix for broken SCO compiler", it might not apply to us (fingers crossed). Change-Id: Id9603149d8063e9eaaa65cf028323f10e60a6c42 Reviewed-on: https://code.wireshark.org/review/10862 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-06-11Replace tabs in files with editor modeline "expandtab"Bill Meier1-1/+1
Change-Id: I4667fd4091c510a4c798f79dae333a07dc42dad6 Reviewed-on: https://code.wireshark.org/review/8880 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2015-04-21Calculate *Peek tagged timestamps in fixed-point.Guy Harris1-26/+66
Add a variant of filetime_to_nstime() that takes a value that's like a FILETIME but in units of nanoseconds rather than tenths of a microsecond, and use that. (It looks as if they might just get FILETIME values from the OS and multiply them by 100, as the nanosecond-FILETIME values appear to be multiples of 100 in the captures I've seen, but they might have chosen nanosecond resolution in case they need to support a higher-resolution time stamp source, so we don't assume that the values will always be a multiple of 100.) Change-Id: If6a1cb2cb673688b042eb113b79cfd267f5454a5 Reviewed-on: https://code.wireshark.org/review/8150 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-20Get rid of trailing white space.Guy Harris1-1/+1
Change-Id: I83ba78a9f153f4a193550c5069182b9203b28edb Reviewed-on: https://code.wireshark.org/review/8144 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-20Have a common routine to convert FILETIME to nstime_t.Guy Harris1-0/+76
We had several copies of that code; put it into a filetime_to_nstime() routine in wsutil, and call that common routine instead. Change-Id: I1eb5579c36c129ff8d23f9212285ab3f63be0f43 Reviewed-on: https://code.wireshark.org/review/8142 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Fix some whitespace issues.Guy Harris1-3/+3
Change-Id: I363361e898c4b37fcde29847a1473530e5052733 Reviewed-on: https://code.wireshark.org/review/1771 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23More handling of missing time stamps.Guy Harris1-1/+12
Make nstime_cmp() handle "unset" time stamps (they're equal to other "unset" time stamps, and less than all other time stamps), use it in reordercap, and "unset" the time stamp if it's absent. Also, nstime_cmp() does not modify its argument, so make it const. Change-Id: I016dab5fefaf4696e78cbd8c6dd3395808e54369 Reviewed-on: https://code.wireshark.org/review/1769 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-11-09Replace wtap_nstime with nstime_t, remove wtap_nstime_to_sec.Jakub Zawadzki1-10/+0
After r50154 nstime_t is inside wsutil/ so wiretap don't need it's own copy. svn path=/trunk/; revision=53184
2013-06-25Move a couple of time-related modules into wsutil.Jeff Morriss1-0/+202
A bunch of files didn't really need to include these header files so remove the include line rather than changing it. svn path=/trunk/; revision=50154