From Alexis La Goutte:
Replace all *_min()/*_max() by MIN() and MAX(). svn path=/trunk/; revision=34767
This commit is contained in:
parent
9675740701
commit
b7920c07c5
|
@ -262,15 +262,6 @@ static const value_string mip_extensions[] = {
|
|||
#define MPLS_STACK_ENTRY_C_TYPE 1
|
||||
#define MPLS_EXTENDED_PAYLOAD_C_TYPE 1
|
||||
|
||||
/* XXX no header defines these macros ??? */
|
||||
#ifndef min
|
||||
#define min(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#ifndef max
|
||||
#define max(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dissect the mobile ip advertisement extensions.
|
||||
*/
|
||||
|
@ -494,13 +485,13 @@ dissect_mpls_extensions(tvbuff_t *tvb, gint offset, proto_tree *tree)
|
|||
/* Object length */
|
||||
obj_length = tvb_get_ntohs(tvb, offset);
|
||||
|
||||
obj_trunc_length = min(obj_length, tvb_reported_length_remaining(tvb, offset));
|
||||
obj_trunc_length = MIN(obj_length, tvb_reported_length_remaining(tvb, offset));
|
||||
|
||||
obj_end_offset = offset + obj_trunc_length;
|
||||
|
||||
/* Add a subtree for this object (the text will be reset later) */
|
||||
tf_object = proto_tree_add_text(mpls_tree, tvb, offset,
|
||||
max(obj_trunc_length, 4),
|
||||
MAX(obj_trunc_length, 4),
|
||||
"Unknown object");
|
||||
|
||||
mpls_object_tree = proto_item_add_subtree(tf_object, ett_icmp_mpls_object);
|
||||
|
|
|
@ -521,11 +521,6 @@ typedef struct _iscsi_conv_data {
|
|||
itlq_nexus_t itlq;
|
||||
} iscsi_conv_data_t;
|
||||
|
||||
static int
|
||||
iscsi_min(int a, int b) {
|
||||
return (a < b)? a : b;
|
||||
}
|
||||
|
||||
/* TargetAddress describes a iscsi port, possibly using a non-standard port
|
||||
so we can use this to set up a conversation dissector to that port.
|
||||
|
||||
|
@ -688,7 +683,7 @@ static int
|
|||
handleDataSegment(proto_item *ti, tvbuff_t *tvb, guint offset, guint dataSegmentLen, guint endOffset, int hf_id) {
|
||||
if(endOffset > offset) {
|
||||
int dataOffset = offset;
|
||||
int dataLen = iscsi_min(dataSegmentLen, endOffset - offset);
|
||||
int dataLen = MIN(dataSegmentLen, endOffset - offset);
|
||||
if(dataLen > 0) {
|
||||
proto_tree_add_item(ti, hf_id, tvb, offset, dataLen, FALSE);
|
||||
offset += dataLen;
|
||||
|
@ -709,7 +704,7 @@ static int
|
|||
handleDataSegmentAsTextKeys(packet_info *pinfo, proto_item *ti, tvbuff_t *tvb, guint offset, guint dataSegmentLen, guint endOffset, int digestsActive) {
|
||||
if(endOffset > offset) {
|
||||
int dataOffset = offset;
|
||||
int textLen = iscsi_min(dataSegmentLen, endOffset - offset);
|
||||
int textLen = MIN(dataSegmentLen, endOffset - offset);
|
||||
if(textLen > 0) {
|
||||
proto_item *tf = proto_tree_add_text(ti, tvb, offset, textLen, "Key/Value Pairs");
|
||||
proto_tree *tt = proto_item_add_subtree(tf, ett_iscsi_KeyValues);
|
||||
|
|
|
@ -261,7 +261,7 @@ dissect_mstp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
|
|||
}
|
||||
#if defined(BACNET_MSTP_CHECKSUM_VALIDATE)
|
||||
/* 16-bit checksum - calculate to validate */
|
||||
max_len = min(mstp_frame_pdu_len, mstp_tvb_pdu_len);
|
||||
max_len = MIN(mstp_frame_pdu_len, mstp_tvb_pdu_len);
|
||||
for (i = 0; i < max_len; i++) {
|
||||
crcdata = tvb_get_guint8(tvb, offset+i);
|
||||
crc16 = CRC_Calc_Data(crcdata, crc16);
|
||||
|
|
|
@ -34,9 +34,6 @@
|
|||
|
||||
#include <epan/packet.h>
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Returns a value string for the BACnet MS/TP Frame Type.
|
||||
|
|
|
@ -45,9 +45,6 @@
|
|||
#include <epan/lapd_sapi.h>
|
||||
#include "packet-tpkt.h"
|
||||
|
||||
#ifndef min
|
||||
#define min(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
/* Q.931 references:
|
||||
*
|
||||
|
@ -2855,7 +2852,7 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
|
|||
* to the actual size in the frame
|
||||
*/
|
||||
if (!pinfo->can_desegment) {
|
||||
info_element_len = min(info_element_len, tvb_length_remaining(tvb, offset + 3));
|
||||
info_element_len = MIN(info_element_len, tvb_length_remaining(tvb, offset + 3));
|
||||
}
|
||||
/*
|
||||
* Do we have a handle for the H.225
|
||||
|
|
Loading…
Reference in New Issue