[Nagios-checkins] SF.net SVN: nagios:[2091] nagioscore/trunk/lib

ageric at users.sourceforge.net ageric at users.sourceforge.net
Sun Aug 26 20:00:26 UTC 2012


Revision: 2091
          http://nagios.svn.sourceforge.net/nagios/?rev=2091&view=rev
Author:   ageric
Date:     2012-08-26 20:00:26 +0000 (Sun, 26 Aug 2012)
Log Message:
-----------
lib/bitmap: Add the missing bitmap_clear() function

And fix up some comments while we're at it.

Signed-off-by: Andreas Ericsson <ae at op5.se>

Modified Paths:
--------------
    nagioscore/trunk/lib/bitmap.c
    nagioscore/trunk/lib/bitmap.h

Modified: nagioscore/trunk/lib/bitmap.c
===================================================================
--- nagioscore/trunk/lib/bitmap.c	2012-08-26 19:59:49 UTC (rev 2090)
+++ nagioscore/trunk/lib/bitmap.c	2012-08-26 20:00:26 UTC (rev 2091)
@@ -19,6 +19,12 @@
 	unsigned long alloc;
 };
 
+void bitmap_clear(bitmap *bm)
+{
+	if (bm)
+		memset(bm->vector, 0, bm->alloc * sizeof(bmap));
+}
+
 int bitmap_resize(bitmap *bm, unsigned long size)
 {
 	unsigned long ralloc;

Modified: nagioscore/trunk/lib/bitmap.h
===================================================================
--- nagioscore/trunk/lib/bitmap.h	2012-08-26 19:59:49 UTC (rev 2090)
+++ nagioscore/trunk/lib/bitmap.h	2012-08-26 20:00:26 UTC (rev 2091)
@@ -84,10 +84,10 @@
 extern unsigned long bitmap_count_unset_bits(const bitmap *bm);
 
 /**
- * Unset all bits in a bitmaptor
- * @param bm The bitmaptor to clear
+ * Unset all bits in a bitmap
+ * @param bm The bitmap to clear
  */
-extern bitmap *bitmap_clear(bitmap *bm);
+extern void bitmap_clear(bitmap *bm);
 
 /**
  * Calculate intersection of two bitmaps

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Nagios-commits mailing list