Browse Source

Use %lld with long long type instead of PRId64 for printf.

tags/v2.0.4
Andrew Belt 2 years ago
parent
commit
ffe340f4b2
2 changed files with 10 additions and 10 deletions
  1. +4
    -4
      src/app/RackWidget.cpp
  2. +6
    -6
      src/engine/Cable.cpp

+ 4
- 4
src/app/RackWidget.cpp View File

@@ -292,7 +292,7 @@ void RackWidget::mergeJson(json_t* rootJ) {
// TODO Legacy v0.6?
ModuleWidget* mw = getModule(id);
if (!mw) {
WARN("Cannot find ModuleWidget %" PRId64, id);
WARN("Cannot find ModuleWidget %lld", (long long) id);
continue;
}

@@ -317,7 +317,7 @@ void RackWidget::mergeJson(json_t* rootJ) {
int64_t id = json_integer_value(idJ);
CableWidget* cw = getCable(id);
if (!cw) {
WARN("Cannot find CableWidget %" PRId64, id);
WARN("Cannot find CableWidget %lld", (long long) id);
continue;
}

@@ -356,7 +356,7 @@ void RackWidget::fromJson(json_t* rootJ) {
// Get Module
engine::Module* module = APP->engine->getModule(id);
if (!module) {
WARN("Cannot find Module %" PRId64, id);
WARN("Cannot find Module %lld", (long long) id);
continue;
}

@@ -404,7 +404,7 @@ void RackWidget::fromJson(json_t* rootJ) {
// Get Cable
engine::Cable* cable = APP->engine->getCable(id);
if (!cable) {
WARN("Cannot find Cable %" PRId64, id);
WARN("Cannot find Cable %lld", (long long) id);
continue;
}



+ 6
- 6
src/engine/Cable.cpp View File

@@ -31,31 +31,31 @@ void Cable::fromJson(json_t* rootJ) {
// inputModuleId
json_t* inputModuleIdJ = json_object_get(rootJ, "inputModuleId");
if (!inputModuleIdJ)
throw Exception("Input module ID not found for cable %" PRId64, id);
throw Exception("Input module ID not found for cable %lld", (long long) id);
int64_t inputModuleId = json_integer_value(inputModuleIdJ);
inputModule = APP->engine->getModule(inputModuleId);
if (!inputModule)
throw Exception("Input module %" PRId64 " not found for cable %" PRId64, inputModuleId, id);
throw Exception("Input module %lld not found for cable %lld", (long long) inputModuleId, (long long) id);

// inputId
json_t* inputIdJ = json_object_get(rootJ, "inputId");
if (!inputIdJ)
throw Exception("Input ID not found for cable %" PRId64, id);
throw Exception("Input ID not found for cable %lld", (long long) id);
inputId = json_integer_value(inputIdJ);

// outputModuleId
json_t* outputModuleIdJ = json_object_get(rootJ, "outputModuleId");
if (!outputModuleIdJ)
throw Exception("Output module ID not found for cable %" PRId64, id);
throw Exception("Output module ID not found for cable %lld", (long long) id);
int64_t outputModuleId = json_integer_value(outputModuleIdJ);
outputModule = APP->engine->getModule(outputModuleId);
if (!outputModule)
throw Exception("Output module %" PRId64 " not found for cable %" PRId64, outputModuleId, id);
throw Exception("Output module %lld not found for cable %lld", (long long) outputModuleId, (long long) id);

// outputId
json_t* outputIdJ = json_object_get(rootJ, "outputId");
if (!outputIdJ)
throw Exception("Output ID not found for cable %" PRId64, id);
throw Exception("Output ID not found for cable %lld", (long long) id);
outputId = json_integer_value(outputIdJ);
}



Loading…
Cancel
Save