[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few problems...



Bjarke Hammersholt Roune wrote:

>There's a few minor const-correctness problems in win32.cpp. Nothing
>major, except that ppfDirEntry::Name is const, and, well, it gets
>deleted in several places. Normally I'd just change ppfDirEntry::Name
>from const char* to a char*, but I get the feeling the point of the
>thing is that clients have access to ppfDirEntry, but they shouldn't
>change Name. Correct? In light of that, it would be better to just do

Correct. 

>casts, even though that's a bit ugly.

Not as ugly as changing ppfDirEntry::Name to non-const.

>If a parameter of a function has a default parameter, it must be
>specified in the declaration only, and thus cannot be redefined in the
>definition of said function, even if the values assigned by default are
>identical. I don't know if this is MSVC being lame, or if gcc is
>allowing something it shouldn't (I assume it compiles for you, and that
>you use gcc). In any case, MSVC won't have it.

Strange. g++ *should* at least warn me. Where does this occur? I couldn't
find it here.

>--
>
>Iterator<class ELEMENT>
>{
>	virtual ELEMENT *Get    () const throw () = 0;
>};
>
>class ConstFSEntityIterator : public Iterator <const ELEMENT>
>{
>	virtual const ELEMENT *Get () const throw () { return iter->Get (); }
>};
>
>Apparently MSVC won't have this either, as it complains that the
>overloaded version of Get() differ only by return type. Seems like it
>thinks the return type is the non-existant type const const ELEMENT*.

Hmm, would

#ifdef_MSC_VER
	virtual ELEMENT *Get () const throw () { return iter->Get (); }
#else
	...
#endif

work? Otherwise it gets ugly...


>--
>
>class PakHashTable
>{
>	static const ppSizeT prime_sizes [11] = {
>		7, 17, 31, 67, 127, 257, 509,
>		1031, 2053, 4099, 8191};
>};
>
>MSVC does not allow variables to be initialized in the class declaration
>(be those variables static or not). This initialization, and others like
>it, has to be in the instantiation of the variable to be initialized.

Ok. trivial (instantiation is 5 lines below)

>-----
>
>I'm really strained on time these days (weeks more like it), which is
>why I haven't been very active. It's not that I don't want to do
>something. I'll see if I can fix this tomorrow though.
>
>I haven't used CVS to upload anything yet. Should I be worried that I
>migth screw something up by doing it wrong? I mean like accidentally
>copying the entire PPlay directory hirearchy on my computer to the first
>directory in the directory hirearchy on the server, so there two
>instances of the same stuff suddenly gets on the server, one contained
>within the other? Just generally, is it possible to accidentally do
>something like that?

Nope. As long as you don't use "cvs add" and "cvs remove" it's very hard to
screw things up. "cvs commit" lets you only update files on the server,
which is (almost) perfectly safe. So just go ahead.

BTW - There's a very good book about CVS available online (also
downloadable): http://cvsbook.red-bean.com/


	Christian
-- 

If you can't make it good, make it LOOK good.-Gates.