Skip to content

Commit

Permalink
Fixing prior buid failure
Browse files Browse the repository at this point in the history
  • Loading branch information
samiura committed Jul 13, 2023
1 parent dd144f4 commit ea661ab
Showing 1 changed file with 23 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

package io.opentelemetry.render.extensions;

import com.google.common.base.Objects;
import io.opentelemetry.render.render.FieldType;
import io.opentelemetry.render.render.FieldTypeEnum;

Expand Down Expand Up @@ -53,14 +54,20 @@ public static String cType(final FieldType fieldType, final boolean packedString
}

public static CharSequence cType(final FieldType type, final int arraySize) {
String expression =
type.isIsShortString()
? "short_string<" + type.getSize() + ">"
: type.getEnum_type().getLiteral();
final String nonArrayType = expression;
CharSequence blockExpression =
arraySize >= 0 ? "std::array<" + nonArrayType + "," + arraySize + ">" : nonArrayType;
return blockExpression;
String expression = null;
boolean shortString = type.isIsShortString();
if (shortString) {
expression = "short_string<" + type.getSize() + ">";
} else {
expression = type.getEnum_type().getLiteral();
}
CharSequence finalExpression = null;
if (arraySize >= 0) {
finalExpression = "std::array<" + expression + "," + arraySize + ">";
} else {
finalExpression = expression;
}
return finalExpression;
}

public static String wireCType(final FieldType fieldType) {
Expand All @@ -73,7 +80,8 @@ public static String parsedCType(final FieldType fieldType) {

public static int size(final FieldType fieldType, final boolean packedStrings) {
int expression;
if (fieldType.isIsShortString()) {
boolean shortString = fieldType.isIsShortString();
if (shortString) {
expression = fieldType.getSize();
} else {
int switchResult = (int) 0;
Expand Down Expand Up @@ -111,7 +119,7 @@ public static int size(final FieldType fieldType, final boolean packedStrings) {
switchResult = 16;
break;
case STRING:
switchResult = packedStrings ? 2 : 8;
switchResult = packedStrings ? 2:16;
break;
default:
break;
Expand All @@ -132,7 +140,8 @@ public static int parsedSize(final FieldType fieldType) {

public static int alignment(final FieldType fieldType, final boolean packedStrings) {
int expression;
if (fieldType.isIsShortString()) {
boolean shortString = fieldType.isIsShortString();
if (shortString) {
expression = 1;
} else {
int switchResult = (int) 0;
Expand Down Expand Up @@ -170,7 +179,7 @@ public static int alignment(final FieldType fieldType, final boolean packedStrin
switchResult = 16;
break;
case STRING:
switchResult = packedStrings ? 2 : 8;
switchResult = packedStrings ? 2: 8;
break;
}
}
Expand All @@ -188,6 +197,6 @@ public static int parsedAlignment(final FieldType fieldType) {
}

public static boolean isInt(final FieldType fieldType) {
return !fieldType.isIsShortString() && (fieldType.getEnum_type() == FieldTypeEnum.STRING);
return ((!fieldType.isIsShortString()) && (fieldType.getEnum_type() == FieldTypeEnum.STRING));
}
}
}

0 comments on commit ea661ab

Please sign in to comment.