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

A few problems...



I'm sure some were wondering wheter or not I was dead. Hmm... Actually I
am, and I can tell you it's a real pain to type when your fingers are
slowly decomposing...

--

Anyway, PFile doesn't compile on my system. 105 errors and 6 warnings.

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
casts, even though that's a bit ugly.

Btw, there's a few things you are doing that MSVC (5.0) doesn't support.
Luckily, the workarounds don't really affect the code much, basically
just removing redundant stuff, or moving something from one place to
another, but things staying the same.

--

MSVC can't handle this:

class Foobar
{
	void Foo(int someVar = 0);
};

void Foobar::Foo(int someVar = 0)
{
...
}

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.

--

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*.

--

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.

-----

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?