Skip to content

Commit 55a2fb4

Browse files
committed
fixes codeql wrong-type-format-argument
1 parent 24607fe commit 55a2fb4

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/IlmCtl/CtlType.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ void Type::childElementV(size_t *offset, TypePtr *type, const std::string path,
132132
offsets=((SizeVector *)va_arg(ap, SizeVector *));
133133
while(offsets->size()!=0) {
134134
if(sizes.size()==0) {
135-
throw(DatatypeExc("too many dimensions specified for matrix (or array) vector element (at least %d too many)", offsets->size()));
135+
throw(DatatypeExc("too many dimensions specified for matrix (or array) vector element (at least %zu too many)", offsets->size()));
136136
}
137137
if(offset[0]>=sizes[0]) {
138-
throw(DatatypeExc("out of range matrix (or array) vector element (%u>=%u)", offset[0], sizes[0]));
138+
throw(DatatypeExc("out of range matrix (or array) vector element (%zu>=%zu)", offset[0], sizes[0]));
139139
}
140140
*offset=*offset+array_type->elementType()->objectSize()*((*offsets)[0]);
141141
*type=array_type->elementType();
@@ -150,7 +150,7 @@ void Type::childElementV(size_t *offset, TypePtr *type, const std::string path,
150150
}
151151

152152
if(u>=sizes[0]) {
153-
throw(DatatypeExc("out of range matrix (or array) element specification (%u>=%u)", u, sizes[0]));
153+
throw(DatatypeExc("out of range matrix (or array) element specification (%u>=%zu)", u, sizes[0]));
154154
}
155155

156156
*offset=*offset+u*array_type->elementType()->objectSize();

lib/IlmCtl/CtlTypeStorage.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ void TypeStorage::_set(const char *src, CDataType_e src_type,
463463
out=out+type()->objectSize();
464464
}
465465
} else {
466-
throw(DatatypeExc("unexpected data objectSize (%d)", data_type->objectSize()));
466+
throw(DatatypeExc("unexpected data objectSize (%zu)", data_type->objectSize()));
467467
}
468468
return;
469469
}
@@ -547,7 +547,7 @@ void TypeStorage::_get(char *dst, CDataType_e dst_type,
547547
in=in+type()->objectSize();
548548
}
549549
} else {
550-
throw(DatatypeExc("unexpected data objectSize (%d)", data_type->objectSize()));
550+
throw(DatatypeExc("unexpected data objectSize (%zu)", data_type->objectSize()));
551551
}
552552
return;
553553
}

0 commit comments

Comments
 (0)