Commit eba0ad0d authored by Alexander Danilov's avatar Alexander Danilov
Browse files

Examples: MatSolve: minor fixes

Support old C++ standards: use NULL instead of nullptr.
Fix stdlib C headers names.
Fix warning "comparison between signed and unsigned integer
expressions".
parent 9e2dc5d9
...@@ -16,7 +16,7 @@ InnerOptions *parseInnerDatabaseOptions(char *optionsFile) { ...@@ -16,7 +16,7 @@ InnerOptions *parseInnerDatabaseOptions(char *optionsFile) {
FILE *databaseFile = fopen(optionsFile, "r"); FILE *databaseFile = fopen(optionsFile, "r");
if (!databaseFile) { if (!databaseFile) {
std::cout << "Inner options file not found" << std::endl; std::cout << "Inner options file not found" << std::endl;
return nullptr; return NULL;
} }
InnerOptions *options = new InnerOptions(); InnerOptions *options = new InnerOptions();
char *tmp = (char *) calloc(256, sizeof(char)); char *tmp = (char *) calloc(256, sizeof(char));
......
...@@ -4,8 +4,9 @@ ...@@ -4,8 +4,9 @@
#include <string> #include <string>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <stdlib.h> #include <cstdlib>
#include <string.h> #include <cstring>
#include <cstdio>
enum OptionType { enum OptionType {
REAL, REAL,
......
...@@ -218,8 +218,8 @@ int main(int argc, char ** argv) { ...@@ -218,8 +218,8 @@ int main(int argc, char ** argv) {
char *fileName = findInnerOptions(parametersFileName.c_str()); char *fileName = findInnerOptions(parametersFileName.c_str());
if (fileName != NULL) { if (fileName != NULL) {
InnerOptions *options = parseInnerDatabaseOptions(fileName); InnerOptions *options = parseInnerDatabaseOptions(fileName);
if (options != nullptr) { if (options != NULL) {
for (int ii = 0; ii < options->options.size(); ii++) { for (unsigned ii = 0; ii < options->options.size(); ii++) {
InnerOption *option = options->options[ii]; InnerOption *option = options->options[ii];
if (option->type == ENUM) { if (option->type == ENUM) {
s.SetParameterEnum(option->name, (unsigned int) atoi(option->value.c_str())); s.SetParameterEnum(option->name, (unsigned int) atoi(option->value.c_str()));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment