Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026

Diff for libcfg+/src/shared.c between version 1.33 and 1.34

version 1.33, 2003/07/14 12:11:27 version 1.34, 2003/08/20 11:31:34
Line 16 
Line 16 
  * http://www.platon.sk/projects/libcfg+/   * http://www.platon.sk/projects/libcfg+/
  */   */
   
 /* $Platon: libcfg+/src/shared.c,v 1.32 2003/02/28 02:06:02 nepto Exp $ */  /* $Platon: libcfg+/src/shared.c,v 1.33 2003/07/14 12:11:27 nepto Exp $ */
   
 /* Includes {{{ */  /* Includes {{{ */
 #ifdef HAVE_CONFIG_H  #ifdef HAVE_CONFIG_H
Line 725  store_single_arg(type, arg, where)
Line 725  store_single_arg(type, arg, where)
                                 return CFG_ERROR_BADNUMBER;                                  return CFG_ERROR_BADNUMBER;
   
                         if (double_val == +HUGE_VAL || double_val == -HUGE_VAL)                          if (double_val == +HUGE_VAL || double_val == -HUGE_VAL)
                                 return f_integer ? CFG_ERROR_BADNUMBER : CFG_ERROR_OVERFLOW;                                  /* Purpously always return overflow error */
                                   return f_integer ? CFG_ERROR_OVERFLOW : CFG_ERROR_OVERFLOW;
 #if HAVE_ERRNO_H  #if HAVE_ERRNO_H
                         if (double_val == 0.0 && errno == ERANGE)                          if (double_val == 0.0 && errno == ERANGE)
 #else  #else
                                 if (double_val == 0.0 && end == arg)                                  if (double_val == 0.0 && end == arg)
 #endif  #endif
                                         return f_integer ? CFG_ERROR_BADNUMBER : CFG_ERROR_OVERFLOW;                                          /* Again always return overflow error */
                                           return f_integer ? CFG_ERROR_OVERFLOW : CFG_ERROR_OVERFLOW;
   
                         /* Validating coversion results */                          /* Validating coversion results */
                         if (end == NULL || *end != '\0')                          if (end == NULL || *end != '\0')
Line 741  store_single_arg(type, arg, where)
Line 743  store_single_arg(type, arg, where)
                                 break;                                  break;
   
                         if (type == CFG_ULONG) {                          if (type == CFG_ULONG) {
                                   register double diff;
                                 ulong_val = (unsigned long) double_val;                                  ulong_val = (unsigned long) double_val;
                                 if (double_val - (double) ulong_val != 0.0)                                  diff      = double_val - (double) long_val;
                                   if (diff >= 1.0 || diff <= -1.0)
                                           return CFG_ERROR_OVERFLOW;
                                   if (diff != 0.0)
                                         return CFG_ERROR_BADNUMBER;                                          return CFG_ERROR_BADNUMBER;
                         } else {                          } else {
                                   register double diff;
                                 long_val = (long) double_val;                                  long_val = (long) double_val;
                                 if (double_val - (double) long_val != 0.0)                                  diff     = double_val - (double) long_val;
                                   if (diff >= 1.0 || diff <= -1.0)
                                           return CFG_ERROR_OVERFLOW;
                                   if (diff != 0.0)
                                         return CFG_ERROR_BADNUMBER;                                          return CFG_ERROR_BADNUMBER;
                         }                          }
                         break;                          break;

Legend:
Removed from v.1.33  
changed lines
  Added in v.1.34

Platon Group <platon@platon.org> http://platon.org/
Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top