shithub: scc

Download patch

ref: 90255b74b5ee876abaae5adc6105721a897fe678
parent: e3c686dd24c18b30bbe1f3c78627a5316a0c8c27
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Tue Oct 26 17:28:28 EDT 2021

libmach/coff32: Limit visibility of atruct arch

This struct is only used in coff32probe.c, so it is better
to isolate it to that file.

--- a/src/libmach/coff32/coff32.h
+++ b/src/libmach/coff32/coff32.h
@@ -7,12 +7,6 @@
 
 typedef struct coff32 Coff32;
 
-struct arch {
-	char *name;
-	unsigned char magic[2];
-	int type;
-};
-
 struct coff32 {
 	FILHDR hdr;
 	AOUTHDR aout;
--- a/src/libmach/coff32/coff32probe.c
+++ b/src/libmach/coff32/coff32probe.c
@@ -5,6 +5,12 @@
 #include "../libmach.h"
 #include "coff32.h"
 
+struct arch {
+	char *name;
+	unsigned char magic[2];
+	int type;
+};
+
 static struct arch archs[] = {
 	"coff32-i386", "\x4c\x01", OBJ(COFF32, ARCH386, LITTLE_ENDIAN),
 	"coff32-z80", "\x5a\x80", OBJ(COFF32, ARCHZ80, LITTLE_ENDIAN),