Skip to content

Commit

Permalink
More PR Feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
safern committed Mar 20, 2020
1 parent e20c334 commit 7544939
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/libraries/Native/Unix/Common/pal_atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
#include "windows.h"
#endif

static int pal_atomic_cas_ptr(void* volatile* dest, void* exchange, void* comperand)
static int pal_atomic_cas_ptr(void* volatile* dest, void* exchange, void* comparand)
{
#if defined(TARGET_UNIX)
return __atomic_compare_exchange_n(dest, exchange, comperand, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
return __atomic_compare_exchange_n(dest, exchange, comparand, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST);
#elif defined(TARGET_WINDOWS)
return InterlockedCompareExchangePointer(dest, exchange, comperand) == comperand;
return InterlockedCompareExchangePointer(dest, exchange, comparand) == comparand;
#endif
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
#if defined(TARGET_UNIX)
#include <strings.h>

#define STRING_COPY(destination, numberOfElements, source, count) \
strncpy(destination, source, count); \
destination[count - 1] = 0;
#define STRING_COPY(destination, numberOfElements, source) \
strncpy(destination, source, numberOfElements); \
destination[numberOfElements - 1] = 0;

#elif defined(TARGET_WINDOWS)
#define strcasecmp _stricmp
#define STRING_COPY(destination, numberOfElements, source, count) strncpy_s(destination, numberOfElements, source, _TRUNCATE);
#define STRING_COPY(destination, numberOfElements, source) strncpy_s(destination, numberOfElements, source, _TRUNCATE);
#endif

#define GREGORIAN_NAME "gregorian"
Expand Down Expand Up @@ -316,7 +316,7 @@ static int32_t EnumSymbols(const char* locale,
return FALSE;

char localeWithCalendarName[ULOC_FULLNAME_CAPACITY];
STRING_COPY(localeWithCalendarName, strlen(locale), locale, ULOC_FULLNAME_CAPACITY);
STRING_COPY(localeWithCalendarName, sizeof(localeWithCalendarName), locale);

uloc_setKeywordValue("calendar", GetCalendarName(calendarId), localeWithCalendarName, ULOC_FULLNAME_CAPACITY, &err);

Expand Down Expand Up @@ -423,7 +423,7 @@ static int32_t EnumAbbrevEraNames(const char* locale,

char* localeNamePtr = localeNameBuf;
char* parentNamePtr = parentNameBuf;
STRING_COPY(localeNamePtr, strlen(locale), locale, ULOC_FULLNAME_CAPACITY);
STRING_COPY(localeNamePtr, sizeof(localeNameBuf), locale);

while (TRUE)
{
Expand Down

0 comments on commit 7544939

Please sign in to comment.