Ticket #7269: stricmp-define.patch
File stricmp-define.patch, 4.0 KB (added by kevin_lo@…, 19 years ago) |
---|
-
commandline.cpp
old new 27 27 #endif 28 28 #endif 29 29 30 #define stricmp(s1,s2) strcasecmp(s1,s2) 31 30 32 CommandLine::ExtraFile::ExtraFile(void) 31 33 : filename() 32 34 , filesize(0) -
par2repairer.cpp
old new 27 27 #endif 28 28 #endif 29 29 30 #define stricmp(s1,s2) strcasecmp(s1,s2) 31 30 32 Par2Repairer::Par2Repairer(void) 31 33 { 32 34 firstpacket = true; -
.cpp
old new 51 51 } 52 52 } 53 53 54 bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)54 template <> bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present) 55 55 { 56 56 inputcount = (u32)present.size(); 57 57 … … 80 80 return true; 81 81 } 82 82 83 bool ReedSolomon<Galois8>::SetInput(u32 count)83 template <> bool ReedSolomon<Galois8>::SetInput(u32 count) 84 84 { 85 85 inputcount = count; 86 86 … … 101 101 return true; 102 102 } 103 103 104 bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)104 template <> bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) 105 105 { 106 106 // Look up the appropriate element in the RS matrix 107 107 Galois8 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex]; … … 189 189 190 190 // Set which of the source files are present and which are missing 191 191 // and compute the base values to use for the vandermonde matrix. 192 bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)192 template <> bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present) 193 193 { 194 194 inputcount = (u32)present.size(); 195 195 … … 233 233 234 234 // Record that the specified number of source files are all present 235 235 // and compute the base values to use for the vandermonde matrix. 236 bool ReedSolomon<Galois16>::SetInput(u32 count)236 template <> bool ReedSolomon<Galois16>::SetInput(u32 count) 237 237 { 238 238 inputcount = count; 239 239 … … 267 267 return true; 268 268 } 269 269 270 bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)270 template <> bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer) 271 271 { 272 272 // Look up the appropriate element in the RS matrix 273 273 -
diskfile.cpp
618 618 return result; 619 619 } 620 620 621 bool is_regular_file(const string &p) 622 { 623 struct stat st; 624 return (stat(p.c_str(), &st) == 0 && S_ISREG(st.st_mode)); 625 } 626 621 627 list<string>* DiskFile::FindFiles(string path, string wildcard) 622 628 { 623 629 list<string> *matches = new list<string>; … … 648 654 name.substr(0, where) == front && 649 655 name.substr(name.size()-back.size()) == back) 650 656 { 651 matches->push_back(path + name); 657 if (is_regular_file(path + name)) 658 { 659 matches->push_back(path + name); 660 } 661 else 662 { 663 cerr << "Warning: '" << (path + name) 664 << "' ignored; not a regular file" << endl; 665 } 652 666 } 653 667 } 654 668 else … … 667 681 668 682 if (pw == wildcard.end()) 669 683 { 670 matches->push_back(path + name); 684 if (is_regular_file(path + name)) 685 { 686 matches->push_back(path + name); 687 } 688 else 689 { 690 cerr << "Warning: '" << (path + name) 691 << "' ignored; not a regular file" << endl; 692 } 671 693 } 672 694 } 673 695 } … … 678 700 } 679 701 else 680 702 { 681 struct stat st; 682 string fn = path + wildcard; 683 if (stat(fn.c_str(), &st) == 0) 703 if (is_regular_file(path + wildcard)) 684 704 { 685 705 matches->push_back(path + wildcard); 686 706 } 707 else 708 { 709 cerr << "Warning: '" << (path + wildcard) 710 << "' ignored; not a regular file" << endl; 711 } 687 712 } 688 713 689 714 return matches;