Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use boolean conditions in while statements for mac osx #2299

Merged
merged 1 commit into from
Jun 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 23 additions & 26 deletions runtime/cfdumper/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ static void dumpAttribute(J9CfrClassFile* classfile, J9CfrAttribute* attrib, U_3
#endif /* J9VM_OPT_VALHALLA_NESTMATES */

case CFR_ATTRIBUTE_LineNumberTable:
(J9CfrAttributeLineNumberTable*)attrib;
for(i = 0; i < ((J9CfrAttributeLineNumberTable*)attrib)->lineNumberTableLength; i++)
{
for(j = 0; j < tabLevel + 1; j++) j9tty_printf( PORTLIB, " ");
Expand All @@ -692,7 +691,6 @@ static void dumpAttribute(J9CfrClassFile* classfile, J9CfrAttribute* attrib, U_3
break;

case CFR_ATTRIBUTE_LocalVariableTable:
(J9CfrAttributeLocalVariableTable*)attrib;
for(i = 0; i < ((J9CfrAttributeLocalVariableTable*)attrib)->localVariableTableLength; i++)
{
index = ((J9CfrAttributeLocalVariableTable*)attrib)->localVariableTable[i].nameIndex;
Expand All @@ -712,7 +710,6 @@ static void dumpAttribute(J9CfrClassFile* classfile, J9CfrAttribute* attrib, U_3
break;

case CFR_ATTRIBUTE_LocalVariableTypeTable:
(J9CfrAttributeLocalVariableTypeTable*)attrib;
for(i = 0; i < ((J9CfrAttributeLocalVariableTypeTable*)attrib)->localVariableTypeTableLength; i++)
{
index = ((J9CfrAttributeLocalVariableTypeTable*)attrib)->localVariableTypeTable[i].nameIndex;
Expand Down Expand Up @@ -2395,7 +2392,7 @@ static I_32 processAllFiles(char** files, U_32 flags)
PORT_ACCESS_FROM_PORT(portLib);

i = 0;
while(currentFile = files[i++])
while(NULL != (currentFile = files[i++]))
{
if(j9file_attr(currentFile) == EsIsDir)
{
Expand Down Expand Up @@ -3255,17 +3252,17 @@ static void sun_formatBytecode(J9CfrClassFile* classfile, J9CfrMethod* method, B
string = classfile->constantPool[cpIndex].bytes;
j = 0;
index = 0;
while(ch2 = string[j++]) if(ch2 == '/') index = j;
while('\0' != (ch2 = string[j++])) if(ch2 == '/') index = j;
j = index;
while(ch2 = string[j++]) j9tty_output_char(ch2);
while('\0' != (ch2 = string[j++])) j9tty_output_char(ch2);
break;

case 'C':
/* qualified class name */
cpIndex = classfile->constantPool[classfile->thisClass].slot1;
string = classfile->constantPool[cpIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand All @@ -3282,7 +3279,7 @@ static void sun_formatBytecode(J9CfrClassFile* classfile, J9CfrMethod* method, B
/* method signature */
string = classfile->constantPool[method->descriptorIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand Down Expand Up @@ -3546,7 +3543,7 @@ static void sun_formatBytecode(J9CfrClassFile* classfile, J9CfrMethod* method, B
case CFR_CONSTANT_Class:
string = classfile->constantPool[info->slot1].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand All @@ -3559,7 +3556,7 @@ static void sun_formatBytecode(J9CfrClassFile* classfile, J9CfrMethod* method, B
cpIndex = classfile->constantPool[info->slot1].slot1;
string = classfile->constantPool[cpIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand All @@ -3570,7 +3567,7 @@ static void sun_formatBytecode(J9CfrClassFile* classfile, J9CfrMethod* method, B
cpIndex = classfile->constantPool[info->slot2].slot2;
string = classfile->constantPool[cpIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand Down Expand Up @@ -4128,7 +4125,7 @@ static void sun_formatClass(J9CfrClassFile* classfile, char *formatString, IDATA
string = classfile->constantPool[cpIndex].bytes;
j = 0;
index = 0;
while(ch2 = string[j++]) if(ch2 == '/') index = j - 1;
while('\0' != (ch2 = string[j++])) if(ch2 == '/') index = j - 1;
j = 0;
while(j < index)
{
Expand All @@ -4144,17 +4141,17 @@ static void sun_formatClass(J9CfrClassFile* classfile, char *formatString, IDATA
string = classfile->constantPool[cpIndex].bytes;
j = 0;
index = 0;
while(ch2 = string[j++]) if(ch2 == '/') index = j;
while('\0' != (ch2 = string[j++])) if(ch2 == '/') index = j;
j = index;
while(ch2 = string[j++]) j9tty_output_char(ch2);
while('\0' != (ch2 = string[j++])) j9tty_output_char(ch2);
break;

case 'C':
/* qualified class name */
cpIndex = classfile->constantPool[classfile->thisClass].slot1;
string = classfile->constantPool[cpIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand All @@ -4168,7 +4165,7 @@ static void sun_formatClass(J9CfrClassFile* classfile, char *formatString, IDATA
cpIndex = classfile->constantPool[classfile->superClass].slot1;
string = classfile->constantPool[cpIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand All @@ -4184,7 +4181,7 @@ static void sun_formatClass(J9CfrClassFile* classfile, char *formatString, IDATA
cpIndex = classfile->constantPool[cpIndex].slot1;
string = classfile->constantPool[cpIndex].bytes;
k = 0;
while(ch2 = string[k++])
while('\0' != (ch2 = string[k++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand Down Expand Up @@ -4312,17 +4309,17 @@ static void sun_formatField(J9CfrClassFile* classfile, J9CfrField* field, char *
string = classfile->constantPool[cpIndex].bytes;
j = 0;
index = 0;
while(ch2 = string[j++]) if(ch2 == '/') index = j;
while('\0' != (ch2 = string[j++])) if(ch2 == '/') index = j;
j = index;
while(ch2 = string[j++]) j9tty_output_char(ch2);
while('\0' != (ch2 = string[j++])) j9tty_output_char(ch2);
break;

case 'C':
/* qualified class name */
cpIndex = classfile->constantPool[classfile->thisClass].slot1;
string = classfile->constantPool[cpIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand All @@ -4339,7 +4336,7 @@ static void sun_formatField(J9CfrClassFile* classfile, J9CfrField* field, char *
/* type signature */
string = classfile->constantPool[field->descriptorIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand Down Expand Up @@ -4558,17 +4555,17 @@ static void sun_formatMethod(J9CfrClassFile* classfile, J9CfrMethod* method, cha
string = classfile->constantPool[cpIndex].bytes;
j = 0;
index = 0;
while(ch2 = string[j++]) if(ch2 == '/') index = j;
while('\0' != (ch2 = string[j++])) if(ch2 == '/') index = j;
j = index;
while(ch2 = string[j++]) j9tty_output_char(ch2);
while('\0' != (ch2 = string[j++])) j9tty_output_char(ch2);
break;

case 'C':
/* qualified class name */
cpIndex = classfile->constantPool[classfile->thisClass].slot1;
string = classfile->constantPool[cpIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand All @@ -4585,7 +4582,7 @@ static void sun_formatMethod(J9CfrClassFile* classfile, J9CfrMethod* method, cha
/* method signature */
string = classfile->constantPool[method->descriptorIndex].bytes;
j = 0;
while(ch2 = string[j++])
while('\0' != (ch2 = string[j++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand Down Expand Up @@ -4728,7 +4725,7 @@ static void sun_formatMethod(J9CfrClassFile* classfile, J9CfrMethod* method, cha
index = classfile->constantPool[exceptions->exceptionIndexTable[j]].slot1;
string = classfile->constantPool[index].bytes;
k = 0;
while(ch2 = string[k++])
while('\0' != (ch2 = string[k++]))
{
if(ch2 == '/') j9tty_output_char('.');
else j9tty_output_char(ch2);
Expand Down