From 0beb31d5cd50733c3c6314568368bbb8eed908d9 Mon Sep 17 00:00:00 2001 From: regehr Date: Tue, 12 Feb 2008 21:16:00 +0000 Subject: [PATCH 1/1] annotation work --- tos/lib/safe/include/deputy_no_annots.h | 4 ++-- tos/lib/safe/include/nesc_annots.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tos/lib/safe/include/deputy_no_annots.h b/tos/lib/safe/include/deputy_no_annots.h index 0a6fb975..c3adeade 100644 --- a/tos/lib/safe/include/deputy_no_annots.h +++ b/tos/lib/safe/include/deputy_no_annots.h @@ -1,9 +1,9 @@ #define __DEPUTY_BOUND(__lo,__hi) #define __DEPUTY_COUNT(__n) #define __DEPUTY_SINGLE(__n) -#define __DEPUTY_TRUSTED_CAST(__type,__expr) +#define __DEPUTY_TRUSTED_CAST(__type,__expr) ((__type)(__expr)) -#define TC(__type,__expr) +#define TC(__type,__expr) __DEPUTY_TRUSTED_CAST(__type,__expr) #define __DEPUTY_NONNULL #define __DEPUTY_TRUSTED diff --git a/tos/lib/safe/include/nesc_annots.h b/tos/lib/safe/include/nesc_annots.h index f0cc00cf..5b4220de 100644 --- a/tos/lib/safe/include/nesc_annots.h +++ b/tos/lib/safe/include/nesc_annots.h @@ -1,3 +1,4 @@ struct @bound @deputy_scope() @macro("__DEPUTY_BOUND") { void *lo, *hi; }; struct @count @deputy_scope() @macro("__DEPUTY_COUNT") { int n; }; struct @single @deputy_scope() @macro("__DEPUTY_SINGLE") { }; +struct @nonnull @deputy_scope() @macro("__DEPUTY_NONNULL") { }; -- 2.39.2