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

Side by Side Diff: gdb/nacl-manifest.c

Issue 10458028: Fix style issues. (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@nacl-stub
Patch Set: Created 8 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | gdb/nacl-tdep.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* Handle Native Client manifest files. 1 /* Handle Native Client manifest files.
2 2
3 Copyright (C) 2011 Free Software Foundation, Inc. 3 Copyright (C) 2011 Free Software Foundation, Inc.
4 4
5 This file is part of GDB. 5 This file is part of GDB.
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or 9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 nacl_program_filename_32 = NULL; 122 nacl_program_filename_32 = NULL;
123 nacl_program_filename_64 = NULL; 123 nacl_program_filename_64 = NULL;
124 } 124 }
125 125
126 /* Very dumb parser for JSON subset used in Native Client manifest files. 126 /* Very dumb parser for JSON subset used in Native Client manifest files.
127 This is a SAX-style parser that runs callbacks on JSON events. */ 127 This is a SAX-style parser that runs callbacks on JSON events. */
128 128
129 struct json_manifest_reader 129 struct json_manifest_reader
130 { 130 {
131 /* Manifest file. */ 131 /* Manifest file. */
132 FILE* file; 132 FILE *file;
133 133
134 /* Stack of members being parsed. */ 134 /* Stack of members being parsed. */
135 const char *members[MANIFEST_MAX_NESTING]; 135 const char *members[MANIFEST_MAX_NESTING];
136 136
137 /* Members stack size. */ 137 /* Members stack size. */
138 int nesting; 138 int nesting;
139 139
140 /* Manifest file directory without slash at the end. */ 140 /* Manifest file directory without slash at the end. */
141 char* dirname; 141 char *dirname;
142 }; 142 };
143 143
144 static void 144 static void
145 json_on_member (struct json_manifest_reader *r, const char *member) 145 json_on_member (struct json_manifest_reader *r, const char *member)
146 { 146 {
147 if (r->nesting == MANIFEST_MAX_NESTING) 147 if (r->nesting == MANIFEST_MAX_NESTING)
148 error (_("Invalid manifest file.")); 148 error (_("Invalid manifest file."));
149 149
150 r->members[r->nesting] = member; 150 r->members[r->nesting] = member;
151 ++r->nesting; 151 ++r->nesting;
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 327
328 solib_add (NULL, from_tty, NULL, 1); 328 solib_add (NULL, from_tty, NULL, 1);
329 } 329 }
330 } 330 }
331 331
332 static void 332 static void
333 nacl_manifest_command (char *args, int from_tty) 333 nacl_manifest_command (char *args, int from_tty)
334 { 334 {
335 if (args) 335 if (args)
336 { 336 {
337 char* manifest_filename; 337 char *manifest_filename;
338 struct cleanup *old_chain; 338 struct cleanup *old_chain;
339 struct json_manifest_reader r = { 0 }; 339 struct json_manifest_reader r = { 0 };
340 340
341 manifest_filename = tilde_expand (args); 341 manifest_filename = tilde_expand (args);
342 old_chain = make_cleanup (xfree, manifest_filename); 342 old_chain = make_cleanup (xfree, manifest_filename);
343 343
344 r.file = fopen (manifest_filename, "r"); 344 r.file = fopen (manifest_filename, "r");
345 if (!r.file) 345 if (!r.file)
346 perror_with_name (manifest_filename); 346 perror_with_name (manifest_filename);
347 make_cleanup_fclose (r.file); 347 make_cleanup_fclose (r.file);
(...skipping 18 matching lines...) Expand all
366 366
367 c = add_com ("nacl-irt", class_files, nacl_irt_command, 367 c = add_com ("nacl-irt", class_files, nacl_irt_command,
368 _("Use FILE as Native Client IRT to be debugged.")); 368 _("Use FILE as Native Client IRT to be debugged."));
369 set_cmd_completer (c, filename_completer); 369 set_cmd_completer (c, filename_completer);
370 370
371 c = add_com ("nacl-manifest", class_files, nacl_manifest_command, 371 c = add_com ("nacl-manifest", class_files, nacl_manifest_command,
372 _("Use FILE as Native Client manifest for the program" 372 _("Use FILE as Native Client manifest for the program"
373 " to be debugged.")); 373 " to be debugged."));
374 set_cmd_completer (c, filename_completer); 374 set_cmd_completer (c, filename_completer);
375 } 375 }
OLDNEW
« no previous file with comments | « no previous file | gdb/nacl-tdep.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698