+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
*
*******************************************************************************
* file name: toolutil.c
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
resultLen = 0;
} else {
resultPtr = path;
- resultLen = basename - path;
+ resultLen = static_cast<int32_t>(basename - path);
if(resultLen<1) {
resultLen = 1; /* '/' or '/a' -> '/' */
}
const char *basename=uprv_strrchr(filename, U_FILE_SEP_CHAR);
#if U_FILE_ALT_SEP_CHAR!=U_FILE_SEP_CHAR
- if(basename==NULL) {
+#if !(U_PLATFORM == U_PF_CYGWIN && U_PLATFORM_USES_ONLY_WIN32_API)
+ if(basename==NULL)
+#endif
+ {
/* Use lenient matching on Windows, which can accept either \ or /
This is useful for environments like Win32+CygWin which have both.
*/
char name[64];
int32_t capacity, maxCapacity, size, idx;
void *array;
- UAlignedMemory staticArray[1];
+ alignas(max_align_t) char staticArray[1];
};
U_CAPI UToolMemory * U_EXPORT2
if(mem->array==mem->staticArray) {
mem->array=uprv_malloc(newCapacity*mem->size);
if(mem->array!=NULL) {
- uprv_memcpy(mem->array, mem->staticArray, mem->idx*mem->size);
+ uprv_memcpy(mem->array, mem->staticArray, (size_t)mem->idx*mem->size);
}
} else {
mem->array=uprv_realloc(mem->array, newCapacity*mem->size);