Deleted Added
sdiff udiff text old ( 9983:2cce74fe359e ) new ( 10386:c81407818741 )
full compact
1/*
2 * Copyright (c) 2002-2005 The Regents of The University of Michigan
3 * Copyright (c) 2013 Advanced Micro Devices, Inc.
4 * Copyright (c) 2013 Mark D. Hill and David A. Wood
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are

--- 97 unchanged lines hidden (view full) ---

106template <>
107void
108showParam(ostream &os, const unsigned char &value)
109{
110 os << (unsigned int)value;
111}
112
113
114// Use sscanf() for FP types as to_number() only handles integers
115template <>
116bool
117parseParam(const string &s, float &value)
118{
119 return (sscanf(s.c_str(), "%f", &value) == 1);
120}
121
122template <>
123bool
124parseParam(const string &s, double &value)
125{
126 return (sscanf(s.c_str(), "%lf", &value) == 1);
127}
128
129template <>
130bool
131parseParam(const string &s, bool &value)
132{
133 const string &ls = to_lower(s);
134
135 if (ls == "true") {
136 value = true;
137 return true;
138 }
139
140 if (ls == "false") {
141 value = false;
142 return true;
143 }
144
145 return false;
146}
147
148// Display bools as strings
149template <>
150void
151showParam(ostream &os, const bool &value)
152{
153 os << (value ? "true" : "false");

--- 502 unchanged lines hidden ---