Commit a780ad2f by Paolo Carlini Committed by Paolo Carlini

monetary_members.cc (_S_construct_pattern): Give __ret a default value, thus…

monetary_members.cc (_S_construct_pattern): Give __ret a default value, thus avoiding spurious warnings.

2004-10-10  Paolo Carlini  <pcarlini@suse.de>

	* config/locale/gnu/monetary_members.cc (_S_construct_pattern):
	Give __ret a default value, thus avoiding spurious warnings.

	* testsuite/performance/27_io/filebuf_sgetn_unbuf.cc: Open either
	words or linux.words, otherwise exit.
	* testsuite/performance/27_io/ifstream_getline.cc: Slighlty tweak.

From-SVN: r88848
parent 0ba09d8f
2004-10-10 Paolo Carlini <pcarlini@suse.de>
* config/locale/gnu/monetary_members.cc (_S_construct_pattern):
Give __ret a default value, thus avoiding spurious warnings.
* testsuite/performance/27_io/filebuf_sgetn_unbuf.cc: Open either
words or linux.words, otherwise exit.
* testsuite/performance/27_io/ifstream_getline.cc: Slighlty tweak.
2004-10-09 Paolo Carlini <pcarlini@suse.de> 2004-10-09 Paolo Carlini <pcarlini@suse.de>
* include/std/std_memory.h (__get_temporary_buffer): Don't use * include/std/std_memory.h (__get_temporary_buffer): Don't use
......
...@@ -199,7 +199,7 @@ namespace std ...@@ -199,7 +199,7 @@ namespace std
} }
break; break;
default: default:
; __ret = pattern();
} }
return __ret; return __ret;
} }
......
...@@ -42,10 +42,18 @@ int main() ...@@ -42,10 +42,18 @@ int main()
const int chunksize = 100; const int chunksize = 100;
char* chunk = new char[chunksize]; char* chunk = new char[chunksize];
const char* name = "/usr/share/dict/linux.words"; const char* name1 = "/usr/share/dict/words";
const char* name2 = "/usr/share/dict/linux.words";
const char* name = name1;
// C // C
FILE* file = fopen(name, "r"); FILE* file;
if (!(file = fopen(name, "r")))
{
name = name2;
if (!(file = fopen(name, "r")))
exit(1);
}
setvbuf(file, 0, _IONBF, 0); setvbuf(file, 0, _IONBF, 0);
start_counters(time, resource); start_counters(time, resource);
for (int i = 0; i < iterations; ++i) for (int i = 0; i < iterations; ++i)
......
...@@ -46,14 +46,13 @@ int main () ...@@ -46,14 +46,13 @@ int main ()
in.clear(); in.clear();
in.open(name2); in.open(name2);
} }
if (!in.is_open())
exit(1);
char buffer[BUFSIZ]; char buffer[BUFSIZ];
start_counters(time, resource); start_counters(time, resource);
if (in.is_open())
{
while (in.good()) while (in.good())
in.getline(buffer, BUFSIZ); in.getline(buffer, BUFSIZ);
}
stop_counters(time, resource); stop_counters(time, resource);
report_performance(__FILE__, "", time, resource); report_performance(__FILE__, "", time, resource);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment