Module Name: src
Committed By: mrg
Date: Wed Jun 22 06:22:49 UTC 2011
Modified Files:
src/usr.bin/window: window_string.h
Log Message:
use offsetof() instead of some strange local hack.
To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/usr.bin/window/window_string.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/window/window_string.h
diff -u src/usr.bin/window/window_string.h:1.8 src/usr.bin/window/window_string.h:1.9
--- src/usr.bin/window/window_string.h:1.8 Tue Apr 14 08:50:06 2009
+++ src/usr.bin/window/window_string.h Wed Jun 22 06:22:48 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: window_string.h,v 1.8 2009/04/14 08:50:06 lukem Exp $ */
+/* $NetBSD: window_string.h,v 1.9 2011/06/22 06:22:48 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -62,7 +62,7 @@
EXTERN struct string str_head;
-#define str_offset ((unsigned)str_head.s_data - (unsigned)&str_head)
+#define str_offset offsetof(struct string, s_data)
#define str_stos(s) ((struct string *)((unsigned)(s) - str_offset))
char *str_alloc(size_t);