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

Unified Diff: utils/archive/messaging.c

Issue 10824210: Fix the archive code so that it compiles in a stricter mode. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Small fixes Created 8 years, 4 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 | « utils/archive/messaging.h ('k') | utils/archive/options.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/archive/messaging.c
diff --git a/utils/archive/messaging.c b/utils/archive/messaging.c
index 0c1a06455bc519761a70d8c5759d60b12737532a..bfe23a41791c74863cb351a0d6fa12f0d0917397 100644
--- a/utils/archive/messaging.c
+++ b/utils/archive/messaging.c
@@ -56,6 +56,7 @@ bool checkError(Dart_Port p, struct archive* a, int result) {
// TODO(nweiz): What should we do about non-fatal warnings?
if (result == ARCHIVE_WARN) return false;
postError(p, a);
+ return true;
}
bool checkPointerError(Dart_Port p, void* pointer, char* name) {
@@ -120,6 +121,7 @@ int64_t getInteger(Dart_CObject* object) {
assert(object->type == kInt64 || object->type == kInt32);
if (object->type == kInt64) return object->value.as_int64;
if (object->type == kInt32) return (int64_t) object->value.as_int32;
+ return 0; // Should never reach this point.
}
Dart_CObject* getNullableStringArgument(Dart_Port p, Dart_CObject* request,
@@ -138,3 +140,23 @@ char* getNullableString(Dart_CObject* object) {
if (object->type == kString) return object->value.as_string;
return NULL;
}
+
+bool getOptionArguments(Dart_Port p, Dart_CObject* request, char** module,
+ char** name, char** value) {
+ *module = *name = *value = NULL;
+
+ Dart_CObject* wrappedModule = getNullableStringArgument(p, request, 0);
+ if (wrappedModule == NULL) return false;
+ *module = getNullableString(wrappedModule);
+
+ Dart_CObject* wrappedName = getTypedArgument(p, request, 0, kString);
+ if (wrappedName == NULL) return false;
+ *name = wrappedName->value.as_string;
+
+ Dart_CObject* wrappedValue = getNullableStringArgument(p, request, 0);
+ if (wrappedValue == NULL) return false;
+ *value = getNullableString(wrappedValue);
+
+ return true;
+}
+
« no previous file with comments | « utils/archive/messaging.h ('k') | utils/archive/options.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698