hopefully fixed bug #57 (limit on version info length was too low). while at it, made cpu_type's length externally visible; split sound stuff into sysdep/snd.h (as with gfx, cpu, mem) and in general cleaned up a bit.

This was SVN commit r2151.
This commit is contained in:
janwas 2005-04-19 17:07:05 +00:00
parent 771a9ba0dd
commit 550bbec3d0
6 changed files with 23 additions and 11 deletions

View File

@ -110,7 +110,7 @@ void get_gfx_info()
// CPU
//
char cpu_type[49] = ""; // processor brand string is <= 48 chars
char cpu_type[CPU_TYPE_LEN] = ""; // processor brand string is <= 48 chars
double cpu_freq = 0.f;
// -1 if detect not yet called, or cannot be determined

View File

@ -28,18 +28,13 @@ extern "C" {
#include "sysdep/gfx.h"
#include "sysdep/os.h"
#include "sysdep/cpu.h"
extern void get_cpu_info(void);
#include "sysdep/snd.h"
const size_t SND_CARD_LEN = 64;
extern char snd_card[SND_CARD_LEN];
const size_t SND_DRV_VER_LEN = 128;
extern char snd_drv_ver[SND_DRV_VER_LEN];
extern void get_snd_info(void);
#ifdef __cplusplus

View File

@ -3,7 +3,9 @@ extern "C" {
#endif
extern char cpu_type[];
const size_t CPU_TYPE_LEN = 49; // processor brand string is <= 48 chars
extern char cpu_type[CPU_TYPE_LEN];
extern double cpu_freq;
// -1 if detect not yet called, or cannot be determined
@ -18,6 +20,8 @@ extern int cpu_smp;
// called from ia32.cpp check_smp
extern int on_each_cpu(void(*cb)());
extern void get_cpu_info(void);
#ifdef __cplusplus
}

View File

@ -13,7 +13,7 @@ extern int get_monitor_size(int& width_mm, int& height_mm);
const size_t GFX_CARD_LEN = 128;
extern char gfx_card[GFX_CARD_LEN]; // default: ""
const size_t GFX_DRV_VER_LEN = 16;
const size_t GFX_DRV_VER_LEN = 64;
extern char gfx_drv_ver[GFX_DRV_VER_LEN]; // default: ""
// attempt to detect graphics card without OpenGL (in case ogl init fails,

13
source/lib/sysdep/snd.h Normal file
View File

@ -0,0 +1,13 @@
#ifndef SND_H__
#define SND_H__
const size_t SND_CARD_LEN = 128;
extern char snd_card[SND_CARD_LEN];
const size_t SND_DRV_VER_LEN = 256;
extern char snd_drv_ver[SND_DRV_VER_LEN];
extern void get_snd_info(void);
#endif // #ifndef SND_H__

View File

@ -303,7 +303,7 @@ static char* snd_drv_ver_pos = snd_drv_ver;
static void list_add_dll(const char* dll_path)
{
// read file version.
char dll_ver[32];
char dll_ver[128];
if(get_ver(dll_path, dll_ver, sizeof(dll_ver)) < 0)
strcpy_s(dll_ver, sizeof(dll_ver), "unknown version");