+// © 2016 and later: Unicode, Inc. and others.
+// License & terms of use: http://www.unicode.org/copyright.html
/*
*******************************************************************************
*
*
*******************************************************************************
* file name: package.cpp
-* encoding: US-ASCII
+* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
U_NAMESPACE_BEGIN
-Package::Package()
+Package::Package()
: doAutoPrefix(FALSE), prefixEndsWithType(FALSE) {
inPkgName[0]=0;
pkgPrefix[0]=0;
// set the last item's platform type
typeEnum=getTypeEnumForInputData(items[itemCount-1].data, items[itemCount-1].length, &errorCode);
if(typeEnum<0 || U_FAILURE(errorCode)) {
- fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[i-1].name, filename);
+ fprintf(stderr, "icupkg: not an ICU data file: item \"%s\" in \"%s\"\n", items[itemCount-1].name, filename);
exit(U_INVALID_FORMAT_ERROR);
}
items[itemCount-1].type=makeTypeLetter(typeEnum);
}
}
-void Package::setItemCapacity(int32_t max)
+void Package::setItemCapacity(int32_t max)
{
if(max<=itemMax) {
return;
Item *newItems = (Item*)uprv_malloc(max * sizeof(items[0]));
Item *oldItems = items;
if(newItems == NULL) {
- fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n",
- (unsigned long)max*sizeof(items[0]), max);
+ fprintf(stderr, "icupkg: Out of memory trying to allocate %lu bytes for %d items\n",
+ (unsigned long)(max*sizeof(items[0])), max);
exit(U_MEMORY_ALLOCATION_ERROR);
}
if(items && itemCount>0) {