Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Apr 2003 10:59:44 -0800 (PST)
From:      Juli Mallett <jmallett@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28241 for review
Message-ID:  <200304051859.h35Ixi64002208@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28241

Change 28241 by jmallett@jmallett_dalek on 2003/04/05 10:59:05

	Catch up with endian function changes, clean up one style bogon.

Affected files ...

.. //depot/projects/mips/sys/geom/geom_fx.c#11 edit

Differences ...

==== //depot/projects/mips/sys/geom/geom_fx.c#11 (text+ko) ====

@@ -33,6 +33,7 @@
 
 
 #include <sys/param.h>
+#include <sys/endian.h>
 #ifndef _KERNEL
 #include <stdio.h>
 #include <string.h>
@@ -62,9 +63,9 @@
 static void
 g_fx_swap_volpart(struct volpart *vp)
 {
-	vp->vp_size = g_dec_be4((u_char *)&vp->vp_size);
-	vp->vp_begin = g_dec_be4((u_char *)&vp->vp_begin);
-	vp->vp_type = g_dec_be4((u_char *)&vp->vp_type);
+	vp->vp_size = be32dec((u_char *)&vp->vp_size);
+	vp->vp_begin = be32dec((u_char *)&vp->vp_begin);
+	vp->vp_type = be32dec((u_char *)&vp->vp_type);
 }
 
 static const char *
@@ -89,8 +90,8 @@
 	words = (int32_t *)vh;
 
 	for (i = 0; i < 512 / sizeof *words; i++)
-		sum += g_dec_be4((u_char *)&words[i]);
-	return sum;
+		sum += be32dec((u_char *)&words[i]);
+	return (sum);
 }
 
 static int
@@ -161,7 +162,7 @@
 		if (buf == NULL || error != 0)
 			break;
 		label = (struct volhdr *)buf;
-		if (g_dec_be4((u_char *)&label->vh_magic) != FX_LABEL_MAGIC)
+		if (be32dec((u_char *)&label->vh_magic) != FX_LABEL_MAGIC)
 			break;
 		error = g_fx_cksum(label);
 		if (error != 0) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304051859.h35Ixi64002208>