Skip to content

Commit

Permalink
Return a non-void value to ensure every possible control path has a r…
Browse files Browse the repository at this point in the history
…eturn statement
  • Loading branch information
stephen29xie committed Dec 13, 2024
1 parent 99fcc99 commit 9a6449e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions java/com_spotify_voyager_jni_Index.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ jlong Java_com_spotify_voyager_jni_Index_addItem___3F(JNIEnv *env, jobject self,
env->ThrowNew(env->FindClass("java/lang/RuntimeException"), e.what());
}
}
return -1;
}

jlong Java_com_spotify_voyager_jni_Index_addItem___3FJ(JNIEnv *env,
Expand All @@ -367,6 +368,7 @@ jlong Java_com_spotify_voyager_jni_Index_addItem___3FJ(JNIEnv *env,
env->ThrowNew(env->FindClass("java/lang/RuntimeException"), e.what());
}
}
return -1;
}

jlongArray Java_com_spotify_voyager_jni_Index_addItems___3_3FI(
Expand All @@ -389,6 +391,7 @@ jlongArray Java_com_spotify_voyager_jni_Index_addItems___3_3FI(
env->ThrowNew(env->FindClass("java/lang/RuntimeException"), e.what());
}
}
return nullptr;
}

jlongArray Java_com_spotify_voyager_jni_Index_addItems___3_3F_3JI(
Expand All @@ -412,6 +415,7 @@ jlongArray Java_com_spotify_voyager_jni_Index_addItems___3_3F_3JI(
env->ThrowNew(env->FindClass("java/lang/RuntimeException"), e.what());
}
}
return nullptr;
}

////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 9a6449e

Please sign in to comment.