Browse Source

Gmt module: Fix warnings of gcc6.

master
Michael Uleysky 8 years ago
parent
commit
a47ff9fdcc
  1. 3
      modules/gmt/modgmt_gsfuncs.cpp
  2. 3
      modules/gmt/modgmt_internals.cpp
  3. 26
      modules/gmt/modgmt_map.cpp

3
modules/gmt/modgmt_gsfuncs.cpp

@ -96,7 +96,7 @@ static int GhostRun(const std::string& opts, struct gs_runtime* r, std::string*
ssize_t br;
char buffer[4096];
pipe(pipefd);
if(0!=pipe(pipefd)) {*pret=-1; goto end;}
wp.fd=pipefd[1];
out->erase();
@ -112,6 +112,7 @@ static int GhostRun(const std::string& opts, struct gs_runtime* r, std::string*
}
else pret=reinterpret_cast<int*>(gsworkthread(&wp));
end:
return *pret;
}

3
modules/gmt/modgmt_internals.cpp

@ -45,7 +45,7 @@ int callgmtmodule(void *api, const char *module, struct GMT_OPTION *opts, std::s
struct gmtworkthreadpars p;
int *pret;
pipe(pipefd);
if(0!=pipe(pipefd)) {*pret=-1; goto end;}
p.api=api;
p.module=module;
p.opts=opts;
@ -59,6 +59,7 @@ int callgmtmodule(void *api, const char *module, struct GMT_OPTION *opts, std::s
res->shrink_to_fit();
pthread_join(wthr,reinterpret_cast<void**>(&pret));
end:
return *pret;
}
// Overloaded variant with opts as std::string

26
modules/gmt/modgmt_map.cpp

@ -298,9 +298,16 @@ const ObjectBase* GMT_Convert2PNG(const ObjectList* input)
if(taa.Exist()) aats=taa;
if(gaa.Exist()) aags=gaa;
tolower(aags); tolower(aats);
if("none" ==aags || "no"==aags || "n"==aags) aag=1; if("none" ==aats || "no"==aats || "n"==aats) aat=1;
if("small"==aags || "s" ==aags ) aag=2; if("small"==aats || "s" ==aats ) aat=2;
if("full" ==aags || "f" ==aags ) aag=4; if("full" ==aats || "f" ==aats ) aat=4;
if("none" ==aags || "no"==aags || "n"==aags) aag=1;
if("none" ==aats || "no"==aats || "n"==aats) aat=1;
if("small"==aags || "s" ==aags ) aag=2;
if("small"==aats || "s" ==aats ) aat=2;
if("full" ==aags || "f" ==aags ) aag=4;
if("full" ==aats || "f" ==aats ) aat=4;
if(0==aat) {err="Incorrect value for text antialiasing: "+aats; goto fail;}
if(0==aag) {err="Incorrect value for graphics antialiasing: "+aags; goto fail;}
}
@ -408,9 +415,16 @@ const ObjectBase* GMT_Convert2JPG(const ObjectList* input)
if(taa.Exist()) aats=taa;
if(gaa.Exist()) aags=gaa;
tolower(aags); tolower(aats);
if("none" ==aags || "no"==aags || "n"==aags) aag=1; if("none" ==aats || "no"==aats || "n"==aats) aat=1;
if("small"==aags || "s" ==aags ) aag=2; if("small"==aats || "s" ==aats ) aat=2;
if("full" ==aags || "f" ==aags ) aag=4; if("full" ==aats || "f" ==aats ) aat=4;
if("none" ==aags || "no"==aags || "n"==aags) aag=1;
if("none" ==aats || "no"==aats || "n"==aats) aat=1;
if("small"==aags || "s" ==aags ) aag=2;
if("small"==aats || "s" ==aats ) aat=2;
if("full" ==aags || "f" ==aags ) aag=4;
if("full" ==aats || "f" ==aats ) aat=4;
if(0==aat) {err="Incorrect value for text antialiasing: "+aats; goto fail;}
if(0==aag) {err="Incorrect value for graphics antialiasing: "+aags; goto fail;}
}

Loading…
Cancel
Save