Skip to content

Commit b7b9361

Browse files
committed
Fix Warnings.
1 parent 890ba44 commit b7b9361

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

csharp/sbe-dll/sbe-tool.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ ROOTDIR=`dirname $0`
44
SBE_JAR=$ROOTDIR/sbe-tool-all.jar
55

66

7-
[ -f $SBE_JAR ] || (echo "Missing $SBE_JAR"; exit 1)
7+
[ -f "$SBE_JAR" ] || (echo "Missing $SBE_JAR"; exit 1)
88

99
function usage {
10-
echo usage: `basename $0` [-d output_dir] -s schema
10+
echo usage: $(basename "$0") [-d output_dir] -s schema
1111
}
1212

1313
# defaults
@@ -22,7 +22,7 @@ while getopts "d:s:" OPT "$@"; do
2222
SCHEMA=$OPTARG
2323
;;
2424
*)
25-
echo $OPT
25+
echo "$OPT"
2626
usage
2727
exit 1
2828
;;
@@ -31,12 +31,12 @@ done
3131
shift $(($OPTIND - 1))
3232

3333
# Check args
34-
if [ -z $SCHEMA ]; then usage; exit 1; fi
35-
if [ ! -f $SCHEMA ]; then echo no schema at $SCHEMA; exit 1; fi
34+
if [ -z "$SCHEMA" ]; then usage; exit 1; fi
35+
if [ ! -f "$SCHEMA" ]; then echo no schema at "$SCHEMA"; exit 1; fi
3636

3737
java \
38-
-Dsbe.output.dir=$OUTPUTDIR \
38+
-Dsbe.output.dir="$OUTPUTDIR" \
3939
-Dsbe.generate.ir="false" \
4040
-Dsbe.target.language="uk.co.real_logic.sbe.generation.csharp.CSharp" \
41-
-jar $SBE_JAR \
42-
$SCHEMA
41+
-jar "$SBE_JAR" \
42+
"$SCHEMA"

gocode/sbe-tool

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#! /usr/bin/env bash
22

3-
ROOTDIR=`dirname $0`/..
4-
SBE_TOOL_VERSION=`cat $ROOTDIR/version.txt`
3+
ROOTDIR=$(dirname "$0")/..
4+
SBE_TOOL_VERSION=$(cat "$ROOTDIR"/version.txt)
55
SBE_JAR=$ROOTDIR/sbe-all/build/libs/sbe-all-$SBE_TOOL_VERSION.jar
66

77
[ -f $SBE_JAR ] || (echo "Missing $SBE_JAR. Run gradle first"; exit 1)
88

99
function usage {
10-
echo usage: `basename $0` [-d output_dir] -s schema
10+
echo usage: $(basename "$0") [-d output_dir] -s schema
1111
}
1212

1313
# defaults
@@ -22,7 +22,7 @@ while getopts "d:s:" OPT "$@"; do
2222
SCHEMA=$OPTARG
2323
;;
2424
*)
25-
echo $OPT
25+
echo "$OPT"
2626
usage
2727
exit 1
2828
;;
@@ -31,12 +31,12 @@ done
3131
shift $(($OPTIND - 1))
3232

3333
# Check args
34-
[ -z $SCHEMA ] && (usage; exit 1)
35-
[ -f $SCHEMA ] || (echo invalid schema $SCHEMA; exit 1)
34+
[ -z "$SCHEMA" ] && (usage; exit 1)
35+
[ -f "$SCHEMA" ] || (echo invalid schema "$SCHEMA"; exit 1)
3636

3737
java \
38-
-Dsbe.output.dir=$OUTPUTDIR \
38+
-Dsbe.output.dir="$OUTPUTDIR" \
3939
-Dsbe.generate.ir="false" \
4040
-Dsbe.target.language="golang" \
41-
-jar $SBE_JAR \
42-
$SCHEMA
41+
-jar "$SBE_JAR" \
42+
"$SCHEMA"

sbe-tool/src/main/java/uk/co/real_logic/sbe/xml/SetType.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public Choice(final Node node, final PrimitiveType encodingType)
221221
deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0"));
222222

223223
// choice values are bit positions (0, 1, 2, 3, 4, etc.) from LSB to MSB
224-
if (value.longValue() >= (encodingType.size() * 8))
224+
if (value.longValue() >= (encodingType.size() * 8L))
225225
{
226226
throw new IllegalArgumentException("Choice value out of bounds: " + value.longValue());
227227
}

0 commit comments

Comments
 (0)