[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [aspell] Crossplatform coding..
From: |
Kevin Atkinson |
Subject: |
Re: [aspell] Crossplatform coding.. |
Date: |
Thu, 18 Jan 2001 23:51:09 -0500 (EST) |
On Fri, 19 Jan 2001, Matthew Allen wrote:
> To the people working on Aspell,
>
> I'm working on a cross platform mail client (BeOS/Linux/Win32) and I thought
> I'd dive into the Aspell code and produce a version that compiles with VC++ 6
> on Win32.
>
> Now I've found that due to coding solely for gcc, certain compiler specific
> things have crept into the code base. I would like to replace these compiler
> specific things with code that compiles on both GCC and VC++. Thats if people
> don't mind too much.
>
> Some examples of what I mean:
>
> adding:
> using namespace std;
> to the namespace declarations where needed to access string an o/istream etc.
>
> from:
> static int len = 256;
> char buffer[len]; // this isn't standard C++ is it?
> to:
> #define BUFFER_LEN 256
> char buffer[BUFFER_LEN]; // or something similar
Change
static int len = 256;
to
static int const len = 256;
I do not like using defines unless I have to.
> class a {
> virtual a *func() = 0;
> };
> class a_impl {
> a_impl *func() { return this; }
> };
> to:
> class a {
> virtual a *func() = 0;
> };
> class a_impl {
> a *func() { return this; }
> };
That is perfectly legal C++ code.
> and other changes as required (and I remember).
>
> What do you guys think?
>
> also on a side note...
> it would be nice for the source code to have the same file extensions as
> other compilers, eg .cpp for source and .h for headers. I know gcc supports
> this just as well as .cc and .hh so it's not like it's going to screw up
> anything in unix, it's just better for other compilers.
By that you mean?
>
> one last thing:
> I found the header in pspell: string_list.h has:
>
> #ifndef PSPELL_STRING_MAP__H
> #define PSPELL_STRING_MAP__H
>
> at the top to prevent multiple compilation... why is it
> "PSPELL_STRING_MAP__H" which is the same as string_map.h?? This causes
> compile problems.
>
> It should be changed to PSPELL_STRING_LIST__H to make things clear.
Yes it should. My mistake. This is already fixed.
You are more than welcome to submit patches. I will either accept them or
reject them. I will accept the patches if they are clean and do not cause
anything else to break.
---
Kevin Atkinson
kevina at users sourceforge net
http://metalab.unc.edu/kevina/