Skip to content

Commit

Permalink
removing compiler warnings (llvm#768)
Browse files Browse the repository at this point in the history
* removing compiler warnings

Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>

* format

Signed-off-by: Alexandre Eichenberger <alexe@us.ibm.com>
  • Loading branch information
AlexandreEichenberger authored Jul 12, 2021
1 parent 4b6b99d commit 9df80c3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
6 changes: 1 addition & 5 deletions src/Builder/FrontendDialectTransformer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1069,11 +1069,7 @@ class FrontendGenImpl {
int nIn = 0;
int nOut = 0;
getNodeInputs(node, inputs);

// TODO: isn't nOut just node.output().size()?
for (const auto &item : node.output())
++nOut;

nOut = node.output().size();
buildOutputAndOperation<ONNXCustomOp>(
node, inputs, nIn, nOut, attributes);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Runtime/jni/jnilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ static THREAD_LOCAL_SPEC int log_level;
static THREAD_LOCAL_SPEC FILE *log_fp;

/* Must match enum in log.h */
static char *log_level_name[] = {
static const char *log_level_name[] = {
"trace", "debug", "info", "warning", "error", "fatal"};

unsigned long get_threadid() {
Expand Down Expand Up @@ -103,7 +103,7 @@ void log_printf(
/* Return numerical log level of give level name */
static int get_log_level_by_name(char *name) {
int level = -1;
for (int i = 0; i < sizeof(log_level_name) / sizeof(char *); i++) {
for (int i = 0; i < (int)(sizeof(log_level_name) / sizeof(char *)); i++) {
if (!strcmp(name, log_level_name[i])) {
level = i;
break;
Expand Down
1 change: 0 additions & 1 deletion src/Transform/ONNX/ConstProp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ ONNXConstantOp ConstPropTranspose(

ONNXConstantOp ConstPropUnsqueeze(
PatternRewriter &rewriter, Value replacingValue, Value input) {
Type replacingType = replacingValue.getType();
Operation *inputOp = input.getDefiningOp();

char *resArray = getArrayFromAttributeOrBuffer(rewriter, inputOp);
Expand Down

0 comments on commit 9df80c3

Please sign in to comment.