Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:11.4
idep
idep-C_headers.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File idep-C_headers.patch of Package idep
--- idep.cxx +++ idep.cxx @@ -10,8 +10,9 @@ * (c)2000 by Bram Stolk (b.stolk at host chello.nl) */ -#include <stdio.h> -#include <string.h> +#include <cstdio> +#include <cstring> +#include <cstdlib> #include <iostream> @@ -21,7 +22,7 @@ // helper func. replaces GNU basename() static const char *strip_dir(const char *filename) { - int len = strlen(filename); + int len = std::strlen(filename); if (!len) return filename; const char *p = filename + len - 1; while (*p && p>filename && *p != '/') @@ -33,7 +34,7 @@ // helper func static char *strip_nl(char *line) { - int len = strlen(line); + int len = std::strlen(line); if (!len) return line; if (line[len-1]=='\n') line[len-1]=0; @@ -42,11 +43,11 @@ static char *strip_trailers(char *line, char *trailers) { - int len = strlen(line); + int len = std::strlen(line); if (!len) return line; char c = line[len-1]; - if (strchr(trailers, c)) + if (std::strchr(trailers, c)) { line[len-1]=0; return strip_trailers(line, trailers); @@ -67,21 +68,21 @@ std::string cmd = "find " + dirname + " -name \\*" + extention + " -print"; - FILE *f = popen(cmd.c_str(), "r"); + std::FILE *f = ::popen(cmd.c_str(), "r"); if (!f) { std::cerr << "cmd " << cmd << " failed.\n"; - exit(1); + std::exit(1); } char line[512]; - while (fgets(line, sizeof(line), f)) + while (std::fgets(line, sizeof(line), f)) { char *fulln = strip_nl(line); HeaderInfo hi(fulln); mapping[hi.shortname] = hi; } - pclose(f); + ::pclose(f); } @@ -93,21 +94,21 @@ const std::string &fn = ip->second.fullname; std::string cmd = "grep \"#include\" " + fn; - FILE *f = popen(cmd.c_str(), "r"); + std::FILE *f = ::popen(cmd.c_str(), "r"); if (!f) { std::cerr << "cmd " << cmd << " failed.\n"; - exit(1); + std::exit(1); } char line[512]; - while (fgets(line, sizeof(line), f)) + while (std::fgets(line, sizeof(line), f)) { char s[256]; bool skip=false; - if (sscanf(line, " #include <%s> ", s) != 1) + if (std::sscanf(line, " #include <%s> ", s) != 1) { - if (sscanf(line, " #include \"%s\" ", s) != 1) + if (std::sscanf(line, " #include \"%s\" ", s) != 1) { // std::cerr << "Cannot interpret include:\n" << line; skip=true; @@ -122,7 +123,7 @@ ip->second.deps.insert(ip->second.deps.end(), s); } } - pclose(f); + ::pclose(f); } } @@ -137,24 +138,24 @@ std::string cmd = "grep \"class\" " + fn + " | grep -v \\;"; - FILE *f = popen(cmd.c_str(), "r"); + std::FILE *f = ::popen(cmd.c_str(), "r"); if (!f) { std::cerr << "cmd " << cmd << " failed.\n"; - exit(1); + std::exit(1); } char line[512]; while (fgets(line, sizeof(line), f)) { char name[256]; - if (sscanf(line, " class %s ", name) == 1) + if (std::sscanf(line, " class %s ", name) == 1) { - char *stripped_name = strip_trailers(name, ":"); + const char *stripped_name = strip_trailers(name, ":"); hi.defs.insert(hi.defs.begin(), stripped_name); } } - pclose(f); + ::pclose(f); } } @@ -167,19 +168,19 @@ " | grep -v \"" + usedclass + "[ ]*[\\*&]\" " + " | grep -v \"#include\""; - FILE *f = popen(cmd.c_str(), "r"); + std::FILE *f = ::popen(cmd.c_str(), "r"); if (!f) { std::cerr << "cmd " << cmd << " failed.\n"; - exit(1); + std::exit(1); } char line[512]; int cnt=0; - while (fgets(line, sizeof(line), f)) + while (std::fgets(line, sizeof(line), f)) cnt++; - pclose(f); + ::pclose(f); return cnt>0; }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor