Skip to content

Commit 15e5887

Browse files
get rid of compiler warnings
1 parent 7895e12 commit 15e5887

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

src/main/c/src/create_clause_visitor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ any CreateClauseVisitor::visitOC_PowerOfExpression(
405405
} else if (ctx->oC_UnaryAddOrSubtractExpression().size() == 1) {
406406
return ctx->oC_UnaryAddOrSubtractExpression(0)->accept(this);
407407
}
408+
return any();
408409
}
409410

410411
any CreateClauseVisitor::visitOC_UnaryAddOrSubtractExpression(

src/main/c/src/cypher_expression.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ jvalue LiteralExpr::getValue() {
8282
value.l = (jobject)agent->createNewString(this->value);
8383
return value;
8484
}
85+
throw std::runtime_error("Unsupported literal type in LiteralExpr::getValue");
8586
}
8687
}
8788
Expression *LiteralExpr::evaluate(
@@ -235,6 +236,7 @@ LiteralExpr *COUNT::evaluate(
235236
jvalue count{.j = (jlong)pattern->at(litExpr->value).size()};
236237
return new LiteralExpr(count, Agent::MethodReturnType::JLONG);
237238
}
239+
throw std::runtime_error("Unsupported operand type for COUNT");
238240
}
239241
LiteralExpr *COUNT::evaluate(
240242
PropertyLookupExpr *propExpr,

src/main/c/src/jni_util.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ string Agent::fieldTypeToString(const enum MethodReturnType &type) {
4646
case JBOOLEAN:
4747
return "JBOOLEAN";
4848
}
49+
throw std::runtime_error("Unsupported field type in fieldTypeToString");
4950
}
5051

5152
jlong Agent::getIntegerTypesAsLong(const jvalue &value,
@@ -190,6 +191,7 @@ jobject Agent::createObject(const jvalue &value, const MethodReturnType &type) {
190191
case JVOID:
191192
return nullptr;
192193
}
194+
throw std::runtime_error("Unsupported type in createObject");
193195
}
194196

195197
jstring Agent::createNewString(const string &str) const {
@@ -403,6 +405,7 @@ jvalue Agent::getInstancePrimitiveField(jobject instance,
403405
value.l = nullptr;
404406
return value;
405407
}
408+
throw std::runtime_error("Unsupported field type in getInstancePrimitiveField");
406409
}
407410

408411
Agent::MethodReturnType Agent::getFieldType(const string &fieldDescriptor) {
@@ -414,6 +417,7 @@ Agent::MethodReturnType Agent::getFieldType(const string &fieldDescriptor) {
414417
JAVA_OBJECT_CREATION_TYPE_
415418
#undef ENTRY
416419
}
420+
throw std::runtime_error("Unsupported single-character field descriptor");
417421
} else if (fieldDescriptor == "Ljava/lang/String;") {
418422
return Agent::MethodReturnType::JSTRING;
419423
} else {
@@ -440,6 +444,7 @@ Agent::MethodReturnType Agent::getFieldType(jvmtiPrimitiveType type) {
440444
case jvmtiPrimitiveType::JVMTI_PRIMITIVE_TYPE_DOUBLE:
441445
return Agent::MethodReturnType::JDOUBLE;
442446
}
447+
throw std::runtime_error("Unsupported jvmti primitive type");
443448
}
444449

445450
bool Agent::isFieldArrayType(MethodReturnType type) {

0 commit comments

Comments
 (0)