diff options
author | Oliver McFadden <z3ro.geek@gmail.com> | 2007-10-28 13:31:57 +0000 |
---|---|---|
committer | Oliver McFadden <z3ro.geek@gmail.com> | 2007-10-28 13:31:57 +0000 |
commit | 200832f6c0a7e3bcb13b835a8838032abfdb6c62 (patch) | |
tree | 6ca57c0f8c0ccf82c03c9bb6024f9612dfb8a6a2 | |
parent | eab6c617dba5248c9b0f7e0bdc04cd6e657ede6e (diff) |
Converted the interface type defines to an enum.
-rw-r--r-- | src/revenge_dump_misc.c | 6 | ||||
-rw-r--r-- | src/revenge_main.c | 20 | ||||
-rw-r--r-- | src/revenge_main.h | 9 | ||||
-rw-r--r-- | src/revenge_memory.c | 4 |
4 files changed, 21 insertions, 18 deletions
diff --git a/src/revenge_dump_misc.c b/src/revenge_dump_misc.c index f896d5f..11199ed 100644 --- a/src/revenge_dump_misc.c +++ b/src/revenge_dump_misc.c @@ -93,13 +93,13 @@ dump_interface (void) switch (option_interface) { - case IF_PCIE: + case INTERFACE_PCI_E: fprintf (file, "PCI-E\n"); break; - case IF_AGP: + case INTERFACE_AGP: fprintf (file, "AGP\n"); break; - case IF_IGP: + case INTERFACE_IGP: fprintf (file, "IGP\n"); break; default: diff --git a/src/revenge_main.c b/src/revenge_main.c index 9c33e6e..4a54fcc 100644 --- a/src/revenge_main.c +++ b/src/revenge_main.c @@ -41,7 +41,7 @@ int option_debug = 0; int option_disable_ib = 0; int option_fast = 0; -int option_interface = IF_AGP; +int option_interface = INTERFACE_AGP; int option_verbose = 0; static void @@ -94,14 +94,14 @@ opengl_close (void) } static struct option long_options[] = { - {"agp", no_argument, &option_interface, IF_AGP}, + {"agp", no_argument, &option_interface, INTERFACE_AGP}, {"brief", no_argument, &option_verbose, 0}, {"debug", no_argument, &option_debug, 1}, {"disable-ib", no_argument, &option_disable_ib, 1}, {"fast", no_argument, &option_fast, 1}, - {"igp", no_argument, &option_interface, IF_IGP}, + {"igp", no_argument, &option_interface, INTERFACE_IGP}, {"output", required_argument, 0, 'o'}, - {"pci-e", no_argument, &option_interface, IF_PCIE}, + {"pci-e", no_argument, &option_interface, INTERFACE_PCI_E}, {"verbose", no_argument, &option_verbose, 1}, {0, 0, 0, 0}, }; @@ -181,7 +181,7 @@ main (int argc, char **argv) switch (option_interface) { - case IF_AGP: + case INTERFACE_AGP: detect_agp_aperture (); if ((agp_mem_map = mmap (NULL, agp_len, PROT_READ | PROT_WRITE, MAP_SHARED, mem_fd, @@ -192,7 +192,7 @@ main (int argc, char **argv) exit (EXIT_FAILURE); } break; - case IF_PCIE: + case INTERFACE_PCI_E: detect_pcigart_aperture (); if ((pcigart_mem_map = mmap (NULL, pcigart_len, PROT_READ | PROT_WRITE, MAP_SHARED, @@ -203,7 +203,7 @@ main (int argc, char **argv) exit (EXIT_FAILURE); } break; - case IF_IGP: + case INTERFACE_IGP: detect_igpgart_aperture (); if ((pcigart_mem_map = mmap (NULL, pcigart_len, PROT_READ | PROT_WRITE, MAP_SHARED, @@ -259,7 +259,7 @@ main (int argc, char **argv) switch (option_interface) { - case IF_AGP: + case INTERFACE_AGP: if (munmap (agp_mem_map, agp_len) < 0) { fprintf (stderr, "%s: %s\n", program_invocation_short_name, @@ -267,8 +267,8 @@ main (int argc, char **argv) exit (EXIT_FAILURE); } break; - case IF_PCIE: - case IF_IGP: + case INTERFACE_PCI_E: + case INTERFACE_IGP: default: if (munmap (pcigart_mem_map, pcigart_len) < 0) { diff --git a/src/revenge_main.h b/src/revenge_main.h index 2aefe4e..39d1d7e 100644 --- a/src/revenge_main.h +++ b/src/revenge_main.h @@ -23,9 +23,12 @@ #include <stdio.h> #include <stdlib.h> -#define IF_PCIE 0 -#define IF_AGP 1 -#define IF_IGP 2 +enum interface_t +{ + INTERFACE_AGP, + INTERFACE_IGP, + INTERFACE_PCI_E, +}; #define AVIVO_CRTC1_FB_LOCATION 0x6110 #define AVIVO_CRTC1_FB_END 0x6118 diff --git a/src/revenge_memory.c b/src/revenge_memory.c index b7bfa88..60a627a 100644 --- a/src/revenge_memory.c +++ b/src/revenge_memory.c @@ -61,7 +61,7 @@ memory_gart_to_phys (unsigned int addr) switch (option_interface) { - case IF_IGP: + case INTERFACE_IGP: phys_addr = (pcigart_mem_map[num] & ~0xc); break; default: @@ -153,7 +153,7 @@ memory_read (unsigned int addr, unsigned int size) switch (option_interface) { - case IF_AGP: + case INTERFACE_AGP: mem_map = memory_read_agp (addr, size); break; default: |