Skip to content

Commit

Permalink
Merge pull request #4617 from BlainHamon/timob-14331_3_1_X
Browse files Browse the repository at this point in the history
TIMOB-14331 Rename two base64 methods to avoid conflicts
  • Loading branch information
srahim committed Aug 31, 2013
2 parents 338afb8 + 69488df commit df94e5e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions iphone/Classes/Base64Transcoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ size_t EstimateBas64EncodedDataSize(size_t inDataSize)
return(theEncodedDataSize);
}

size_t EstimateBas64DecodedDataSize(size_t inDataSize)
size_t TI_EstimateBas64DecodedDataSize(size_t inDataSize)
{
size_t theDecodedDataSize = (int)ceil(inDataSize / 4.0) * 3;
//theDecodedDataSize = theDecodedDataSize / 72 * 74 + theDecodedDataSize % 72;
Expand Down Expand Up @@ -165,11 +165,11 @@ bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *out
return(true);
}

bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize)
bool TI_Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize)
{
memset(ioOutputData, '.', *ioOutputDataSize);

size_t theDecodedDataSize = EstimateBas64DecodedDataSize(inInputDataSize);
size_t theDecodedDataSize = TI_EstimateBas64DecodedDataSize(inInputDataSize);
if (*ioOutputDataSize < theDecodedDataSize)
return(false);
*ioOutputDataSize = 0;
Expand Down
4 changes: 2 additions & 2 deletions iphone/Classes/Base64Transcoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ extern "C" {
#endif

size_t EstimateBas64EncodedDataSize(size_t inDataSize);
size_t EstimateBas64DecodedDataSize(size_t inDataSize);
size_t TI_EstimateBas64DecodedDataSize(size_t inDataSize);

bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize);
bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize);
bool TI_Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize);

#if defined(__cplusplus)
}
Expand Down
4 changes: 2 additions & 2 deletions iphone/Classes/ThirdpartyNS.h
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,14 @@
#endif
#ifndef EstimateBas64DecodedDataSize
// libtiverify dependency
//#define EstimateBas64DecodedDataSize __TI_NS_SYMBOL(EstimateBas64DecodedDataSize)
// EstimateBas64DecodedDataSize is now TI_EstimateBas64DecodedDataSize
#endif
#ifndef Base64EncodeData
#define Base64EncodeData __TI_NS_SYMBOL(Base64EncodeData)
#endif
#ifndef Base64DecodeData
// libtiverify dependency
//#define Base64DecodeData __TI_NS_SYMBOL(Base64DecodeData)
// Base64DecodeData is now TI_Base64DecodeData
#endif

// SBJSON
Expand Down
4 changes: 2 additions & 2 deletions iphone/Classes/UtilsModule.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ -(TiBlob*)base64decode:(id)args
const char *data = [str UTF8String];
size_t len = [str length];

size_t outsize = EstimateBas64DecodedDataSize(len);
size_t outsize = TI_EstimateBas64DecodedDataSize(len);
char *base64Result = NULL;
if(len>0){
base64Result = malloc(sizeof(char)*outsize);
Expand All @@ -81,7 +81,7 @@ -(TiBlob*)base64decode:(id)args
}

size_t theResultLength = outsize;
bool result = Base64DecodeData(data, len, base64Result, &theResultLength);
bool result = TI_Base64DecodeData(data, len, base64Result, &theResultLength);
if (result)
{
NSData *theData = [NSData dataWithBytes:base64Result length:theResultLength];
Expand Down
Binary file modified iphone/lib/libtiverify.a
Binary file not shown.

0 comments on commit df94e5e

Please sign in to comment.