/[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.14 by smarothy, Sun Oct 10 18:33:10 2004 UTC revision 1.15 by mark, Tue Oct 26 20:26:03 2004 UTC
# Line 1  Line 1 
1  /* Double.c - java.lang.Double native functions  /* Double.c - java.lang.Double native functions
2     Copyright (C) 1998, 1999, 2001, 2003 Free Software Foundation, Inc.     Copyright (C) 1998, 1999, 2001, 2003, 2004 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 212  JNIEXPORT jstring JNICALL Java_java_lang Line 212  JNIEXPORT jstring JNICALL Java_java_lang
212   * Signature: (Ljava/lang/String;)D   * Signature: (Ljava/lang/String;)D
213   */   */
214  JNIEXPORT jdouble JNICALL Java_java_lang_Double_parseDouble  JNIEXPORT jdouble JNICALL Java_java_lang_Double_parseDouble
215    (JNIEnv * env, jclass cls, jstring str)    (JNIEnv * env, jclass cls __attribute__((__unused__)), jstring str)
216  {  {
217    jboolean isCopy;    jboolean isCopy;
218    char *buf, *endptr;    const char *buf;
219      char *endptr;
220    jdouble val = 0.0;    jdouble val = 0.0;
221    
222    if (str == NULL)    if (str == NULL)
# Line 231  JNIEXPORT jdouble JNICALL Java_java_lang Line 232  JNIEXPORT jdouble JNICALL Java_java_lang
232      }      }
233    else    else
234      {      {
235        unsigned char *p = buf, *end, *last_non_ws;        const char *p = buf, *end, *last_non_ws, *temp;
236        int ok = 1;        int ok = 1;
237    
238  #ifdef DEBUG  #ifdef DEBUG
# Line 263  JNIEXPORT jdouble JNICALL Java_java_lang Line 264  JNIEXPORT jdouble JNICALL Java_java_lang
264          }          }
265    
266        /* Check for infinity and NaN */        /* Check for infinity and NaN */
267        unsigned char *temp = p;        temp = p;
268        if(temp[0] == '+' || temp[0] == '-')        if(temp[0] == '+' || temp[0] == '-')
269          temp++;          temp++;
270        if(strncmp("Infinity", temp, (size_t) 8) == 0)        if(strncmp("Infinity", temp, (size_t) 8) == 0)
# Line 300  JNIEXPORT jdouble JNICALL Java_java_lang Line 301  JNIEXPORT jdouble JNICALL Java_java_lang
301            fprintf (stderr, "java.lang.Double.parseDouble %i != %i ???\n",            fprintf (stderr, "java.lang.Double.parseDouble %i != %i ???\n",
302                     endptr, last_non_ws);                     endptr, last_non_ws);
303  #endif  #endif
304            if ((unsigned char *) endptr != last_non_ws)            if (endptr != last_non_ws)
305              ok = 0;              ok = 0;
306          }          }
307        else        else

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

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