copyFrom(other.skeleton);
}
+DateTimeMatcher& DateTimeMatcher::operator=(const DateTimeMatcher& other) {
+ copyFrom(other.skeleton);
+ return *this;
+}
+
void
DateTimeMatcher::set(const UnicodeString& pattern, FormatParser* fp) {
int32_t getDistance(const DateTimeMatcher& other, int32_t includeMask, DistanceInfo& distanceInfo) const;
DateTimeMatcher();
DateTimeMatcher(const DateTimeMatcher& other);
+ DateTimeMatcher& operator=(const DateTimeMatcher& other);
virtual ~DateTimeMatcher();
int32_t getFieldMask() const;
};
*/
BasicTimeZone(const BasicTimeZone& source);
+ /**
+ * Copy assignment.
+ * @stable ICU 3.8
+ */
+ BasicTimeZone& operator=(const BasicTimeZone&) = default;
+
/**
* Gets the set of TimeZoneRule instances applicable to the specified time and after.
* @param start The start date used for extracting time zone rules
*/
NumberingSystem(const NumberingSystem& other);
+ /**
+ * Copy assignment.
+ * @stable ICU 4.2
+ */
+ NumberingSystem& operator=(const NumberingSystem& other) = default;
+
/**
* Destructor.
* @stable ICU 4.2
err = U_ZERO_ERROR;
myConvName[UCNV_MAX_CONVERTER_NAME_LENGTH-1] = ',';
- strncpy(myConvName + UCNV_MAX_CONVERTER_NAME_LENGTH, "locale=", 7);
+ memcpy(myConvName + UCNV_MAX_CONVERTER_NAME_LENGTH, "locale=", 7);
cnv = ucnv_open(myConvName, &err);
if (cnv || err != U_ILLEGAL_ARGUMENT_ERROR) {
log_err("4) Didn't get U_ILLEGAL_ARGUMENT_ERROR as expected %s\n", u_errorName(err));
cc.offsets=NULL;
}
else {
- memset(resultOffsets, -1, UPRV_LENGTHOF(resultOffsets));
+ for (int32_t i = 0; i < UPRV_LENGTHOF(resultOffsets); i++) {
+ resultOffsets[i] = -1;
+ }
+ }
+ for (int32_t i = 0; i < UPRV_LENGTHOF(result); i++) {
+ result[i] = -1;
}
- memset(result, -1, UPRV_LENGTHOF(result));
errorCode.reset();
resultLength=stepToUnicode(cc, cnv.getAlias(),
result, UPRV_LENGTHOF(result),
ok=TRUE;
for(i=0; i<UPRV_LENGTHOF(steps) && ok; ++i) {
step=steps[i].step;
- memset(resultOffsets, -1, UPRV_LENGTHOF(resultOffsets));
- memset(result, -1, UPRV_LENGTHOF(result));
+ for (int32_t i = 0; i < UPRV_LENGTHOF(resultOffsets); i++) {
+ resultOffsets[i] = -1;
+ }
+ for (int32_t i = 0; i < UPRV_LENGTHOF(result); i++) {
+ result[i] = -1;
+ }
errorCode=U_ZERO_ERROR;
resultLength=stepFromUnicode(cc, cnv,
result, UPRV_LENGTHOF(result),
u_charName(c, U_EXTENDED_CHAR_NAME, cName, sizeof(cName), &status);
char buffer[200];
- snprintf(buffer, 200,
+ auto ret = snprintf(buffer, UPRV_LENGTHOF(buffer),
"%4s %3i : %1s %1s %10s %-*s %-40s %-40s",
currentLineFlag.c_str(),
ci,
classNameSize,
mk.classNameFromCodepoint(c).c_str(),
mk.getAppliedRule(ci).c_str(), cName);
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < UPRV_LENGTHOF(buffer));
// Output the error
if (ci == i) {
#include "flagparser.h"
#include "filetools.h"
#include "charstr.h"
+#include "uassert.h"
#if U_HAVE_POPEN
# include <unistd.h>
int32_t result = 0;
char cmd[SMALL_BUFFER_MAX_SIZE];
- sprintf(cmd, "cd %s && %s %s %s%s%s",
+ auto ret = snprintf(cmd,
+ SMALL_BUFFER_MAX_SIZE,
+ "cd %s && %s %s %s%s%s",
targetDir,
pkgDataFlags[INSTALL_CMD],
libFileNames[LIB_FILE_VERSION],
- installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION]
- );
+ installDir, PKGDATA_FILE_SEP_STRING, libFileNames[LIB_FILE_VERSION]);
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
result = runCommand(cmd);
buffer[bufferLength-1] = 0;
}
- sprintf(cmd, "%s %s%s%s %s%s%s",
+ auto ret = snprintf(cmd,
+ SMALL_BUFFER_MAX_SIZE,
+ "%s %s%s%s %s%s%s",
pkgDataFlags[INSTALL_CMD],
srcDir, PKGDATA_FILE_SEP_STRING, buffer,
installDir, PKGDATA_FILE_SEP_STRING, buffer);
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
result = runCommand(cmd);
if (result != 0) {
break;
}
}
- sprintf(newName, "%s_%s",
+ auto ret = snprintf(newName,
+ SMALL_BUFFER_MAX_SIZE,
+ "%s_%s",
DATA_PREFIX[n],
newNameTmp);
- sprintf(dataName, "%s_%s",
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
+ ret = snprintf(dataName,
+ SMALL_BUFFER_MAX_SIZE,
+ "%s_%s",
o->shortName,
DATA_PREFIX[n]);
+ (void)ret;
+ U_ASSERT(0 <= ret && ret < SMALL_BUFFER_MAX_SIZE);
}
if (newName[0] != 0) {
break;