+2008-11-07 Frank Ch. Eigler <fche@redhat.com>
+
+ * (*): Change some "char *" -> "const char *" declarations for
+ warning suppression on gcc 4.3.
+
2006-10-18 Dave Brolley <brolley@redhat.com>
* Contribute the following changes:
#define MAX_LOGLEV 4
typedef class logfunctions {
- char *prefix;
+ const char *prefix;
int type;
// values of onoff: 0=ignore, 1=report, 2=fatal
#define ACT_IGNORE 0
logfunctions(class iofunctions *);
~logfunctions(void);
- void info(char *fmt, ...);
- void error(char *fmt, ...);
- void panic(char *fmt, ...);
- void ldebug(char *fmt, ...);
- void fatal (char *prefix, char *fmt, va_list ap);
- void setprefix(char *);
+ void info(const char *fmt, ...);
+ void error(const char *fmt, ...);
+ void panic(const char *fmt, ...);
+ void ldebug(const char *fmt, ...);
+ void fatal (const char *prefix, const char *fmt, va_list ap);
+ void setprefix(const char *);
void settype(int);
void setio(class iofunctions *);
void setonoff(int loglev, int value) { onoff[loglev] = value; }
class logfunctions *log;
void init(void);
void flush(void);
- char *getlevel(int i) {
- static char *loglevel[] = {
+ const char *getlevel(int i) {
+ static const char *loglevel[] = {
"DEBUG",
"INFO",
"ERROR",
return loglevel[i];
}
- char *getclass(int i) {
- char *logclass[] = {
+ const char *getclass(int i) {
+ static const char *logclass[] = {
"IO ",
"FD ",
"GEN ",
iofunctions(char *);
~iofunctions(void);
- void out(int facility, int level, char *pre, char *fmt, va_list ap);
+ void out(int facility, int level, const char *pre, const char *fmt, va_list ap);
void init_log(char *fn);
void init_log(int fd);
int n_logfn;
#define MAX_LOGFNS 64
logfunc_t *logfn_list[MAX_LOGFNS];
- char *logfn;
+ const char *logfn;
};
typedef class iofunctions iofunc_t;
void bx_init_debug(void);
void bx_emulate_hga_dumps_timer(void);
-static char *divider = "========================================================================";
+static const char *divider = "========================================================================";
/* typedefs */
// use newfd/newfn so that we can log the message to the OLD log
// file descriptor.
FILE *newfd = stderr;
- char *newfn = "/dev/stderr";
+ const char *newfn = "/dev/stderr";
if( strcmp( fn, "-" ) != 0 ) {
newfd = fopen(fn, "w");
if(newfd != NULL) {
// fmt and ap retained for direct printinf from iofunctions only!
void
-iofunctions::out(int f, int l, char *prefix, char *fmt, va_list ap)
+iofunctions::out(int f, int l, const char *prefix, const char *fmt, va_list ap)
{
assert (magic==MAGIC_LOGNUM);
assert (this != NULL);
}
void
-logfunctions::setprefix(char *p)
+logfunctions::setprefix(const char *p)
{
this->prefix=strdup(p);
}
}
void
-logfunctions::info(char *fmt, ...)
+logfunctions::info(const char *fmt, ...)
{
va_list ap;
FILE *fs;
}
void
-logfunctions::error(char *fmt, ...)
+logfunctions::error(const char *fmt, ...)
{
va_list ap;
FILE *fs;
}
void
-logfunctions::panic(char *fmt, ...)
+logfunctions::panic(const char *fmt, ...)
{
va_list ap;
FILE *fs;
}
void
-logfunctions::ldebug(char *fmt, ...)
+logfunctions::ldebug(const char *fmt, ...)
{
va_list ap;
FILE *fs;
}
void
-logfunctions::fatal (char *prefix, char *fmt, va_list ap)
+logfunctions::fatal (const char *prefix, const char *fmt, va_list ap)
{
static int fatal_reentry = 0;
if (fatal_reentry) return;
typedef int exp_t;
typedef sid::host_int_8 fraction_t;
- typedef enum round_mode_t
+ enum round_mode_t
{
round_default,
round_near,
round_down
};
- typedef enum denorm_t
+ enum denorm_t
{
denorm_default,
denorm_underflow_inexact,
denorm_zero
};
- typedef enum class_t
+ enum class_t
{
class_zero,
class_snan,
{
std::vector<std::string> search_directories;
- char* slp = getenv ("SID_LIBRARY_PATH"); // run-time configuration
+ const char* slp = getenv ("SID_LIBRARY_PATH"); // run-time configuration
if (slp)
{
search_directories = tokenize (slp, ":");
}
- char* sep = getenv ("SID_EXEC_PREFIX"); // install-time configuration
+ const char* sep = getenv ("SID_EXEC_PREFIX"); // install-time configuration
#ifdef __CYGWIN__
char conv_fn[PATH_MAX*2];
if (sep)