aboutsummaryrefslogtreecommitdiffstats
path: root/epan/tvbuff.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2010-08-16 17:19:15 +0000
committerGuy Harris <guy@alum.mit.edu>2010-08-16 17:19:15 +0000
commitcd67ad0047aaeb4199cbf546800e386d024a4420 (patch)
treefc0d08598085177556a251a6407f59027cfc5b9b /epan/tvbuff.c
parent9da9ac87d333f396ea1782fd607c55f8402ab868 (diff)
Clean up indentation.
svn path=/trunk/; revision=33814
Diffstat (limited to 'epan/tvbuff.c')
-rw-r--r--epan/tvbuff.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index ba842b3d71..7c2b6e6891 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -1676,9 +1676,9 @@ tvb_get_bits32(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gboo
guint32 value = 0;
guint32 tempval = 0;
guint8 tot_no_bits;
- guint8 tot_no_octets = 0;
- guint8 i = 0;
- gint8 shift = 0;
+ guint8 tot_no_octets = 0;
+ guint8 i = 0;
+ gint8 shift = 0;
if ((no_of_bits<=16)||(no_of_bits>32)) {
/* If bits <= 16 use tvb_get_bits8 or tvb_get_bits16 */
@@ -1694,27 +1694,28 @@ tvb_get_bits32(tvbuff_t *tvb, gint bit_offset, const gint no_of_bits, const gboo
bit_offset = bit_offset & 0x7;
tot_no_bits = bit_offset+no_of_bits;
- tot_no_octets = tot_no_bits / 8;
- if (tot_no_bits % 8) tot_no_octets++;
- shift = no_of_bits - (8 - bit_offset);
-
- value = tvb_get_guint8(tvb, offset) & bit_mask8[bit_offset];
- value = value << shift;
-
- for (i = 1; i < tot_no_octets; i++)
- {
- shift = shift - 8;
- tempval = tvb_get_guint8(tvb, offset+i);
- if (shift >= 0)
- {
- tempval = tempval << shift;
- }
- else
- {
- tempval = tempval >> (8 - shift);
- }
- value = value | tempval;
- }
+ tot_no_octets = tot_no_bits / 8;
+ if (tot_no_bits % 8)
+ tot_no_octets++;
+ shift = no_of_bits - (8 - bit_offset);
+
+ value = tvb_get_guint8(tvb, offset) & bit_mask8[bit_offset];
+ value = value << shift;
+
+ for (i = 1; i < tot_no_octets; i++)
+ {
+ shift = shift - 8;
+ tempval = tvb_get_guint8(tvb, offset+i);
+ if (shift >= 0)
+ {
+ tempval = tempval << shift;
+ }
+ else
+ {
+ tempval = tempval >> (8 - shift);
+ }
+ value = value | tempval;
+ }
return value;
}