From 31a382080d861bfb72d24f186d1cc1b2c07b2df4 Mon Sep 17 00:00:00 2001 From: nicola Date: Thu, 7 Oct 2010 18:37:43 +0000 Subject: [PATCH] In gcc/: 2010-10-07 Nicola Pero * doc/objc.texi (Fast enumeration protocol): Mention that 'unsigned int' can also be used instead of 'unsigned long' in countByEnumeratingWithState:objects:count:. In gcc/objc/: 2010-10-07 Nicola Pero PR objc/45925 * objc-act.c (objc_finish_foreach_loop): Convert return value of countByEnumeratingWithState:objects:count: to long unsigned int. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165129 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/doc/objc.texi | 5 +++++ gcc/objc/ChangeLog | 6 ++++++ gcc/objc/objc-act.c | 6 ++++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 479b616..1761036 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2010-10-07 Nicola Pero + + * doc/objc.texi (Fast enumeration protocol): Mention that + 'unsigned int' can also be used instead of 'unsigned long' in + countByEnumeratingWithState:objects:count:. + 2010-10-07 Martin Jambor * tree-sra.c (struct access): New field grp_assignment_write. diff --git a/gcc/doc/objc.texi b/gcc/doc/objc.texi index 2bb80d1..87c985d 100644 --- a/gcc/doc/objc.texi +++ b/gcc/doc/objc.texi @@ -955,3 +955,8 @@ object is added or removed). Or, if you are content with less strict mutation checks, it could point to the number of objects in your collection or some other value that can be checked to perform an approximate check that the collection has not been mutated. + +Finally, note how we declared the @code{len} argument and the return +value to be of type @code{unsigned long}. They could also be declared +to be of type @code{unsigned int} and everything would still work. + diff --git a/gcc/objc/ChangeLog b/gcc/objc/ChangeLog index 9109229..6a69bd9 100644 --- a/gcc/objc/ChangeLog +++ b/gcc/objc/ChangeLog @@ -1,3 +1,9 @@ +2010-10-07 Nicola Pero + + PR objc/45925 + * objc-act.c (objc_finish_foreach_loop): Convert return value of + countByEnumeratingWithState:objects:count: to long unsigned int. + 2010-10-07 Iain Sandoe * objc-act.c (build_objc_method_call): Replace calls to diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c index 09fd3be..3a13519 100644 --- a/gcc/objc/objc-act.c +++ b/gcc/objc/objc-act.c @@ -10335,7 +10335,8 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll (NULL_TREE, build_int_cst (NULL_TREE, 16), NULL_TREE)))); } #endif - t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl, t); + t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl, + convert (long_unsigned_type_node, t)); SET_EXPR_LOCATION (t, location); append_to_statement_list (t, &BIND_EXPR_BODY (bind)); @@ -10508,7 +10509,8 @@ objc_finish_foreach_loop (location_t location, tree object_expression, tree coll (NULL_TREE, build_int_cst (NULL_TREE, 16), NULL_TREE)))); } #endif - t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl, t); + t = build2 (MODIFY_EXPR, void_type_node, objc_foreach_batchsize_decl, + convert (long_unsigned_type_node, t)); SET_EXPR_LOCATION (t, location); append_to_statement_list (t, &BIND_EXPR_BODY (next_batch_bind)); -- 2.7.4