Skip to content
This repository has been archived by the owner on Nov 15, 2022. It is now read-only.

Commit

Permalink
Shush "unused parameter" warnings in hprof-conv.
Browse files Browse the repository at this point in the history
Change-Id: I6bc13ac430609db5c7463180c63fd7e58de3983d
  • Loading branch information
roland-levillain committed Mar 1, 2016
1 parent 6bb886d commit 544612a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tools/hprof-conv/HprofConv.c
Expand Up @@ -39,6 +39,11 @@
# define TRUE (!FALSE)
#endif

// An attribute to place on a parameter to a function, for example:
// int foo(int x ATTRIBUTE_UNUSED) { return 10; }
// to avoid compiler warnings.
#define ATTRIBUTE_UNUSED __attribute__((__unused__))

typedef enum HprofBasicType {
HPROF_BASIC_OBJECT = 2,
HPROF_BASIC_BOOLEAN = 4,
Expand Down Expand Up @@ -401,7 +406,7 @@ static int computeClassDumpLen(const unsigned char* origBuf, int len)
/*
* Compute the length of a HPROF_INSTANCE_DUMP block.
*/
static int computeInstanceDumpLen(const unsigned char* origBuf, int len)
static int computeInstanceDumpLen(const unsigned char* origBuf, int len ATTRIBUTE_UNUSED)
{
int extraCount = get4BE(origBuf + kIdentSize * 2 + 4);
return kIdentSize * 2 + 8 + extraCount;
Expand All @@ -410,7 +415,7 @@ static int computeInstanceDumpLen(const unsigned char* origBuf, int len)
/*
* Compute the length of a HPROF_OBJECT_ARRAY_DUMP block.
*/
static int computeObjectArrayDumpLen(const unsigned char* origBuf, int len)
static int computeObjectArrayDumpLen(const unsigned char* origBuf, int len ATTRIBUTE_UNUSED)
{
int arrayCount = get4BE(origBuf + kIdentSize + 4);
return kIdentSize * 2 + 8 + arrayCount * kIdentSize;
Expand All @@ -419,7 +424,7 @@ static int computeObjectArrayDumpLen(const unsigned char* origBuf, int len)
/*
* Compute the length of a HPROF_PRIMITIVE_ARRAY_DUMP block.
*/
static int computePrimitiveArrayDumpLen(const unsigned char* origBuf, int len)
static int computePrimitiveArrayDumpLen(const unsigned char* origBuf, int len ATTRIBUTE_UNUSED)
{
int arrayCount = get4BE(origBuf + kIdentSize + 4);
HprofBasicType basicType = origBuf[kIdentSize + 8];
Expand Down

0 comments on commit 544612a

Please sign in to comment.