For$
<!-- begin site header -->
<div id=

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - louisdx

Pages: [1]
1
I changed the compiler flags to "-W -Wall -pedantic", and was immediately inundated in warnings. I believe that serious, robust server design should try to be as clean and correct as possible at all levels, so I am hoping that you will forgive my pedantry.

I would like to propose a change, mainly to "hook.h" (but also "plugin_api.*") which will entail many changed lines, but just one conceptual modification, so kindly bear with me:

I would like to replace the void* which is used to store function pointers the m_callbacks vector by a genuine void function pointer:

Code: [Select]
typedef void (voidF*)();
typedef std::pair<void*, voidF> callbackType

Every instance of "void* function" has to be replaced by "voidF function", but the change is straight-forward. It works like a charm in my fork.

Rationale: The C++ standard prohibits using object pointers to store function pointers. With this change the code will be more standard conforming and thus more portable. Also, it is philosophically The Right Thing ;-)

Slightly unrelatedly, "hook.h" is HUGE -- how is your position on switching to C++0x, so we could use variadic templates?

2
Development / Basic questions about the development process
« on: April 01, 2011, 12:47:41 am »
Hi - I just had a quick browse through your source, and I was wondering how one could contribute. Do you accept patch submissions, or would it be at all useful if I post small comments?

A quick question to begin: How complete is your knowledge of the network protocol, and where is it documented?

OK. Just looking at src/mineserver.h/cpp I have some very minor suggestions:

  • mineserver.h doesn't seem to use the <set> and <iostream> headers; those can go.
  • mineserver.cpp: in main(), you could move the declaration of "arg" inside the loop: "std::string arg(argv)". On the other hand, using getopt.h would probably be an even better approach (one could include a portable version for non-POSIX targets).
  • mineserver.cpp: With std::tr1 you have access to a few very good standardized random number generators, might be worth checking out.
  • Across other header files, there's a mix between deprecated and modern C headers, <string.h> vs. <cstring> etc. Might be nice to make that uniform.

It'd be great to see this project succeed!

Pages: [1]