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) {
FILE *databaseFile = fopen(optionsFile, "r");
if (!databaseFile) {
std::cout << "Inner options file not found" << std::endl;
return nullptr;
return NULL;
}
InnerOptions *options = new InnerOptions();
char *tmp = (char *) calloc(256, sizeof(char));
......
......@@ -4,8 +4,9 @@
#include <string>
#include <iostream>
#include <vector>
#include <stdlib.h>
#include <string.h>
#include <cstdlib>
#include <cstring>
#include <cstdio>
enum OptionType {
REAL,
......
......@@ -218,8 +218,8 @@ int main(int argc, char ** argv) {
char *fileName = findInnerOptions(parametersFileName.c_str());
if (fileName != NULL) {
InnerOptions *options = parseInnerDatabaseOptions(fileName);
if (options != nullptr) {
for (int ii = 0; ii < options->options.size(); ii++) {
if (options != NULL) {
for (unsigned ii = 0; ii < options->options.size(); ii++) {
InnerOption *option = options->options[ii];
if (option->type == ENUM) {
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