Fix anonymous struct/union linkage errors in gdromv3.cpp

Since read_params, packet_cmd, read_buff, pio_buff, ata_cmd, cdda and
ByteCount have not been declared static, they are visible in other
translation units. Since their structs are anonymous, their types have
internal linkage only. Thus, accessing them in other translations units
is impossible anyway.

By declaring them static, we're giving it internal linkage so that
neither the type nor the variable are visible in other translation
units.

Here are the errors:

../../core/hw/gdrom/gdromv3.cpp:50:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> read_params' with
linkage
 } read_params;
   ^
../../core/hw/gdrom/gdromv3.cpp:83:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> packet_cmd' with
linkage
 } packet_cmd;
   ^
../../core/hw/gdrom/gdromv3.cpp:91:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> read_buff' with
linkage
 } read_buff;
   ^
../../core/hw/gdrom/gdromv3.cpp💯3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> pio_buff' with
linkage
 } pio_buff;
   ^
../../core/hw/gdrom/gdromv3.cpp:106:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> ata_cmd' with
linkage
 } ata_cmd;
   ^
../../core/hw/gdrom/gdromv3.cpp:122:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> cdda' with linkage
 } cdda;
   ^
../../core/hw/gdrom/gdromv3.cpp:156:4: warning: anonymous type with no
linkage used to declare variable '<anonymous union> ByteCount' with
linkage
  } ByteCount;
    ^
This commit is contained in:
Jan Holthuis 2015-04-16 14:57:08 +02:00
parent 39ead6159b
commit 9e00305c90
1 changed files with 7 additions and 7 deletions

View File

@ -42,14 +42,14 @@ enum gd_states
gds_process_set_mode, gds_process_set_mode,
}; };
struct static struct
{ {
u32 start_sector; u32 start_sector;
u32 remaining_sectors; u32 remaining_sectors;
u32 sector_type; u32 sector_type;
} read_params; } read_params;
struct static struct
{ {
u32 index; u32 index;
union union
@ -83,7 +83,7 @@ struct
} packet_cmd; } packet_cmd;
//Buffer for sector reads [dma] //Buffer for sector reads [dma]
struct static struct
{ {
u32 cache_index; u32 cache_index;
u32 cache_size; u32 cache_size;
@ -91,7 +91,7 @@ struct
} read_buff; } read_buff;
//pio buffer //pio buffer
struct static struct
{ {
gd_states next_state; gd_states next_state;
u32 index; u32 index;
@ -100,12 +100,12 @@ struct
} pio_buff; } pio_buff;
u32 set_mode_offset; u32 set_mode_offset;
struct static struct
{ {
u8 command; u8 command;
} ata_cmd; } ata_cmd;
struct static struct
{ {
bool playing; bool playing;
u32 repeats; u32 repeats;
@ -144,7 +144,7 @@ u32 data_write_mode=0;
GD_StatusT GDStatus; GD_StatusT GDStatus;
union static union
{ {
struct struct
{ {