Closed Bug 444296 Opened 17 years ago Closed 17 years ago

smbase -- depreciate the used of <ostream.h>

Categories

(Developer Infrastructure :: Source Code Analysis, defect)

x86
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: segg2, Unassigned)

References

Details

Attachments

(3 files, 2 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9) Gecko/2008061712 Fedora/3.0-1.fc9 Firefox/3.0 Build Identifier: smbase current implementation of c++ compiler now conform to standard. and name in std libraries required "using namespace std;" declaration. Reproducible: Always Steps to Reproduce: 1. 2. 3.
Blocks: 438061
Comment on attachment 328642 [details] [diff] [review] diff file of the smbasee directory > #include <string.h> // strlen, strcpy >-#include <iostream.h> // clog >+//#include <iostream.h> // clog Please delete lines instead of commenting them out >-#include <iostream.h> // ostream >+#if defined(__GNUC__) && __GNUC__ < 4 >+# include <iostream.h> // ostream >+#else >+# include <iostream> >+#endif Don't worry about ifdefing these, just delete the .h part Please resubmit patches with that cleaned up.
(In reply to comment #2) > Don't worry about ifdefing these, just delete the .h part > > Please resubmit patches with that cleaned up. resubmitting with the corrections
Attachment #328642 - Attachment is obsolete: true
Comment on attachment 328821 [details] [diff] [review] diff file of the smbase directory > > // ------------------ BitwiseGrowArray -------------------- >@@ -121,19 +121,19 @@ > > // shallow copy data from src to dest > static void copy(T *dest, T *src, size_t count) { >- memcpy(dest, src, sizeof(T)*count); >+ ::memcpy(dest, src, sizeof(T)*count); > } > > // uninitialized alloc > static T *alloc(size_t count) { >- void *m = malloc(sizeof(T)*count); >- if (!m) throw bad_alloc(); >+ void *m = ::malloc(sizeof(T)*count); >+ if (!m) throw std::bad_alloc(); > return (T*) m; > } > > // dealloc > static void dealloc(T *ary) { >- free(ary); >+ ::free(ary); > } > }; > Is most of this really needed to compile?
also, since these files aren't headers. Wouldn't it make more sense to just put using namespace std on top?
nevermind, i guess the whole problem is that you can't do using namespace std;
Hey Gilles, I'm still on this. I think I want to work on the renaming tool so I can rename elsa's string class and do using namespace std; in .cpp files. This way the code is a good testcase for it. if you like I can compromise and commit .h changes now and you can maintain .cpp changes in your own patch queue for now. I don't think it'll take too long to do the rename.
Depends on: 445897
Attachment #328821 - Attachment is obsolete: true
should not depend on #331412 attachment.
thanks, pushed
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: