/[classpath]/classpath/native/jni/java-lang/java_lang_Double.c
ViewVC logotype

Diff of /classpath/native/jni/java-lang/java_lang_Double.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by cbj, Mon Nov 12 23:37:03 2001 UTC revision 1.5 by cbj, Tue Nov 13 00:36:59 2001 UTC
# Line 251  JNIEXPORT jdouble JNICALL Java_java_lang Line 251  JNIEXPORT jdouble JNICALL Java_java_lang
251        return 0.0; /* OutOfMemoryError already thrown */        return 0.0; /* OutOfMemoryError already thrown */
252      }      }
253    
254    #ifdef DEBUG
255      fprintf (stderr, "java.lang.Double.parseDouble0 (%s)\n", buf);
256    #endif
257    
258    if (strlen(buf) > 0)    if (strlen(buf) > 0)
259      {      {
260        struct _Jv_reent reent;          struct _Jv_reent reent;  
# Line 258  JNIEXPORT jdouble JNICALL Java_java_lang Line 262  JNIEXPORT jdouble JNICALL Java_java_lang
262    
263  #ifdef KISSME_LINUX_USER  #ifdef KISSME_LINUX_USER
264        val = strtod ( buf, &endptr);        val = strtod ( buf, &endptr);
265     #else  #else
266        val = _strtod_r (&reent, buf, &endptr);        val = _strtod_r (&reent, buf, &endptr);
267     #endif  #endif
268        if (endptr == buf + strlen(buf))  
269          length = strlen(buf);
270          if    ((buf[length-1] == 'f')
271             || (buf[length-1] == 'F')
272             || (buf[length-1] == 'd')
273             || (buf[length-1] == 'D'))
274            length = length - 1;
275    
276    #ifdef DEBUG
277      fprintf (stderr, "java.lang.Double.parseDouble0 val = %g\n", val);
278      fprintf (stderr, "java.lang.Double.parseDouble0 %i = %i + %i\n", endptr, buf, length);
279    #endif
280    
281          if (endptr == buf + length)
282          return val;          return val;
283      }      }
284    JCL_ThrowException(env, "java/lang/NumberFormatException", "unable to parse double");    JCL_ThrowException(env, "java/lang/NumberFormatException", "unable to parse double");

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26