Skip to content

Commit a0b09de

Browse files
committed
Removed some warnings
1 parent ce6bc42 commit a0b09de

9 files changed

Lines changed: 386 additions & 386 deletions

File tree

src/neuralnetwork/activation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ activation::method activation::string_to_method(const std::string& str)
540540
MYODDWEB_PROFILE_FUNCTION("activation");
541541
std::string lower_str = str;
542542
std::transform(lower_str.begin(), lower_str.end(), lower_str.begin(),
543-
[](unsigned char c) { return std::tolower(c); });
543+
[](unsigned char c) { return static_cast<char>(std::tolower(static_cast<int>(c))); });
544544

545545
if (lower_str == "linear")
546546
{

src/neuralnetwork/errorcalculation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class ErrorCalculation
8080
MYODDWEB_PROFILE_FUNCTION("ErrorCalculation");
8181
std::string lower_str = str;
8282
std::transform(lower_str.begin(), lower_str.end(), lower_str.begin(),
83-
[](unsigned char c) { return std::tolower(c); });
83+
[](unsigned char c) { return static_cast<char>(std::tolower(static_cast<int>(c))); });
8484

8585
if (lower_str == "none")
8686
{

src/neuralnetwork/examples/compound_output_sandwich.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class ExampleCompoundOutputSandwich
7474

7575
static void verify_network(NeuralNetwork& nn, const std::vector<std::vector<double>>& inputs, const std::vector<std::vector<double>>& outputs, const std::string& label)
7676
{
77+
(void)outputs;
7778
auto results = nn.think(inputs);
7879

7980
bool s0_sum_ok = true;

src/neuralnetwork/examples/multi_output_gru.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class ExampleMultiOutputGru
9090
static bool run_tests(NeuralNetwork& nn, size_t sequence_length)
9191
{
9292
MYODDWEB_PROFILE_FUNCTION("ExampleMultiOutputGru");
93+
(void)sequence_length;
9394
Logger::info("Running validation tests...");
9495

9596
struct TestCase {

src/neuralnetwork/examples/syntheticsentiment.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ class ExampleSyntheticSentiment
5959
for (size_t i = 0; i < num_samples; ++i)
6060
{
6161
std::vector<int> seq_indices;
62-
double sentiment = 0.5; // undefined
6362

6463
// Simple template choice
6564
// 0: "The movie is [not] [very] good/bad"

src/neuralnetwork/layer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ class Layer
288288
std::string lower_str = str;
289289
// Convert the string to lowercase for case-insensitive comparison
290290
std::transform(lower_str.begin(), lower_str.end(), lower_str.begin(),
291-
[](unsigned char c) { return std::tolower(c); });
291+
[](unsigned char c) { return static_cast<char>(std::tolower(static_cast<int>(c))); });
292292

293293
if (lower_str == "none")
294294
{

0 commit comments

Comments
 (0)