Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 84538 Details for
Bug 129778
improved patch for games-arcade/tomatoes-1.55-r1
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
tested patch
tomatoes-1.55-config_strings.patch (text/plain), 2.51 KB, created by
whereami
on 2006-04-13 02:36:59 UTC
(
hide
)
Description:
tested patch
Filename:
MIME Type:
Creator:
whereami
Created:
2006-04-13 02:36:59 UTC
Size:
2.51 KB
patch
obsolete
>diff -ru tomatoes-1.55-orig/include/config.h tomatoes-1.55/include/config.h >--- tomatoes-1.55-orig/include/config.h 2006-04-13 01:16:04.000000000 -0700 >+++ tomatoes-1.55/include/config.h 2006-04-13 02:23:48.000000000 -0700 >@@ -30,6 +30,10 @@ > #ifndef CONFIG_H > #define CONFIG_H > >+#include <string> >+ >+using namespace std; >+ > // Config structure > struct CONFIG { > int vid_w; // Video mode width >@@ -59,14 +63,14 @@ > // config file. It first checks the user's home directory, > // and if that fails it uses the CONFIG_DIR defined in the > // makefile. >-char *get_config_location(bool write = false); >+string get_config_location(bool write = false); > > > // Load config from file >-void load_config(char *file, CONFIG *conf); >+void load_config(string file, CONFIG *conf); > > // Save config to file >-void save_config(char *file, CONFIG *conf); >+void save_config(string file, CONFIG *conf); > > #endif > >diff -ru tomatoes-1.55-orig/src/config.cpp tomatoes-1.55/src/config.cpp >--- tomatoes-1.55-orig/src/config.cpp 2006-04-13 01:16:04.000000000 -0700 >+++ tomatoes-1.55/src/config.cpp 2006-04-13 02:30:27.000000000 -0700 >@@ -76,7 +76,7 @@ > // config file. It first checks the user's home directory, > // and if that fails it uses the CONFIG_DIR defined in the > // makefile. >-char *get_config_location(bool write) { >+string get_config_location(bool write) { > #ifdef LINUX > // Get the path to the config file > string tmp = get_tomatoes_dir() + "config.cfg"; >@@ -91,7 +91,7 @@ > fclose(ftest); > } > >- return (char*)tmp.c_str(); >+ return tmp; > #endif > > // Return the CONFIG_DIR >@@ -100,11 +100,11 @@ > > > // Load config from file >-void load_config(char *file, CONFIG *conf) { >+void load_config(string file, CONFIG *conf) { > >- FILE *f = fopen(file, "rt"); >+ FILE *f = fopen(file.c_str(), "rt"); > if(!f) >- error_msg("Unable to load config file: %s!", file); >+ error_msg("Unable to load config file: %s!", file.c_str()); > > fscanf(f, "video_mode = %d x %d\n", &(conf->vid_w), &(conf->vid_h)); > fscanf(f, "video_mode_color_depth = %d\n", &(conf->vid_color_depth)); >@@ -127,11 +127,11 @@ > > > // Save config to file >-void save_config(char *file, CONFIG *conf) { >+void save_config(string file, CONFIG *conf) { > >- FILE *f = fopen(file, "wt"); >+ FILE *f = fopen(file.c_str(), "wt"); > if(!f) >- error_msg("Unable to save config file: %s!", file); >+ error_msg("Unable to save config file: %s!", file.c_str()); > > fprintf(f, "video_mode = %d x %d\n", (conf->vid_w), (conf->vid_h)); > fprintf(f, "video_mode_color_depth = %d\n", (conf->vid_color_depth));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 129778
:
84537
| 84538