[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [59372] trunk/blender/source/blender/ blenlib: set nonnull args for BLI_qsort_r
Campbell Barton
ideasman42 at gmail.com
Wed Aug 21 22:45:52 CEST 2013
Revision: 59372
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=59372
Author: campbellbarton
Date: 2013-08-21 20:45:51 +0000 (Wed, 21 Aug 2013)
Log Message:
-----------
set nonnull args for BLI_qsort_r
Modified Paths:
--------------
trunk/blender/source/blender/blenlib/BLI_sort.h
trunk/blender/source/blender/blenlib/intern/sort.c
Modified: trunk/blender/source/blender/blenlib/BLI_sort.h
===================================================================
--- trunk/blender/source/blender/blenlib/BLI_sort.h 2013-08-21 20:21:42 UTC (rev 59371)
+++ trunk/blender/source/blender/blenlib/BLI_sort.h 2013-08-21 20:45:51 UTC (rev 59372)
@@ -36,6 +36,10 @@
/* Quick sort reentrant */
typedef int (*BLI_sort_cmp_t)(void *ctx, const void *a, const void *b);
-void BLI_qsort_r(void *a, size_t n, size_t es, void *thunk, BLI_sort_cmp_t cmp);
+void BLI_qsort_r(void *a, size_t n, size_t es, void *thunk, BLI_sort_cmp_t cmp)
+#ifdef __GNUC__
+__attribute__((nonnull(1, 5)))
+#endif
+;
#endif /* __BLI_SORT_H__ */
Modified: trunk/blender/source/blender/blenlib/intern/sort.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/sort.c 2013-08-21 20:21:42 UTC (rev 59371)
+++ trunk/blender/source/blender/blenlib/intern/sort.c 2013-08-21 20:45:51 UTC (rev 59372)
@@ -81,6 +81,11 @@
:(CMP(thunk, b, c) > 0 ? b : (CMP(thunk, a, c) < 0 ? a : c ));
}
+/**
+ * Quick sort reentrant.
+ *
+ * \note Follows BSD arg order (incompatible with glibc).
+ */
void BLI_qsort_r(void *a, size_t n, size_t es, void *thunk, BLI_sort_cmp_t cmp)
{
char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
More information about the Bf-blender-cvs
mailing list