summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-08 23:01:30 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-08-08 23:01:30 -0700
commit2312ee00402088307e69589c3d12529b5232df66 (patch)
tree0091ccad3323e4768a3042702d66c0102523b3b3
parent6d6aa84dc6acb2daa3ef7e20942c38a1416bf543 (diff)
Make STORE_STRING cast strlen result to CARD16 when storing in CARD16
Clears a number of clang warnings of the form: connect.c:328:6: warning: implicit conversion loses integer precision: 'size_t' (aka 'unsigned long') to 'CARD16' (aka 'unsigned short') [-Wconversion] STORE_STRING (pData, _IceAuthNames[i]); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./ICElibint.h:173:19: note: expanded from macro 'STORE_STRING' CARD16 _len = strlen (_string); \ ~~~~ ^~~~~~~~~~~~~~~~ Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--src/ICElibint.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ICElibint.h b/src/ICElibint.h
index cb53d83..86a5406 100644
--- a/src/ICElibint.h
+++ b/src/ICElibint.h
@@ -170,7 +170,7 @@ typedef struct {
#define STORE_STRING(_pBuf, _string) \
{ \
- CARD16 _len = strlen (_string); \
+ CARD16 _len = (CARD16) strlen (_string); \
STORE_CARD16 (_pBuf, _len); \
memcpy (_pBuf, _string, _len); \
_pBuf += _len; \