text.cc (10374:1813597a92ec) | text.cc (10386:c81407818741) |
---|---|
1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 270 unchanged lines hidden (view full) --- 279 280 bool havesub = !subnames.empty(); 281 282 if (_size == 1) { 283 // If forceSubnames is set, get the first subname (or index in 284 // the case where there are no subnames) and append it to the 285 // base name. 286 if (forceSubnames) | 1/* 2 * Copyright (c) 2004-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 270 unchanged lines hidden (view full) --- 279 280 bool havesub = !subnames.empty(); 281 282 if (_size == 1) { 283 // If forceSubnames is set, get the first subname (or index in 284 // the case where there are no subnames) and append it to the 285 // base name. 286 if (forceSubnames) |
287 print.name = base + (havesub ? subnames[0] : to_string(0)); | 287 print.name = base + (havesub ? subnames[0] : std::to_string(0)); |
288 print.value = vec[0]; 289 print(stream); 290 return; 291 } 292 293 if ((!flags.isSet(nozero)) || (total != 0)) { 294 if (flags.isSet(oneline)) { 295 ccprintf(stream, "%-40s", name); 296 print.flags = print.flags & (~nozero); 297 } 298 299 for (off_type i = 0; i < _size; ++i) { 300 if (havesub && (i >= subnames.size() || subnames[i].empty())) 301 continue; 302 | 288 print.value = vec[0]; 289 print(stream); 290 return; 291 } 292 293 if ((!flags.isSet(nozero)) || (total != 0)) { 294 if (flags.isSet(oneline)) { 295 ccprintf(stream, "%-40s", name); 296 print.flags = print.flags & (~nozero); 297 } 298 299 for (off_type i = 0; i < _size; ++i) { 300 if (havesub && (i >= subnames.size() || subnames[i].empty())) 301 continue; 302 |
303 print.name = base + (havesub ? subnames[i] : to_string(i)); | 303 print.name = base + (havesub ? subnames[i] : std::to_string(i)); |
304 print.desc = subdescs.empty() ? desc : subdescs[i]; 305 306 print.update(vec[i], _total); 307 print(stream, flags.isSet(oneline)); 308 } 309 310 if (flags.isSet(oneline)) { 311 if (descriptions) { --- 38 unchanged lines hidden (view full) --- 350} 351 352DistPrint::DistPrint(const Text *text, const VectorDistInfo &info, int i) 353 : data(info.data[i]) 354{ 355 init(text, info); 356 357 name = info.name + "_" + | 304 print.desc = subdescs.empty() ? desc : subdescs[i]; 305 306 print.update(vec[i], _total); 307 print(stream, flags.isSet(oneline)); 308 } 309 310 if (flags.isSet(oneline)) { 311 if (descriptions) { --- 38 unchanged lines hidden (view full) --- 350} 351 352DistPrint::DistPrint(const Text *text, const VectorDistInfo &info, int i) 353 : data(info.data[i]) 354{ 355 init(text, info); 356 357 name = info.name + "_" + |
358 (info.subnames[i].empty() ? (to_string(i)) : info.subnames[i]); | 358 (info.subnames[i].empty() ? (std::to_string(i)) : info.subnames[i]); |
359 360 if (!info.subdescs[i].empty()) 361 desc = info.subdescs[i]; 362} 363 364void 365DistPrint::init(const Text *text, const Info &info) 366{ --- 233 unchanged lines hidden (view full) --- 600 for (off_type j = 0; j < info.y; ++j) { 601 yvec[j] = info.cvec[iy + j]; 602 tot_vec[j] += yvec[j]; 603 total += yvec[j]; 604 super_total[0] += yvec[j]; 605 } 606 607 print.name = info.name + "_" + | 359 360 if (!info.subdescs[i].empty()) 361 desc = info.subdescs[i]; 362} 363 364void 365DistPrint::init(const Text *text, const Info &info) 366{ --- 233 unchanged lines hidden (view full) --- 600 for (off_type j = 0; j < info.y; ++j) { 601 yvec[j] = info.cvec[iy + j]; 602 tot_vec[j] += yvec[j]; 603 total += yvec[j]; 604 super_total[0] += yvec[j]; 605 } 606 607 print.name = info.name + "_" + |
608 (havesub ? info.subnames[i] : to_string(i)); | 608 (havesub ? info.subnames[i] : std::to_string(i)); |
609 print.desc = info.desc; 610 print.vec = yvec; 611 print.total = total; 612 print(*stream); 613 } 614 615 // Create a subname for printing the total 616 vector<string> total_subname; --- 139 unchanged lines hidden --- | 609 print.desc = info.desc; 610 print.vec = yvec; 611 print.total = total; 612 print(*stream); 613 } 614 615 // Create a subname for printing the total 616 vector<string> total_subname; --- 139 unchanged lines hidden --- |