[Sumover-dev] [svn commit] r4494 - in vic/branches/cc/cc: .
sumover-dev at cs.ucl.ac.uk
sumover-dev at cs.ucl.ac.uk
Mon Jul 27 16:19:14 BST 2009
Author: soohyunc
Date: Mon Jul 27 16:19:12 2009
New Revision: 4494
Modified:
vic/branches/cc/cc/bitmap.h
vic/branches/cc/cc/test/Makefile
vic/branches/cc/cc/test/bitvec.h
Log:
o corrected wrong comments in bitmap.h
o re-writing unit test code for Tfwc sender/receiver modules (work-in-progress)
Modified: vic/branches/cc/cc/bitmap.h
==============================================================================
--- vic/branches/cc/cc/bitmap.h (original)
+++ vic/branches/cc/cc/bitmap.h Mon Jul 27 16:19:12 2009
@@ -57,7 +57,7 @@
// set bit at i-th location
#define SET_BIT_AT(bitmap, i) ( bitmap |= 1 << (i-1) )
-// set bit at i-th location
+// clear bit at i-th location
#define CLR_BIT_AT(bitmap, i) ( bitmap &= ~(1 << (i-1)) )
#endif /* vic_cc_bitmap_h */
Modified: vic/branches/cc/cc/test/Makefile
==============================================================================
--- vic/branches/cc/cc/test/Makefile (original)
+++ vic/branches/cc/cc/test/Makefile Mon Jul 27 16:19:12 2009
@@ -27,6 +27,7 @@
clean:
@echo "Start cleaning..."
$(RM) $(OBJS)
+ $(RM) $(APP)
$(RM) *.*~
# delete object files, temporary files, and executable file
Modified: vic/branches/cc/cc/test/bitvec.h
==============================================================================
--- vic/branches/cc/cc/test/bitvec.h (original)
+++ vic/branches/cc/cc/test/bitvec.h Mon Jul 27 16:19:12 2009
@@ -15,10 +15,10 @@
#define CTB 0x01 // ackvec check bit (tail search)
// set AckVec bitmap from LSB
-#define SET_BIT_VEC(map, bit) (map = ((map << 1) | bit))
+#define SET_BIT_VEC(map, val) (map = ((map << 1) | val))
// AckVec bitmap at i-th location
-#define GET_BIT_VEC(map, i, seqno) ((1 << (seqno - i)) & map)
+#define GET_BIT_VEC(map, i, val) ((1 << (val - i)) & map)
// AckVec head search
#define GET_HEAD_VEC(map, i) ( map & (CHB >> i) )
@@ -29,6 +29,12 @@
// check bit at i-th location
#define CHECK_BIT_AT(map, i) ( map & (1 << (i-1)) )
+// set bit at i-th location
+#define SET_BIT_AT(map, i) ( map |= 1 << (i-1) )
+
+// clear bit at i-th location
+#define CLR_BIT_AT(map, i) ( map &= ~(1 << (i-1)) )
+
// functions
int bitvec();
int get_head_pos (int vec);
More information about the Sumover-dev
mailing list