Browse Source

Further deanon.

This fixes the rc explosions, weirdly enough.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
Ronald G. Minnich 3 years ago
parent
commit
c83eb60ebb
3 changed files with 6 additions and 6 deletions
  1. 1 1
      sys/include/String.h
  2. 0 0
      sys/log/cs
  3. 5 5
      sys/src/libString/s_alloc.c

+ 1 - 1
sys/include/String.h

@@ -12,7 +12,7 @@
 
 /* extensible Strings */
 typedef struct String {
-	Lock;
+	Lock Lock;
 	char	*base;	/* base of String */
 	char	*end;	/* end of allocated space+1 */
 	char	*ptr;	/* ptr into String */

+ 0 - 0
sys/log/cs


+ 5 - 5
sys/src/libString/s_alloc.c

@@ -18,12 +18,12 @@ s_free(String *sp)
 {
 	if (sp == nil)
 		return;
-	lock(sp);
+	lock((Lock *)sp);
 	if(--(sp->ref) != 0){
-		unlock(sp);
+		unlock((Lock *)sp);
 		return;
 	}
-	unlock(sp);
+	unlock((Lock *)sp);
 
 	if(sp->fixed == 0 && sp->base != nil)
 		free(sp->base);
@@ -34,9 +34,9 @@ s_free(String *sp)
 extern String *
 s_incref(String *sp)
 {
-	lock(sp);
+	lock((Lock *)sp);
 	sp->ref++;
-	unlock(sp);
+	unlock((Lock *)sp);
 
 	return sp;
 }