Commit Graph

12 Commits

Author SHA1 Message Date
João Valverde 4aff36d501 Replace g_assert() with ws_assert() in places 2021-06-06 20:05:26 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Michael Mann 3d673da88c Convert to using use SPDX identifier on wsutil directory
Change-Id: Id73e641499e75bc1afc1dea29682418156f461fe
Reviewed-on: https://code.wireshark.org/review/24751
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-12-10 04:36:29 +00:00
Jaap Keuter df551b8cb7 No need to operate on full bit width (CID 1355344 / 1355348)
When giving the full bit width to sign extend there's nothing
left, so return the value straight away (a NULL op).

Change-Id: I48e6612b6a7c89c0a9ddad0974bb83e7c8e0c22d
Reviewed-on: https://code.wireshark.org/review/14390
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-16 01:08:27 +00:00
Guy Harris d2b02eaf59 Don't shift signed values left.
That's not valid in C99, at least, if the value is negative or if the
shift count is the number of bits in the value - 1, and we might get
compile-time or run-time complaints about that.

Also, make bit masks unsigned; to quote a run-time error reported in

	https://www.wireshark.org/lists/wireshark-dev/201504/msg00084.html

"left shift of 1 by 31 places cannot be represented in type 'int'", so
use type "unsigned int" instead, by shifting 1U rather than 1 left.

Change-Id: I62220808058cb93f83329c1916b888a2067d524c
Reviewed-on: https://code.wireshark.org/review/8254
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-30 20:40:17 +00:00
Stig Bjørlykke 6a37368738 Validate no_of_bits in ws_sign_ext32 and ws_sign_ext64
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>
2014-11-01 15:51:41 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(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>
2014-03-04 14:27:33 +00:00
Jakub Zawadzki ca91b33cc8 There's no need to mark inline functions with _U_
svn path=/trunk/; revision=54459
2013-12-26 10:53:53 +00:00
Gerald Combs 82d0e1f669 Another try at marking the ws_sign_ext functions possibly-unused.
svn path=/trunk/; revision=54267
2013-12-19 20:16:31 +00:00
Gerald Combs 67ceb469b3 Try to fix a warning found by, but not related to, the ABI check.
svn path=/trunk/; revision=54265
2013-12-19 19:12:25 +00:00
Jakub Zawadzki ff2a5847b9 sign_ext.h: use G_GINT64_CONSTANT(), add sample for alternative method of sign extension.
Alternative method looks much nicer in dissasembly.

svn path=/trunk/; revision=54202
2013-12-17 22:16:06 +00:00
Jakub Zawadzki 0de43ce2dd Create sign extension routines in <wsutil/sign_ext.h>, use it in few places.
svn path=/trunk/; revision=54197
2013-12-17 21:36:33 +00:00