Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 74343 Details for
Bug 113867
request for sbackup ebuild
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
patch for x10events.cc
x10events.cc.patch (text/plain), 2.93 KB, created by
Robert Gusick
on 2005-12-08 14:46:29 UTC
(
hide
)
Description:
patch for x10events.cc
Filename:
MIME Type:
Creator:
Robert Gusick
Created:
2005-12-08 14:46:29 UTC
Size:
2.93 KB
patch
obsolete
>--- x10events.cc.ORIG 2005-11-21 16:27:19.000000000 -0500 >+++ x10events.cc 2005-12-07 14:10:58.000000000 -0500 >@@ -40,29 +40,29 @@ > // 29 16 * * * /usr/local/bin/heyu turn office on # set 0.1 > // 12 00 * * * /usr/local/bin/heyu turn office off # abs 00:30 0.5 > >-#include <iostream.h> >-#include <strstream.h> >-#include <fstream.h> >+#include <iostream> >+#include <fstream> >+#include <sstream> > #include <math.h> > #include <stdlib.h> > #include <unistd.h> > #include <time.h> >-#include <string.h> >+#include <string> > #include "ephem.h" > >-void print_modifed(ostream *out, int minute, int hour, >+void print_modifed(std::ostream *out, int minute, int hour, > char* day, char* month, char* dow, > char* command, char* tag, > double fmean, char* mean, double fvar, char* var) > { > out->width(2); > out->fill('0'); >- out->setf(ios::right); >+ out->setf(std::ios::right); > (*out) << minute << " "; > > out->width(2); > out->fill('0'); >- out->setf(ios::right); >+ out->setf(std::ios::right); > (*out) << hour << " "; > > (*out) << day; >@@ -72,7 +72,7 @@ > (*out) << tag; > if (fmean!=0.0 || fvar!=0.0) (*out) << " " << mean; > if (fvar!=0.0) (*out) << " " << var; >- (*out) << endl; >+ (*out) << std::endl; > } > > double wrap(double time) >@@ -121,21 +121,18 @@ > > void usage() > { >- cerr << "usage: x10events"; >- cerr << " [crontab_file]"; >- cerr << " [lat(deg) long(deg) zone(hrs)]"; >- cerr << endl; >+ std::cerr << "usage: x10events"; >+ std::cerr << " [crontab_file]"; >+ std::cerr << " [lat(deg) long(deg) zone(hrs)]"; >+ std::cerr << std::endl; > exit(1); > } > > int main (int argc, char *argv[]) > { >- // this is stupid, but dynamic ostrstream doesnt seem to work >- // properly on large strings - arggg!! JAVAJAVAJAVAJAVA >- char *outbuf = new char[1000000]; >- ostrstream out(outbuf, 1000000); >+ std::ostringstream out; > >- istream *in = &cin; >+ std::istream *in = &std::cin; > char *filename = (char*)NULL; > > double latitude = 41.196013; >@@ -160,10 +157,10 @@ > if ((argc==2) || (argc==5)) > { > filename = argv[arg]; >- ifstream* fin = new ifstream(filename); >+ std::ifstream* fin = new std::ifstream(filename); > if (!fin->is_open()) > { >- cerr << "non-existant input file" << endl; >+ std::cerr << "non-existant input file" << std::endl; > usage(); > } > in = fin; >@@ -235,7 +232,7 @@ > in->getline(buf, buflen, '\n'); > if (buf[0] == '#') > { >- out << buf << endl; >+ out << buf << std::endl; > } > else > { >@@ -305,13 +302,13 @@ > > if (filename == (char*) NULL) > { >- cout << out.str(); >+ std::cout << out.str(); > } > else > { >- ((ifstream*) in)->close(); >+ ((std::ifstream*) in)->close(); > sleep(2); // wait a bit so cron doesn't think the file is unchanged >- ofstream fout(filename, ios::out | ios::trunc); >+ std::ofstream fout(filename, std::ios::out | std::ios::trunc); > fout << out.str(); > fout.close(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 113867
:
73824
|
74342
|
74343
|
74344
|
74345