diff --git a/modules/gmt/modgmt_gsfuncs.cpp b/modules/gmt/modgmt_gsfuncs.cpp index cd2d646..32f5614 100644 --- a/modules/gmt/modgmt_gsfuncs.cpp +++ b/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(gsworkthread(&wp)); + end: return *pret; } diff --git a/modules/gmt/modgmt_internals.cpp b/modules/gmt/modgmt_internals.cpp index 732e887..7cc1744 100644 --- a/modules/gmt/modgmt_internals.cpp +++ b/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(&pret)); + end: return *pret; } // Overloaded variant with opts as std::string diff --git a/modules/gmt/modgmt_map.cpp b/modules/gmt/modgmt_map.cpp index d35f064..cba9352 100644 --- a/modules/gmt/modgmt_map.cpp +++ b/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;} }