Skip to content

Commit

Permalink
Fix Warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
mjpt777 committed Jan 14, 2021
1 parent 890ba44 commit b7b9361
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
16 changes: 8 additions & 8 deletions csharp/sbe-dll/sbe-tool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ ROOTDIR=`dirname $0`
SBE_JAR=$ROOTDIR/sbe-tool-all.jar


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

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

# defaults
Expand All @@ -22,7 +22,7 @@ while getopts "d:s:" OPT "$@"; do
SCHEMA=$OPTARG
;;
*)
echo $OPT
echo "$OPT"
usage
exit 1
;;
Expand All @@ -31,12 +31,12 @@ done
shift $(($OPTIND - 1))

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

java \
-Dsbe.output.dir=$OUTPUTDIR \
-Dsbe.output.dir="$OUTPUTDIR" \
-Dsbe.generate.ir="false" \
-Dsbe.target.language="uk.co.real_logic.sbe.generation.csharp.CSharp" \
-jar $SBE_JAR \
$SCHEMA
-jar "$SBE_JAR" \
"$SCHEMA"
18 changes: 9 additions & 9 deletions gocode/sbe-tool
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#! /usr/bin/env bash

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

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

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

# defaults
Expand All @@ -22,7 +22,7 @@ while getopts "d:s:" OPT "$@"; do
SCHEMA=$OPTARG
;;
*)
echo $OPT
echo "$OPT"
usage
exit 1
;;
Expand All @@ -31,12 +31,12 @@ done
shift $(($OPTIND - 1))

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

java \
-Dsbe.output.dir=$OUTPUTDIR \
-Dsbe.output.dir="$OUTPUTDIR" \
-Dsbe.generate.ir="false" \
-Dsbe.target.language="golang" \
-jar $SBE_JAR \
$SCHEMA
-jar "$SBE_JAR" \
"$SCHEMA"
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ public Choice(final Node node, final PrimitiveType encodingType)
deprecated = Integer.parseInt(getAttributeValue(node, "deprecated", "0"));

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

0 comments on commit b7b9361

Please sign in to comment.