This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
+jint java::io::BufferedReader::lineEnd (jint limit) +{ + jchar *pbuf = elements (buffer) + pos; + int i = pos; + for (; i < limit; i++) + { + jchar ch = *pbuf++; + if (ch == '\n' || ch == '\r') + break; + } + return i; +}
By changing the above native code to this:
jint java::io::BufferedReader::lineEnd (jint limit) { jchar *pbuf = elements (buffer); int i = pos; for (; i < limit; i++) { jchar ch = pbuf[i]; if (ch == '\n' || ch == '\r') break; } return i; }
jint java::io::BufferedReader::lineEnd (jint limit)
{
jchar *pbuf = elements (buffer) + pos;
int i = 0;
limit -= pos;
for (; i < limit; i++)
{
jchar ch = pbuf[i];
if (ch == '\n' || ch == '\r')
break;
}
return i+pos;
}Thanks, Andrew Pinski
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |