Cleaned up strtoarr.py

This commit is contained in:
A.M. Rowsell 2019-04-15 23:40:34 -04:00
commit 54ec66b345
Signed by: amr
GPG key ID: 0B6E2D8375CF79A9

View file

@ -3,7 +3,7 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#!/usr/bin/python3
##
# @file
# @brief File to create string arrays
@ -19,7 +19,7 @@
import sys
import os
inString = str(sys.argv[1]);
inString = str(sys.argv[1])
print("static const char {0}[{1}] = {{ ".format(sys.argv[2], len(inString)), end='')
for letter in inString[:-1]:
@ -27,6 +27,5 @@ for letter in inString[:-1]:
print("{0:#x}, ".format(p), end='')
p = ord(inString[-1])
print("{0:#x} ".format(int(p)), end='')
print("}; // " + inString)
print("static const uint8_t {0}_len = {1};".format(sys.argv[2], len(inString)))
print("{0:#x} ".format(int(p)) + "}; // " + inString)
print("static const uint8_t {0}_len = {1};".format(sys.argv[2], len(inString)))