IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
This patch makes Samba compile cleanly with -Wwrite-strings.
- That is, all string literals are marked as 'const'. These strings are
always read only, this just marks them as such for passing to other functions.
What is most supprising is that I didn't need to change more than a few lines of code (all
in 'net', which got a small cleanup of net.h and extern variables). The rest
is just adding a lot of 'const'.
As far as I can tell, I have not added any new warnings - apart from making all
of tdbutil.c's function const (so they warn for adding that const string to
struct).
Andrew Bartlett
know that 'make proto' will ignore them there. The debugparse.h header
file is included in includes.h, and includes.h is included in debugparse.c,
so all of the pieces "see" each other. I've compiled and tested this,
and it does seem to work. It's the same compromise model I used when
adding the ubiqx modules into the system, which is why I put it all into
the same directory.
Chris -)-----
*Not* the usual. I did make proto to add the #ifndef..#endif block.
Just to be safe, I did a cvs diff and found no prototype changes.
ubiqx/sys_includes.h
More fudging. I want to use binary tree typdefs in nameserv.h, but
nameserv.h is included in includes.h which is included by all of the
ubiqx modules. The result is that the types are referenced before
they are declared. My solution is to prevent nameserv.h and proto.h
from being included in the ubiqx modules (where they are not needed
anyway).
Chris -)-----
header files used by the ubiqx modules, instead of being hidden in the .c
files. This would ensure that anything in includes.h would be "seen" by
the ubiqx headers. I also had to put an #ifdef around the includes for
ubi_SplayTree.h and ubi_Cache.h in includes.h to prevent the header of the
descendant type from being included before its parent type.
Chris -)-----
to something less hurried, simpler, and (I believe) more acceptable to
all. The ubi_*.c files all now #include sys_include.h which, for Samba,
contains only comments and the line
#include "../includes.h"
That will make sure that the Samba header is there, allows me to
distribute a different default header with the main ubiqx set, and allows
others to write their own sys_includes.h for their own purposes.
Thanks to Andrew and Jeremy for hammering this out with me.
Chris -)-----
include scheme. Removing them works around the problem. If someone
does need them sometime (can't imagine why, since the splay tree is
typically faster), let me know and we can work something else out.
Chris -)-----
#ifdef HAVE_INCLUDES_H
#include "../includes.h"
#endif
we want _all_ code in Samba to include this file to ensure that we can
override definitions, typedefs and includes in one place.
This header tries four different locations for a definition of NULL. If
NULL still hasn't been found, it defaults to ((void *)0). All of the
includes can be, essentially, overridden by defining NULL on the command
line, as in -DNULL=((void *)0). I have faith that this will avoid the
problem of NULL being in different places on different systems. If there
is a system out there that doesn't define NULL in any of the headers I've
included, then let me know *where* it's defined and I'll add another
header. Chris -)-----
Trees: Previously, the AVL node type was different than the node type used
in the BinTree and SplayTree modules. It requires an additional
field to maintain AVL balance information. I merged that field into
the base type (in ubi_BinTree.h) so that all three use the same
node type. On most systems this will have zero effect on the node
size, due to word alignment. The change allowed me to remove a
bigbunch of redundant code, which makes the AVL module smaller and
cleaner.
Linked Lists: I combined ubi_StackQueue into ubi_sLinkList. The interface
has changed a tiny bit. I added macros to ubi_dLinkList to round
it out a bit.
I have verified that the few Samba modules that use these tools (so far)
do not have any problems with the changes.
Chris -)-----
I'll be using the cache module to replace the name cache in mangle.c. The
new one should be much faster and should require less memory.
Another feature is that the cache size can be limited by the amount of
memory used in addition to the number of entries allowed. With the
current cache, the default is to allocate 12800 bytes representing 50
entries (256 bytes each). With the same amount of memory, I should be able
to load over around two hundred entries.
Changes to the AVL trees were minor (missing comments).
Chris -)-----
a better way to handle the node pointer array used in ubi_BinTree. The
change simplified the code a bigbunch. It also forced updates to all of
the binary tree modules. CRH
ubiqx/Makefile ubiqx/README.UBI
Added new modules to the Makefile. Changed the text of the README to
reflect the directory change.
Added Files:
ubiqx/ubi_AVLtree.c ubiqx/ubi_AVLtree.h
ubiqx/ubi_BinTree.c ubiqx/ubi_BinTree.h
ubiqx/ubi_SplayTree.c ubiqx/ubi_SplayTree.h
ubiqx/ubi_StackQueue.c ubiqx/ubi_StackQueue.h
ubiqx/ubi_sLinkList.c ubiqx/ubi_sLinkList.h
This is the remainder of the toolkit. A quick rundown:
sLinkList = A simple singly-linked list.
StackQueue = Implements both a stack and a queue.
dLinkList = (Not added 'cause it's already there.) A doubly-linked list.
BinTree = Base level binary tree module. (No height balancing, just
the basics.)
AVLtree = Descendant type of BinTree. Implements a height-balanced
(AVL) binary tree.
SplayTree = Descendant type of BinTree. Implements a splay-balanced
binary tree.
Renamed Files:
ubiqx/COPYING.LGPL ==> ubiqx/COPYING.LIB
This matches the naming that GNU suggests.
don't know how to sort them.
make proto in each library directory. over-ride the make proto for ubiqx,
so that it doesn't happen, but throws up a warning instead.
I've added a very simple (and portable) method for having separate
source directories.
This should also help when we add directories for the various ports. A
unix directory would make sense.
and renamed it COPYING.LGPL. This is because the ubi_* files are under
LGPL, not regular GPL.
Removed the last few things from the ubiqx directory and deleted it.
This one will simply create an object file from each of the .c files
in the directory. These could be linked into a static library, but
I'm not sure that this is worthwhile. If anyone wants to improved on
what I've got here, please do! crh -)-----