]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/edit.c
Add const for Solaris' C++ compiler
[bacula/bacula] / bacula / src / lib / edit.c
index 23360905e04fa6b85f096c8081589d6f85e6f1ef..a55de70e081f680f33dec53b53f58c5d583828dd 100644 (file)
@@ -109,9 +109,9 @@ int duration_to_utime(char *str, utime_t *value)
     *   to months. These "kludges" make it compatible with pre 1.31 
     *  Baculas.
     */
-   static char *mod[] = {"n", "seconds", "months", "minutes", 
-                 "hours", "days", "weeks",   "quarters",   "years", NULL};
-   static int32_t mult[] = {60,   1, 60*60*24*30, 60, 
+   static const char *mod[] = {"n", "seconds", "months", "minutes", 
+                  "hours", "days", "weeks",   "quarters",   "years", NULL};
+   static const int32_t mult[] = {60,  1, 60*60*24*30, 60, 
                  60*60, 60*60*24, 60*60*24*7, 60*60*24*91, 60*60*24*365};
    char mod_str[20];
    int mod_len;
@@ -262,9 +262,16 @@ int size_to_uint64(char *str, int str_len, uint64_t *rtn_value)
    if (errno != 0 || value < 0) {
       return 0;
    }
+#if defined(HAVE_WIN32)
+   /* work around microsofts non handling of uint64 to double cvt*/
+   *rtn_value = (uint64_t)(value * (__int64)mult[i]);
+   Dmsg2(400, "Full value = %lf %" lld "\n", value * (__int64)mult[i],  
+        (uint64_t)(value * (__int64)mult[i]));
+#else
    *rtn_value = (uint64_t)(value * mult[i]);
    Dmsg2(400, "Full value = %lf %" lld "\n", value * mult[i],  
       (uint64_t)(value * mult[i]));
+#endif
    return 1;
 }