Skip to content

Commit

Permalink
Merge pull request #131 from gonmf/code-review
Browse files Browse the repository at this point in the history
Merge of version 1.25
  • Loading branch information
gonmf authored Oct 1, 2017
2 parents a45a695 + 7b2c2d7 commit 3ecd35c
Show file tree
Hide file tree
Showing 92 changed files with 115 additions and 490 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ compiler:
- gcc

script:
- mv -fT src/inc/matilda.h-test src/inc/matilda.h
- mv -fT src/inc/config.h-test src/inc/config.h
- make -C src
- cd src
- ./test
Expand Down
8 changes: 0 additions & 8 deletions GTP_README
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ Arguments: none
Fails: never


mtld-ponder -- returns description of the state of the game and possible
followups.
Arguments: time available to think, in seconds
Fails: never


mtld-review_game -- returns description of the quality of the moves played and
the best moves quality.
Arguments: time available to think (per turn), in seconds
Expand All @@ -116,5 +110,3 @@ Fails: syntax error
exit -- alias to quit command.
Arguments: none
Fails: never


2 changes: 1 addition & 1 deletion INSTALLING
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ On macOS do not use the default Xcode clang -- it does not support OpenMP.
Instead install through brew clang-omp, and override the compiler to be used
in src/Makefile.

Before compiling, review the contents of the file src/inc/matilda.h for your
Before compiling, review the contents of the file src/inc/config.h for your
system. Remember to edit the line

#define UCT_MEMORY 512
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ System Requirements
- C99 compiler suite with support for OpenMP 3.0 (like GCC or clang)

Before using read the INSTALL file carefully, and at least modify the file
src/inc/matilda.h to your taste.
src/inc/config.h to your taste.


How to
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ stronger in smaller boards than in larger ones.
- C99 compiler suite with support for OpenMP 3.0 (like GCC or clang)

Before using read the INSTALL file carefully, and at least modify the file
src/inc/matilda.h to your taste.
src/inc/config.h to your taste.

**How to**

Expand Down
1 change: 1 addition & 0 deletions clop/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ clop-console
*.log
*.lock
tmp/
.tmp/
2 changes: 1 addition & 1 deletion kgs/README
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ To start matilda, edit the configuration files (casual or tournament) and obtain
the latest version of kgsGTP, from https://www.gokgs.com/download.jsp.

To prevent timeouts the network latency compensation settings should be set
accordingly, in the matilda configuration (src/matilda.h).
accordingly, in the matilda configuration (src/config.h).
6 changes: 3 additions & 3 deletions src/README
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ Configuration

Most things can be either set via command line flags, GTP commands or C
preprocessor definitions. The most common symbols that are defined in
preprocessor definitions are found in the file inc/matilda.h
preprocessor definitions are found in the file inc/config.h

The file inc/matilda.h is special. It must not include anything and should be
The file inc/config.h is special. It must not include anything and should be
included prior to everything else for the potential to enable or disable
assertions and other debugging checks.

Expand All @@ -54,7 +54,7 @@ Project conventions/guidelines
5. There shouldn't be a "God import", where a single file imports all header
files.
6. The structure of a C file is (in order): short description of its function,
matilda.h include, C library includes, 3rd party includes, local includes,
config.h include, C library includes, 3rd party includes, local includes,
public symbol declaration, extern symbol declaration, static symbol
declaration and finally function declarations. Static symbol declarations
may also be kept close to functions that will use them for clarity.
Expand Down
12 changes: 6 additions & 6 deletions src/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ These are meant to inexpensively allocate buffers for string operations.
They are thread-safe, fast, with canary values used (in debug mode) to ensure
memory is correctly freed and written to.
If you are need to perform recursive operations then use malloc/free. Releasing
these buffers does not actually free the underlying memory to be used by other
programs.
If you need to perform recursive operations then use malloc/free. Releasing
these buffers does not free the underlying memory to be used by other programs.
*/

#include "matilda.h"
#include "config.h"

#include <stdio.h>
#include <stdlib.h>
Expand Down Expand Up @@ -125,8 +124,9 @@ Releases a previously allocated block of memory, to be used again in later
calls. Does not free the memory.
Thread-safe.
*/
void release(void * ptr)
{
void release(
void * ptr
){
#if !MATILDA_RELEASE_MODE
/* canaries -- detection of out of bounds writes */
u8 * s = (u8 *)ptr;
Expand Down
214 changes: 0 additions & 214 deletions src/analysis.c

This file was deleted.

6 changes: 2 additions & 4 deletions src/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ For a more advanced board representation check the CFG representation
(cfg_board.c and cfg_board.h).
*/

#include "matilda.h"
#include "config.h"

#include <string.h>
#include <stdlib.h>
Expand Down Expand Up @@ -287,7 +287,7 @@ void reduce_fixed(
/*
Performs the inverse operation of reduction of a given reduce code.
*/
void oboard_revert_reduce(
void out_board_revert_reduce(
out_board * b,
d8 method
){
Expand Down Expand Up @@ -327,5 +327,3 @@ void oboard_revert_reduce(
}
memcpy(b, &r, sizeof(out_board));
}


2 changes: 1 addition & 1 deletion src/board_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
More board functions related to cleaning and outputing board states.
*/

#include "matilda.h"
#include "config.h"

#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/cfg_board.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Just like in the rest of the source code, all functions are not thread unless
explicitly said so.
*/

#include "matilda.h"
#include "config.h"

#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion src/cfg_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Collection of functions over a CFG boars structure that are not related to
actual state changes nor tactical evaluation; though they may still be useful.
*/

#include "matilda.h"
#include "config.h"

#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion src/constants.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ move_seq nei_dst_4[TOTAL_BOARD_SIZ];
u8 active_bits_in_byte[256];
*/

#include "matilda.h"
#include "config.h"

#include <stdlib.h>
#include <string.h>
Expand Down
2 changes: 1 addition & 1 deletion src/crc32.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ distribution with a compatible license. No permission was asked or given by the
original authors. For licensing enquiries contact the authors of matilda.
*/

#include "matilda.h"
#include "config.h"

#include "types.h"

Expand Down
Loading

0 comments on commit 3ecd35c

Please sign in to comment.