Merge branch 'master' into pygromacs
[alexxy/gromacs.git] / src / gromacs / gmxlib / warninp.cpp
similarity index 97%
rename from src/gromacs/gmxlib/warninp.c
rename to src/gromacs/gmxlib/warninp.cpp
index 62ce4aa2e4790dce6b91a696ab5d27776ecc2aa5..3d1eb9cadf9bfd691a47c90b2bbe2ce67d32e934 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "gromacs/legacyheaders/warninp.h"
 
-#include <string.h>
+#include <cstring>
 
 #include "gromacs/legacyheaders/copyrite.h"
 #include "gromacs/utility/cstringutil.h"
@@ -76,7 +76,7 @@ void set_warning_line(warninp_t wi, const char *s, int line)
 {
     if (s != NULL)
     {
-        strcpy(wi->filenm, s);
+        std::strcpy(wi->filenm, s);
     }
     wi->lineno = line;
 }
@@ -101,15 +101,15 @@ static void low_warning(warninp_t wi, const char *wtype, int n, const char *s)
     {
         s = "Empty error message.";
     }
-    snew(temp, strlen(s)+indent+1);
+    snew(temp, std::strlen(s)+indent+1);
     for (i = 0; i < indent; i++)
     {
         temp[i] = ' ';
     }
     temp[indent] = '\0';
-    strcat(temp, s);
+    std::strcat(temp, s);
     temp2 = wrap_lines(temp, 78-indent, indent, FALSE);
-    if (strlen(wi->filenm) > 0)
+    if (std::strlen(wi->filenm) > 0)
     {
         if (wi->lineno != -1)
         {