[Tinyos-2-commits] CVS: tinyos-2.x/tos/lib/tossim hashtable.c, 1.4, 1.5 sim_noise.c, 1.5, 1.6

Phil Levis scipio at users.sourceforge.net
Tue Apr 10 17:56:31 PDT 2007


Update of /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv3569

Modified Files:
	hashtable.c sim_noise.c 
Log Message:
Cut out the debugging stuff.


Index: hashtable.c
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/hashtable.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** hashtable.c	10 Apr 2007 22:15:39 -0000	1.4
--- hashtable.c	11 Apr 2007 00:56:29 -0000	1.5
***************
*** 25,29 ****
  const float max_load_factor = 0.65;
  
! #define BAD_RECORD (0xc693748)
  
  /*****************************************************************************/
--- 25,29 ----
  const float max_load_factor = 0.65;
  
! 
  
  /*****************************************************************************/
***************
*** 136,143 ****
  
  /*****************************************************************************/
! int entered = 0;
! 
! int
! hashtable_insert(struct hashtable *h, void *k, void *v)
  {
      /* This method allows duplicate keys - but they shouldn't be used */
--- 136,140 ----
  
  /*****************************************************************************/
! int hashtable_insert(struct hashtable *h, void *k, void *v)
  {
      /* This method allows duplicate keys - but they shouldn't be used */
***************
*** 152,180 ****
          hashtable_expand(h);
      }
-     if (entered) {
-       struct entry* eTest = (struct entry*)BAD_RECORD;
-       if (eTest->v == (void*)0x3f800000) {
- 	//printf("Insert CORRUPT\n");
-       }
-     }
      e = (struct entry *)malloc(sizeof(struct entry));
      if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
!     if (e == (void*)BAD_RECORD) {
!       entered  = 1;
!       //printf("Allocated 0x%x\n", e);
!     }
      e->h = hash(h,k);
-     if (e->h == 4101970376) {
-       int i;
-       //printf("Inserting key with suspect hashvalue:\n  ");
-       for (i = 0; i < 20; i++) {
- 	//printf("%hhi ", ((char*)k)[i]);
-       }
-       //printf("\n");
-     }
      tindex = indexFor(h->tablelength,e->h);
-     if (v == (void*)0x3f800000) {
-       //printf("Insert post CORRUPT\n");
-     }
      e->k = k;
      e->v = v;
--- 149,157 ----
          hashtable_expand(h);
      }
      e = (struct entry *)malloc(sizeof(struct entry));
      if (NULL == e) { --(h->entrycount); return 0; } /*oom*/
! 
      e->h = hash(h,k);
      tindex = indexFor(h->tablelength,e->h);
      e->k = k;
      e->v = v;
***************
*** 193,212 ****
      tindex = indexFor(h->tablelength,hashvalue);
      e = h->table[tindex];
-     if (entered) {
-       struct entry* eTest = (struct entry*)BAD_RECORD;
-       if (eTest->v == (void*)0x3f800000) {
- 	//printf("Search CORRUPT\n");
-       }
-     }
      while (NULL != e)
      {
          /* Check hash value to short circuit heavier comparison */
        if ((hashvalue == e->h) && (h->eqfn(k, e->k))) {
- 	if (hashvalue == 4101970376) {
- 	  //printf("Retreiving key with suspect hhashvalue: 0x%x -> 0x%x\n", e, e->v);
- 	}
- 	if ((int)e->v == 0x3f800000) {
- 	  //printf("ALARM: 0x%x has 0x%x\n", e, e->v);
- 	}
  	return e->v;
        }
--- 170,177 ----

Index: sim_noise.c
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/lib/tossim/sim_noise.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** sim_noise.c	10 Apr 2007 22:15:39 -0000	1.5
--- sim_noise.c	11 Apr 2007 00:56:29 -0000	1.6
***************
*** 246,252 ****
    arrangeKey(node_id);
    for(i = NOISE_HISTORY; i < noiseData[node_id].noiseTraceIndex; i++) {
-     if (i >= 196605) {
-       int foo = 7;
-     }
      if (i == NOISE_HISTORY) {
        printf("Inserting first element.\n");
--- 246,249 ----



More information about the Tinyos-2-commits mailing list