Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(498)

Unified Diff: runtime/tools/create_archive.py

Issue 1411543006: Tweak create_archive.py to output the data as const char instead of const uint8_t (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/tools/create_archive.py
diff --git a/runtime/tools/create_archive.py b/runtime/tools/create_archive.py
index 8a5f2a3f9eeb679d4a2ff25164fefa9742b65d13..711d8ccaa1e69a2f06115f7b28ce6ce389d8e379 100644
--- a/runtime/tools/create_archive.py
+++ b/runtime/tools/create_archive.py
@@ -56,7 +56,7 @@ typedef unsigned __int8 uint8_t;
cc_text += 'namespace %s {\n' % inner_namespace
cc_text += '\n\n'
# Write the archive.
- cc_text += 'static const uint8_t %s_[] = {\n ' % name
+ cc_text += 'static const char %s_[] = {\n ' % name
Ivan Posva 2015/10/28 20:14:51 As discussed let's change this back to uint8_t but
lineCounter = 0
for byte in tar_archive:
cc_text += r" '\x%02x'," % ord(byte)
@@ -68,7 +68,8 @@ typedef unsigned __int8 uint8_t;
cc_text += '\n '
cc_text += '};\n'
cc_text += '\nunsigned int %s_len = %d;\n' % (name, len(tar_archive))
- cc_text += '\nconst uint8_t* %s = %s_;\n' % (name, name)
+ cc_text += '\nconst uint8_t* %s = ' % name
+ cc_text += 'reinterpret_cast<const uint8_t*>(&%s_[0]);\n' % name
if inner_namespace != None:
cc_text += '} // namespace %s\n' % inner_namespace
cc_text += '} // namespace %s\n' % outer_namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698