aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil/sign_ext.h
AgeCommit message (Collapse)AuthorFilesLines
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
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>
2017-12-10Convert to using use SPDX identifier on wsutil directoryMichael Mann1-13/+1
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>
2016-03-16No need to operate on full bit width (CID 1355344 / 1355348)Jaap Keuter1-2/+2
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>
2015-04-30Don't shift signed values left.Guy Harris1-4/+16
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>
2014-11-01Validate no_of_bits in ws_sign_ext32 and ws_sign_ext64Stig Bjørlykke1-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>
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-12-26There's no need to mark inline functions with _U_Jakub Zawadzki1-6/+2
svn path=/trunk/; revision=54459
2013-12-19Another try at marking the ws_sign_ext functions possibly-unused.Gerald Combs1-4/+8
svn path=/trunk/; revision=54267
2013-12-19Try to fix a warning found by, but not related to, the ABI check.Gerald Combs1-2/+2
svn path=/trunk/; revision=54265
2013-12-17sign_ext.h: use G_GINT64_CONSTANT(), add sample for alternative method of ↵Jakub Zawadzki1-2/+12
sign extension. Alternative method looks much nicer in dissasembly. svn path=/trunk/; revision=54202
2013-12-17Create sign extension routines in <wsutil/sign_ext.h>, use it in few places.Jakub Zawadzki1-0/+50
svn path=/trunk/; revision=54197