From e30dd73ee55ca26558288b37cf79198a97c3b938 Mon Sep 17 00:00:00 2001 From: Vic Luo Date: Thu, 1 Sep 2016 14:05:37 +0800 Subject: [PATCH 1/2] Correct import guard macro name --- include/2darray.h | 4 ++-- include/8queen.h | 6 +++--- include/astar.h | 4 ++-- include/avl.h | 4 ++-- include/bellman_ford.h | 4 ++-- include/binary_search_tree.h | 4 ++-- include/bitset.h | 4 ++-- include/bloom_filter.h | 4 ++-- include/btree.h | 4 ++-- include/dijkstra.h | 4 ++-- include/directed_graph.h | 4 ++-- include/disjoint-set.h | 4 ++-- include/dos_tree.h | 4 ++-- include/double_linked_list.h | 4 ++-- include/edmonds_karp.h | 4 ++-- include/fenwick_tree.h | 4 ++-- include/fib-heap.h | 4 ++-- include/generic.h | 4 ++-- include/graph_defs.h | 4 ++-- include/graph_search.h | 4 ++-- include/hash_code.h | 4 ++-- include/hash_multi.h | 4 ++-- include/hash_string.h | 4 ++-- include/hash_table.h | 4 ++-- include/heap.h | 4 ++-- include/huffman.h | 4 ++-- include/imath.h | 4 ++-- include/insertion_sort.h | 4 ++-- include/integer.h | 4 ++-- include/interval_tree.h | 4 ++-- include/k-means.h | 4 ++-- include/kmp.h | 4 ++-- include/kruskal_mst.h | 4 ++-- include/lcs.h | 4 ++-- include/md5.h | 4 ++-- include/merge_sort.h | 4 ++-- include/perfect_hash.h | 4 ++-- include/prim_mst.h | 4 ++-- include/prime.h | 4 ++-- include/priority_queue.h | 4 ++-- include/queue.h | 4 ++-- include/quick_sort.h | 4 ++-- include/radix_sort.h | 4 ++-- include/random.h | 4 ++-- include/random_select.h | 4 ++-- include/rbtree.h | 4 ++-- include/rbtree_defs.h | 4 ++-- include/relabel_to_front.h | 4 ++-- include/scc.h | 4 ++-- include/selection_sort.h | 6 +++--- include/sha1.h | 4 ++-- include/shell_sort.h | 4 ++-- include/shuffle.h | 4 ++-- include/simhash.h | 4 ++-- include/skiplist.h | 4 ++-- include/sol.h | 4 ++-- include/stack.h | 4 ++-- include/suffix_array.h | 6 +++--- include/trie.h | 4 ++-- include/undirected_graph.h | 4 ++-- include/universal_hash.h | 4 ++-- include/word_seg.h | 4 ++-- msvc/alg_vs.h | 6 +++--- utils/byteorder.h | 4 ++-- utils/gb18030.h | 4 ++-- 65 files changed, 134 insertions(+), 134 deletions(-) diff --git a/include/2darray.h b/include/2darray.h index 1383e242..929a286a 100644 --- a/include/2darray.h +++ b/include/2darray.h @@ -10,8 +10,8 @@ * Simulated by 1-dimension array. ******************************************************************************/ -#ifndef __2D_ARRAY_H__ -#define __2D_ARRAY_H__ +#ifndef 2D_ARRAY_H__ +#define 2D_ARRAY_H__ #include #include diff --git a/include/8queen.h b/include/8queen.h index 27062e3a..17eaefef 100644 --- a/include/8queen.h +++ b/include/8queen.h @@ -9,8 +9,8 @@ * http://en.wikipedia.org/wiki/Eight_queens_puzzle ******************************************************************************/ -#ifndef __8QUEEN_H__ -#define __8QUEEN_H__ +#ifndef 8QUEEN_H__ +#define 8QUEEN_H__ #include #include @@ -84,4 +84,4 @@ namespace alg { }; } -#endif //__8QUEEN_H__ +#endif //8QUEEN_H__ diff --git a/include/astar.h b/include/astar.h index 03474b34..6dc68f02 100644 --- a/include/astar.h +++ b/include/astar.h @@ -19,8 +19,8 @@ * ******************************************************************************/ -#ifndef __ASTAR_H__ -#define __ASTAR_H__ +#ifndef ASTAR_H__ +#define ASTAR_H__ #include #include diff --git a/include/avl.h b/include/avl.h index 4b8f00cd..aa1ef6ca 100644 --- a/include/avl.h +++ b/include/avl.h @@ -19,8 +19,8 @@ * ******************************************************************************/ -#ifndef __AVL_H__ -#define __AVL_H__ +#ifndef AVL_H__ +#define AVL_H__ #include #include diff --git a/include/bellman_ford.h b/include/bellman_ford.h index 2d6df417..d859d72a 100644 --- a/include/bellman_ford.h +++ b/include/bellman_ford.h @@ -44,8 +44,8 @@ * ******************************************************************************/ -#ifndef __BELLMAN_FORD_H__ -#define __BELLMAN_FORD_H__ +#ifndef BELLMAN_FORD_H__ +#define BELLMAN_FORD_H__ #include #include diff --git a/include/binary_search_tree.h b/include/binary_search_tree.h index 2fc544c0..254cb0f2 100644 --- a/include/binary_search_tree.h +++ b/include/binary_search_tree.h @@ -18,8 +18,8 @@ * ******************************************************************************/ -#ifndef __BINARY_SEARCH_TREE_H__ -#define __BINARY_SEARCH_TREE_H__ +#ifndef BINARY_SEARCH_TREE_H__ +#define BINARY_SEARCH_TREE_H__ #include #include diff --git a/include/bitset.h b/include/bitset.h index 83171c12..fd6ae57b 100644 --- a/include/bitset.h +++ b/include/bitset.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef __BIT_SET_H__ -#define __BIT_SET_H__ +#ifndef BIT_SET_H__ +#define BIT_SET_H__ #include #include diff --git a/include/bloom_filter.h b/include/bloom_filter.h index 810badd5..952d44ab 100644 --- a/include/bloom_filter.h +++ b/include/bloom_filter.h @@ -18,8 +18,8 @@ * ******************************************************************************/ -#ifndef __BLOOM_FILTER_H__ -#define __BLOOM_FILTER_H__ +#ifndef BLOOM_FILTER_H__ +#define BLOOM_FILTER_H__ #include #include diff --git a/include/btree.h b/include/btree.h index bec96048..5f50b6e2 100644 --- a/include/btree.h +++ b/include/btree.h @@ -24,8 +24,8 @@ * http://en.wikipedia.org/wiki/B-tree ******************************************************************************/ -#ifndef __BTREE_H__ -#define __BTREE_H__ +#ifndef BTREE_H__ +#define BTREE_H__ #include #include diff --git a/include/dijkstra.h b/include/dijkstra.h index 5013f14f..73b6c2ee 100644 --- a/include/dijkstra.h +++ b/include/dijkstra.h @@ -19,8 +19,8 @@ * ******************************************************************************/ -#ifndef __DIJKSTRA_H__ -#define __DIJKSTRA_H__ +#ifndef DIJKSTRA_H__ +#define DIJKSTRA_H__ #include #include diff --git a/include/directed_graph.h b/include/directed_graph.h index 0eb8e56e..7694e5a3 100644 --- a/include/directed_graph.h +++ b/include/directed_graph.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef __DIRECTED_GRAPH_H__ -#define __DIRECTED_GRAPH_H__ +#ifndef DIRECTED_GRAPH_H__ +#define DIRECTED_GRAPH_H__ #include #include diff --git a/include/disjoint-set.h b/include/disjoint-set.h index c13a002e..1d1568c4 100644 --- a/include/disjoint-set.h +++ b/include/disjoint-set.h @@ -18,8 +18,8 @@ * http://en.wikipedia.org/wiki/Disjoint-set_data_structure ******************************************************************************/ -#ifndef __DISJOINTSET_H__ -#define __DISJOINTSET_H__ +#ifndef DISJOINTSET_H__ +#define DISJOINTSET_H__ namespace alg { template diff --git a/include/dos_tree.h b/include/dos_tree.h index 7440990f..f754f180 100644 --- a/include/dos_tree.h +++ b/include/dos_tree.h @@ -16,8 +16,8 @@ * ******************************************************************************/ -#ifndef __DOS_TREE_H__ -#define __DOS_TREE_H__ +#ifndef DOS_TREE_H__ +#define DOS_TREE_H__ #include #include diff --git a/include/double_linked_list.h b/include/double_linked_list.h index 7b8a8637..be595e7e 100644 --- a/include/double_linked_list.h +++ b/include/double_linked_list.h @@ -16,8 +16,8 @@ * http://en.wikipedia.org/wiki/Double_linked_list ******************************************************************************/ -#ifndef __DOUBLE_LINKED_LIST_H__ -#define __DOUBLE_LINKED_LIST_H__ +#ifndef DOUBLE_LINKED_LIST_H__ +#define DOUBLE_LINKED_LIST_H__ struct list_head { struct list_head *next, *prev; diff --git a/include/edmonds_karp.h b/include/edmonds_karp.h index 396c9fbc..f9ca4b56 100644 --- a/include/edmonds_karp.h +++ b/include/edmonds_karp.h @@ -21,8 +21,8 @@ * ******************************************************************************/ -#ifndef __EDMONDS_KARP_H__ -#define __EDMONDS_KARP_H__ +#ifndef EDMONDS_KARP_H__ +#define EDMONDS_KARP_H__ #include #include diff --git a/include/fenwick_tree.h b/include/fenwick_tree.h index e92d1ab5..cc12d602 100644 --- a/include/fenwick_tree.h +++ b/include/fenwick_tree.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef __FENWICK_H__ -#define __FENWICK_H__ +#ifndef FENWICK_H__ +#define FENWICK_H__ #include diff --git a/include/fib-heap.h b/include/fib-heap.h index 68100b8b..b5303bf6 100644 --- a/include/fib-heap.h +++ b/include/fib-heap.h @@ -17,8 +17,8 @@ * http://en.wikipedia.org/wiki/Fibonacci_heap ******************************************************************************/ -#ifndef __FIB_HEAP_H__ -#define __FIB_HEAP_H__ +#ifndef FIB_HEAP_H__ +#define FIB_HEAP_H__ #include #include #include diff --git a/include/generic.h b/include/generic.h index 8671f740..16d50e84 100644 --- a/include/generic.h +++ b/include/generic.h @@ -9,8 +9,8 @@ * ******************************************************************************/ -#ifndef __ALG_INC_H__ -#define __ALG_INC_H__ +#ifndef ALG_INC_H__ +#define ALG_INC_H__ #include #include #include diff --git a/include/graph_defs.h b/include/graph_defs.h index 8860c9b1..f2b61ada 100644 --- a/include/graph_defs.h +++ b/include/graph_defs.h @@ -1,5 +1,5 @@ -#ifndef __GRAPH_DEFS_H__ -#define __GRAPH_DEFS_H__ +#ifndef GRAPH_DEFS_H__ +#define GRAPH_DEFS_H__ #include "double_linked_list.h" diff --git a/include/graph_search.h b/include/graph_search.h index 438ea660..7605aed6 100644 --- a/include/graph_search.h +++ b/include/graph_search.h @@ -20,8 +20,8 @@ * ******************************************************************************/ -#ifndef __BREADTH_FIRST_SEARCH_H__ -#define __BREADTH_FIRST_SEARCH_H__ +#ifndef BREADTH_FIRST_SEARCH_H__ +#define BREADTH_FIRST_SEARCH_H__ #include #include diff --git a/include/hash_code.h b/include/hash_code.h index 89f22b2b..7773a108 100644 --- a/include/hash_code.h +++ b/include/hash_code.h @@ -1,5 +1,5 @@ -#ifndef __HASH_CODE_H__ -#define __HASH_CODE_H__ +#ifndef HASH_CODE_H__ +#define HASH_CODE_H__ #include #include "hash_string.h" namespace alg { diff --git a/include/hash_multi.h b/include/hash_multi.h index 4639e229..73040cef 100644 --- a/include/hash_multi.h +++ b/include/hash_multi.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef __HASH_MULTIPLICATION_H__ -#define __HASH_MULTIPLICATION_H__ +#ifndef HASH_MULTIPLICATION_H__ +#define HASH_MULTIPLICATION_H__ #include #include diff --git a/include/hash_string.h b/include/hash_string.h index 52d1b7cf..9a95d4fa 100644 --- a/include/hash_string.h +++ b/include/hash_string.h @@ -12,8 +12,8 @@ * ******************************************************************************/ -#ifndef __STRING_HASH_H__ -#define __STRING_HASH_H__ +#ifndef STRING_HASH_H__ +#define STRING_HASH_H__ #include diff --git a/include/hash_table.h b/include/hash_table.h index 1c5abd6e..9ed41eb3 100644 --- a/include/hash_table.h +++ b/include/hash_table.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef __HASH_TABLE_H__ -#define __HASH_TABLE_H__ +#ifndef HASH_TABLE_H__ +#define HASH_TABLE_H__ #include #include diff --git a/include/heap.h b/include/heap.h index 351ba0db..dec4f9bc 100644 --- a/include/heap.h +++ b/include/heap.h @@ -28,8 +28,8 @@ * http://en.wikipedia.org/wiki/Binary_heap ******************************************************************************/ -#ifndef __HEAP_H__ -#define __HEAP_H__ +#ifndef HEAP_H__ +#define HEAP_H__ #include #include diff --git a/include/huffman.h b/include/huffman.h index b47a4d12..c95fc9b5 100644 --- a/include/huffman.h +++ b/include/huffman.h @@ -21,8 +21,8 @@ * ******************************************************************************/ -#ifndef __HUFFMAN_CODING_H__ -#define __HUFFMAN_CODING_H__ +#ifndef HUFFMAN_CODING_H__ +#define HUFFMAN_CODING_H__ #include #include diff --git a/include/imath.h b/include/imath.h index 6a23ab52..00e1e472 100644 --- a/include/imath.h +++ b/include/imath.h @@ -9,8 +9,8 @@ * ******************************************************************************/ -#ifndef __IMATH_H__ -#define __IMATH_H__ +#ifndef IMATH_H__ +#define IMATH_H__ #include #include diff --git a/include/insertion_sort.h b/include/insertion_sort.h index 42427e4b..8fcf6f42 100644 --- a/include/insertion_sort.h +++ b/include/insertion_sort.h @@ -13,8 +13,8 @@ * ******************************************************************************/ -#ifndef __INSERTION_SORT_H__ -#define __INSERTION_SORT_H__ +#ifndef INSERTION_SORT_H__ +#define INSERTION_SORT_H__ namespace alg { /** diff --git a/include/integer.h b/include/integer.h index f177d5ad..3c8e7d1b 100644 --- a/include/integer.h +++ b/include/integer.h @@ -12,8 +12,8 @@ * ******************************************************************************/ -#ifndef __INTEGER_H__ -#define __INTEGER_H__ +#ifndef INTEGER_H__ +#define INTEGER_H__ #include #include diff --git a/include/interval_tree.h b/include/interval_tree.h index c4edca19..5b6848e2 100644 --- a/include/interval_tree.h +++ b/include/interval_tree.h @@ -16,8 +16,8 @@ * ******************************************************************************/ -#ifndef __INTERVAL_TREE_H__ -#define __INTERVAL_TREE_H__ +#ifndef INTERVAL_TREE_H__ +#define INTERVAL_TREE_H__ #include #include diff --git a/include/k-means.h b/include/k-means.h index 953430de..966c085e 100644 --- a/include/k-means.h +++ b/include/k-means.h @@ -12,8 +12,8 @@ * https://github.com/wycg1984 ******************************************************************************/ -#ifndef __KMEANS_H__ -#define __KMEANS_H__ +#ifndef KMEANS_H__ +#define KMEANS_H__ #include #include #include diff --git a/include/kmp.h b/include/kmp.h index ada982a1..acb38297 100644 --- a/include/kmp.h +++ b/include/kmp.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef __KMP_H__ -#define __KMP_H__ +#ifndef KMP_H__ +#define KMP_H__ #include namespace alg { diff --git a/include/kruskal_mst.h b/include/kruskal_mst.h index d6ed961e..b4f8078e 100644 --- a/include/kruskal_mst.h +++ b/include/kruskal_mst.h @@ -25,8 +25,8 @@ * By Contibutor:xmuliang ******************************************************************************/ -#ifndef __KRUSKAL_MST_H__ -#define __KRUSKAL_MST_H__ +#ifndef KRUSKAL_MST_H__ +#define KRUSKAL_MST_H__ #include #include diff --git a/include/lcs.h b/include/lcs.h index a3c3e9d9..93d6fa5f 100644 --- a/include/lcs.h +++ b/include/lcs.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef __LCS_H__ -#define __LCS_H__ +#ifndef LCS_H__ +#define LCS_H__ #include "generic.h" #include "2darray.h" diff --git a/include/md5.h b/include/md5.h index 5ff52525..3d8c1410 100644 --- a/include/md5.h +++ b/include/md5.h @@ -23,8 +23,8 @@ */ -#ifndef __MD5_H__ -#define __MD5_H__ +#ifndef MD5_H__ +#define MD5_H__ #include /* Data structure for MD5 (Message Digest) computation */ diff --git a/include/merge_sort.h b/include/merge_sort.h index 5eab291d..519c19a2 100644 --- a/include/merge_sort.h +++ b/include/merge_sort.h @@ -32,8 +32,8 @@ * ******************************************************************************/ -#ifndef __MERGE_SORT_H__ -#define __MERGE_SORT_H__ +#ifndef MERGE_SORT_H__ +#define MERGE_SORT_H__ namespace alg { /** diff --git a/include/perfect_hash.h b/include/perfect_hash.h index 52dd9801..28b23191 100644 --- a/include/perfect_hash.h +++ b/include/perfect_hash.h @@ -10,8 +10,8 @@ * http://en.wikipedia.org/wiki/Perfect_hash * ******************************************************************************/ -#ifndef __PERFECT_HASH_H__ -#define __PERFECT_HASH_H__ +#ifndef PERFECT_HASH_H__ +#define PERFECT_HASH_H__ #include #include #include diff --git a/include/prim_mst.h b/include/prim_mst.h index 3949e895..97d8e0a7 100644 --- a/include/prim_mst.h +++ b/include/prim_mst.h @@ -22,8 +22,8 @@ * ******************************************************************************/ -#ifndef __PRIM_MST_H__ -#define __PRIM_MST_H__ +#ifndef PRIM_MST_H__ +#define PRIM_MST_H__ #include #include diff --git a/include/prime.h b/include/prime.h index 81f772e4..593fb81a 100644 --- a/include/prime.h +++ b/include/prime.h @@ -11,8 +11,8 @@ * http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test * ******************************************************************************/ -#ifndef __PRIME_H__ -#define __PRIME_H__ +#ifndef PRIME_H__ +#define PRIME_H__ #include #include diff --git a/include/priority_queue.h b/include/priority_queue.h index e81edf35..10214a83 100644 --- a/include/priority_queue.h +++ b/include/priority_queue.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef __PRIORITY_QUEUE_H__ -#define __PRIORITY_QUEUE_H__ +#ifndef PRIORITY_QUEUE_H__ +#define PRIORITY_QUEUE_H__ #include #include diff --git a/include/queue.h b/include/queue.h index 1de7b292..7e322aec 100644 --- a/include/queue.h +++ b/include/queue.h @@ -13,8 +13,8 @@ * ******************************************************************************/ -#ifndef __QUEUE_H__ -#define __QUEUE_H__ +#ifndef QUEUE_H__ +#define QUEUE_H__ #include #include diff --git a/include/quick_sort.h b/include/quick_sort.h index b8962216..936d0860 100644 --- a/include/quick_sort.h +++ b/include/quick_sort.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef __QUICKSORT_H__ -#define __QUICKSORT_H__ +#ifndef QUICKSORT_H__ +#define QUICKSORT_H__ #include diff --git a/include/radix_sort.h b/include/radix_sort.h index 4272ce48..16298355 100644 --- a/include/radix_sort.h +++ b/include/radix_sort.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef __RADIX_SORT_H__ -#define __RADIX_SORT_H__ +#ifndef RADIX_SORT_H__ +#define RADIX_SORT_H__ #include #include diff --git a/include/random.h b/include/random.h index 456ab698..2ae56aa3 100644 --- a/include/random.h +++ b/include/random.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef __RANDOM_H__ -#define __RANDOM_H__ +#ifndef RANDOM_H__ +#define RANDOM_H__ #include #include diff --git a/include/random_select.h b/include/random_select.h index 3577bdd9..500d0c9a 100644 --- a/include/random_select.h +++ b/include/random_select.h @@ -17,8 +17,8 @@ * ******************************************************************************/ -#ifndef __RANDOM_SELECT_H__ -#define __RANDOM_SELECT_H__ +#ifndef RANDOM_SELECT_H__ +#define RANDOM_SELECT_H__ #include diff --git a/include/rbtree.h b/include/rbtree.h index c9b8a318..bace1061 100644 --- a/include/rbtree.h +++ b/include/rbtree.h @@ -15,8 +15,8 @@ * http://en.literateprograms.org/Red-black_tree_(C) ******************************************************************************/ -#ifndef __RBTREE_H__ -#define __RBTREE_H__ +#ifndef RBTREE_H__ +#define RBTREE_H__ #include #include #include diff --git a/include/rbtree_defs.h b/include/rbtree_defs.h index ab5ef4ea..00395bb4 100644 --- a/include/rbtree_defs.h +++ b/include/rbtree_defs.h @@ -15,8 +15,8 @@ * http://en.literateprograms.org/Red-black_tree_(C) ******************************************************************************/ -#ifndef __RBTREE_DEFS_H__ -#define __RBTREE_DEFS_H__ +#ifndef RBTREE_DEFS_H__ +#define RBTREE_DEFS_H__ #include #include diff --git a/include/relabel_to_front.h b/include/relabel_to_front.h index c8a4d950..8e1ecf37 100644 --- a/include/relabel_to_front.h +++ b/include/relabel_to_front.h @@ -9,8 +9,8 @@ * * */ -#ifndef __RELABEL_TO_FRONT_H__ -#define __RELABEL_TO_FRONT_H__ +#ifndef RELABEL_TO_FRONT_H__ +#define RELABEL_TO_FRONT_H__ #include #include diff --git a/include/scc.h b/include/scc.h index 1d641a1b..5e4b9f44 100644 --- a/include/scc.h +++ b/include/scc.h @@ -17,8 +17,8 @@ * http://en.wikipedia.org/wiki/Strongly_connected_component ******************************************************************************/ -#ifndef __SCC_H__ -#define __SCC_H__ +#ifndef SCC_H__ +#define SCC_H__ #include #include #include diff --git a/include/selection_sort.h b/include/selection_sort.h index a956ad9a..b08f9d96 100644 --- a/include/selection_sort.h +++ b/include/selection_sort.h @@ -17,8 +17,8 @@ * http://en.wikipedia.org/wiki/Selection_sort ******************************************************************************/ -#ifndef __SELECTION_SORT_H__ -#define __SELECTION_SORT_H__ +#ifndef SELECTION_SORT_H__ +#define SELECTION_SORT_H__ #include #include @@ -49,4 +49,4 @@ namespace alg { } } -#endif //__SELECTION_SORT_H__ +#endif //SELECTION_SORT_H__ diff --git a/include/sha1.h b/include/sha1.h index 3079e20c..d68c0a4a 100644 --- a/include/sha1.h +++ b/include/sha1.h @@ -37,8 +37,8 @@ * http://en.wikipedia.org/wiki/SHA-1 */ -#ifndef __SHA1_H__ -#define __SHA1_H__ +#ifndef SHA1_H__ +#define SHA1_H__ #include diff --git a/include/shell_sort.h b/include/shell_sort.h index 22b04de9..c6a8c717 100644 --- a/include/shell_sort.h +++ b/include/shell_sort.h @@ -13,8 +13,8 @@ * ******************************************************************************/ -#ifndef __SHELL_SORT_H__ -#define __SHELL_SORT_H__ +#ifndef SHELL_SORT_H__ +#define SHELL_SORT_H__ namespace alg { /** diff --git a/include/shuffle.h b/include/shuffle.h index fe8b97ab..16f5deab 100644 --- a/include/shuffle.h +++ b/include/shuffle.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef __SHUFFLE_H__ -#define __SHUFFLE_H__ +#ifndef SHUFFLE_H__ +#define SHUFFLE_H__ #include #include diff --git a/include/simhash.h b/include/simhash.h index f68e9e58..d98b87c0 100644 --- a/include/simhash.h +++ b/include/simhash.h @@ -12,8 +12,8 @@ * ******************************************************************************/ -#ifndef __SIMHASH_H__ -#define __SIMHASH_H__ +#ifndef SIMHASH_H__ +#define SIMHASH_H__ #include #include diff --git a/include/skiplist.h b/include/skiplist.h index f45d4f33..e34d8f04 100644 --- a/include/skiplist.h +++ b/include/skiplist.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef __SKIP_LIST_H__ -#define __SKIP_LIST_H__ +#ifndef SKIP_LIST_H__ +#define SKIP_LIST_H__ #include #include #include diff --git a/include/sol.h b/include/sol.h index 070ee4c5..a2e148b5 100644 --- a/include/sol.h +++ b/include/sol.h @@ -16,8 +16,8 @@ * ******************************************************************************/ -#ifndef __SOL_H__ -#define __SOL_H__ +#ifndef SOL_H__ +#define SOL_H__ #include "double_linked_list.h" namespace alg { diff --git a/include/stack.h b/include/stack.h index acc75414..8b664f5e 100644 --- a/include/stack.h +++ b/include/stack.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef __STACK_H__ -#define __STACK_H__ +#ifndef STACK_H__ +#define STACK_H__ #include #include diff --git a/include/suffix_array.h b/include/suffix_array.h index c078bd0a..a47fe2fc 100644 --- a/include/suffix_array.h +++ b/include/suffix_array.h @@ -20,8 +20,8 @@ * AUTHOR: nowerzt@gmail.com ******************************************************************************/ -#ifndef __SUFFIX_ARRAY_H__ -#define __SUFFIX_ARRAY_H__ +#ifndef SUFFIX_ARRAY_H__ +#define SUFFIX_ARRAY_H__ #include #include @@ -100,4 +100,4 @@ namespace alg { } } -#endif // __SUFFIX_ARRAY_H__ +#endif // SUFFIX_ARRAY_H__ diff --git a/include/trie.h b/include/trie.h index c9990f28..ac253704 100644 --- a/include/trie.h +++ b/include/trie.h @@ -10,8 +10,8 @@ * http://en.wikipedia.org/wiki/Trie ******************************************************************************/ -#ifndef __TRIE_H__ -#define __TRIE_H__ +#ifndef TRIE_H__ +#define TRIE_H__ #include #include #include diff --git a/include/undirected_graph.h b/include/undirected_graph.h index 5570267c..c1e4cd08 100644 --- a/include/undirected_graph.h +++ b/include/undirected_graph.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef __UNDIRECTED_GRAPH_H__ -#define __UNDIRECTED_GRAPH_H__ +#ifndef UNDIRECTED_GRAPH_H__ +#define UNDIRECTED_GRAPH_H__ #include #include diff --git a/include/universal_hash.h b/include/universal_hash.h index 1b162857..1a8abe20 100644 --- a/include/universal_hash.h +++ b/include/universal_hash.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef __UNIVERSAL_HASH_H__ -#define __UNIVERSAL_HASH_H__ +#ifndef UNIVERSAL_HASH_H__ +#define UNIVERSAL_HASH_H__ #include #include diff --git a/include/word_seg.h b/include/word_seg.h index eb0f65c7..00528827 100644 --- a/include/word_seg.h +++ b/include/word_seg.h @@ -17,8 +17,8 @@ * ******************************************************************************/ -#ifndef __WORD_SEG_H__ -#define __WORD_SEG_H__ +#ifndef WORD_SEG_H__ +#define WORD_SEG_H__ #include #include diff --git a/msvc/alg_vs.h b/msvc/alg_vs.h index 13b5aa67..78e56b88 100644 --- a/msvc/alg_vs.h +++ b/msvc/alg_vs.h @@ -1,5 +1,5 @@ -#ifndef __ALGVS_H__ -#define __ALGVS_H__ +#ifndef ALGVS_H__ +#define ALGVS_H__ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS @@ -15,4 +15,4 @@ #define typeof decltype #endif//_MSC_VER -#endif//__ALGVS_H__ \ No newline at end of file +#endif//ALGVS_H__ \ No newline at end of file diff --git a/utils/byteorder.h b/utils/byteorder.h index ca2fada9..1cfcaca9 100644 --- a/utils/byteorder.h +++ b/utils/byteorder.h @@ -1,5 +1,5 @@ -#ifndef __BYTEORDER_H__ -#define __BYTEORDER_H__ +#ifndef BYTEORDER_H__ +#define BYTEORDER_H__ #include #include diff --git a/utils/gb18030.h b/utils/gb18030.h index 88d28e85..fdc2803d 100644 --- a/utils/gb18030.h +++ b/utils/gb18030.h @@ -1,5 +1,5 @@ -#ifndef __GB18030_H__ -#define __GB18030_H__ +#ifndef GB18030_H__ +#define GB18030_H__ /** * Read from the string encoded in GB18030 into WORD From b8b2ed5b72c9e8ab81d99c0e57999d7900f2a92e Mon Sep 17 00:00:00 2001 From: Vic Luo Date: Thu, 1 Sep 2016 14:14:36 +0800 Subject: [PATCH 2/2] Rename all identifiers with 2 underscores at the beginning --- include/2darray.h | 4 ++-- include/8queen.h | 6 +++--- include/astar.h | 4 ++-- include/avl.h | 4 ++-- include/bellman_ford.h | 4 ++-- include/binary_search_tree.h | 12 ++++++------ include/bitset.h | 4 ++-- include/bloom_filter.h | 4 ++-- include/btree.h | 4 ++-- include/dijkstra.h | 4 ++-- include/directed_graph.h | 4 ++-- include/disjoint-set.h | 4 ++-- include/dos_tree.h | 4 ++-- include/double_linked_list.h | 26 +++++++++++++------------- include/edmonds_karp.h | 4 ++-- include/fenwick_tree.h | 4 ++-- include/fib-heap.h | 4 ++-- include/generic.h | 4 ++-- include/graph_defs.h | 4 ++-- include/graph_search.h | 4 ++-- include/hash_code.h | 4 ++-- include/hash_multi.h | 4 ++-- include/hash_string.h | 4 ++-- include/hash_table.h | 4 ++-- include/heap.h | 4 ++-- include/huffman.h | 4 ++-- include/imath.h | 4 ++-- include/insertion_sort.h | 4 ++-- include/integer.h | 4 ++-- include/interval_tree.h | 4 ++-- include/k-means.h | 4 ++-- include/kmp.h | 4 ++-- include/kruskal_mst.h | 4 ++-- include/lcs.h | 4 ++-- include/max_subarray.h | 4 ++-- include/md5.h | 4 ++-- include/merge_sort.h | 8 ++++---- include/perfect_hash.h | 4 ++-- include/prim_mst.h | 4 ++-- include/prime.h | 4 ++-- include/priority_queue.h | 6 +++--- include/queue.h | 4 ++-- include/quick_sort.h | 8 ++++---- include/radix_sort.h | 14 +++++++------- include/random.h | 4 ++-- include/random_select.h | 8 ++++---- include/rbtree.h | 4 ++-- include/rbtree_defs.h | 4 ++-- include/relabel_to_front.h | 4 ++-- include/scc.h | 4 ++-- include/selection_sort.h | 6 +++--- include/sha1.h | 4 ++-- include/shell_sort.h | 4 ++-- include/shuffle.h | 4 ++-- include/simhash.h | 4 ++-- include/skiplist.h | 4 ++-- include/sol.h | 12 ++++++------ include/stack.h | 4 ++-- include/suffix_array.h | 6 +++--- include/trie.h | 4 ++-- include/undirected_graph.h | 4 ++-- include/universal_hash.h | 4 ++-- include/word_seg.h | 4 ++-- msvc/alg_vs.h | 6 +++--- src/lcs_demo.cpp | 6 +++--- utils/byteorder.h | 4 ++-- utils/gb18030.h | 4 ++-- 67 files changed, 170 insertions(+), 170 deletions(-) diff --git a/include/2darray.h b/include/2darray.h index 929a286a..2a565810 100644 --- a/include/2darray.h +++ b/include/2darray.h @@ -10,8 +10,8 @@ * Simulated by 1-dimension array. ******************************************************************************/ -#ifndef 2D_ARRAY_H__ -#define 2D_ARRAY_H__ +#ifndef ALGO_2D_ARRAY_H__ +#define ALGO_2D_ARRAY_H__ #include #include diff --git a/include/8queen.h b/include/8queen.h index 17eaefef..511ebe21 100644 --- a/include/8queen.h +++ b/include/8queen.h @@ -9,8 +9,8 @@ * http://en.wikipedia.org/wiki/Eight_queens_puzzle ******************************************************************************/ -#ifndef 8QUEEN_H__ -#define 8QUEEN_H__ +#ifndef ALGO_8QUEEN_H__ +#define ALGO_8QUEEN_H__ #include #include @@ -84,4 +84,4 @@ namespace alg { }; } -#endif //8QUEEN_H__ +#endif //ALGO_8QUEEN_H__ diff --git a/include/astar.h b/include/astar.h index 6dc68f02..a821488d 100644 --- a/include/astar.h +++ b/include/astar.h @@ -19,8 +19,8 @@ * ******************************************************************************/ -#ifndef ASTAR_H__ -#define ASTAR_H__ +#ifndef ALGO_ASTAR_H__ +#define ALGO_ASTAR_H__ #include #include diff --git a/include/avl.h b/include/avl.h index aa1ef6ca..697317ab 100644 --- a/include/avl.h +++ b/include/avl.h @@ -19,8 +19,8 @@ * ******************************************************************************/ -#ifndef AVL_H__ -#define AVL_H__ +#ifndef ALGO_AVL_H__ +#define ALGO_AVL_H__ #include #include diff --git a/include/bellman_ford.h b/include/bellman_ford.h index d859d72a..40771ae4 100644 --- a/include/bellman_ford.h +++ b/include/bellman_ford.h @@ -44,8 +44,8 @@ * ******************************************************************************/ -#ifndef BELLMAN_FORD_H__ -#define BELLMAN_FORD_H__ +#ifndef ALGO_BELLMAN_FORD_H__ +#define ALGO_BELLMAN_FORD_H__ #include #include diff --git a/include/binary_search_tree.h b/include/binary_search_tree.h index 254cb0f2..574914af 100644 --- a/include/binary_search_tree.h +++ b/include/binary_search_tree.h @@ -18,8 +18,8 @@ * ******************************************************************************/ -#ifndef BINARY_SEARCH_TREE_H__ -#define BINARY_SEARCH_TREE_H__ +#ifndef ALGO_BINARY_SEARCH_TREE_H__ +#define ALGO_BINARY_SEARCH_TREE_H__ #include #include @@ -57,7 +57,7 @@ namespace alg { BST():m_root(NULL){}; ~BST() { - __destruct(m_root); + destruct_(m_root); } /** @@ -159,10 +159,10 @@ namespace alg { } private: - void __destruct(treeNode *n) { + void destruct_(treeNode *n) { if (n==NULL) return; - __destruct(n->left); - __destruct(n->right); + destruct_(n->left); + destruct_(n->right); delete n; } diff --git a/include/bitset.h b/include/bitset.h index fd6ae57b..9e7b9bbc 100644 --- a/include/bitset.h +++ b/include/bitset.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef BIT_SET_H__ -#define BIT_SET_H__ +#ifndef ALGO_BIT_SET_H__ +#define ALGO_BIT_SET_H__ #include #include diff --git a/include/bloom_filter.h b/include/bloom_filter.h index 952d44ab..08253593 100644 --- a/include/bloom_filter.h +++ b/include/bloom_filter.h @@ -18,8 +18,8 @@ * ******************************************************************************/ -#ifndef BLOOM_FILTER_H__ -#define BLOOM_FILTER_H__ +#ifndef ALGO_BLOOM_FILTER_H__ +#define ALGO_BLOOM_FILTER_H__ #include #include diff --git a/include/btree.h b/include/btree.h index 5f50b6e2..6e17050f 100644 --- a/include/btree.h +++ b/include/btree.h @@ -24,8 +24,8 @@ * http://en.wikipedia.org/wiki/B-tree ******************************************************************************/ -#ifndef BTREE_H__ -#define BTREE_H__ +#ifndef ALGO_BTREE_H__ +#define ALGO_BTREE_H__ #include #include diff --git a/include/dijkstra.h b/include/dijkstra.h index 73b6c2ee..853376cc 100644 --- a/include/dijkstra.h +++ b/include/dijkstra.h @@ -19,8 +19,8 @@ * ******************************************************************************/ -#ifndef DIJKSTRA_H__ -#define DIJKSTRA_H__ +#ifndef ALGO_DIJKSTRA_H__ +#define ALGO_DIJKSTRA_H__ #include #include diff --git a/include/directed_graph.h b/include/directed_graph.h index 7694e5a3..9e46cfe0 100644 --- a/include/directed_graph.h +++ b/include/directed_graph.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef DIRECTED_GRAPH_H__ -#define DIRECTED_GRAPH_H__ +#ifndef ALGO_DIRECTED_GRAPH_H__ +#define ALGO_DIRECTED_GRAPH_H__ #include #include diff --git a/include/disjoint-set.h b/include/disjoint-set.h index 1d1568c4..be6bff7d 100644 --- a/include/disjoint-set.h +++ b/include/disjoint-set.h @@ -18,8 +18,8 @@ * http://en.wikipedia.org/wiki/Disjoint-set_data_structure ******************************************************************************/ -#ifndef DISJOINTSET_H__ -#define DISJOINTSET_H__ +#ifndef ALGO_DISJOINTSET_H__ +#define ALGO_DISJOINTSET_H__ namespace alg { template diff --git a/include/dos_tree.h b/include/dos_tree.h index f754f180..42689457 100644 --- a/include/dos_tree.h +++ b/include/dos_tree.h @@ -16,8 +16,8 @@ * ******************************************************************************/ -#ifndef DOS_TREE_H__ -#define DOS_TREE_H__ +#ifndef ALGO_DOS_TREE_H__ +#define ALGO_DOS_TREE_H__ #include #include diff --git a/include/double_linked_list.h b/include/double_linked_list.h index be595e7e..678c66b8 100644 --- a/include/double_linked_list.h +++ b/include/double_linked_list.h @@ -16,8 +16,8 @@ * http://en.wikipedia.org/wiki/Double_linked_list ******************************************************************************/ -#ifndef DOUBLE_LINKED_LIST_H__ -#define DOUBLE_LINKED_LIST_H__ +#ifndef ALGO_DOUBLE_LINKED_LIST_H__ +#define ALGO_DOUBLE_LINKED_LIST_H__ struct list_head { struct list_head *next, *prev; @@ -39,7 +39,7 @@ struct list_head { * the prev/next entries already! */ static inline void -__list_add(struct list_head *n, +list_add_(struct list_head *n, struct list_head *prev, struct list_head *next) { @@ -57,14 +57,14 @@ __list_add(struct list_head *n, * the prev/next entries already! */ static inline void -__list_del(struct list_head *prev, struct list_head *next) +list_del_(struct list_head *prev, struct list_head *next) { next->prev = prev; prev->next = next; } static inline void -__list_splice(struct list_head *list, struct list_head *head) +list_splice_(struct list_head *list, struct list_head *head) { struct list_head *first = list->next; struct list_head *last = list->prev; @@ -88,7 +88,7 @@ __list_splice(struct list_head *list, struct list_head *head) static inline void list_add(struct list_head *n, struct list_head *head) { - __list_add(n, head, head->next); + list_add_(n, head, head->next); } /** @@ -102,7 +102,7 @@ list_add(struct list_head *n, struct list_head *head) static inline void list_add_tail(struct list_head *n, struct list_head *head) { - __list_add(n, head->prev, head); + list_add_(n, head->prev, head); } /** @@ -113,7 +113,7 @@ list_add_tail(struct list_head *n, struct list_head *head) static inline void list_del(struct list_head *entry) { - __list_del(entry->prev, entry->next); + list_del_(entry->prev, entry->next); entry->next = NULL; entry->prev = NULL; } @@ -125,7 +125,7 @@ list_del(struct list_head *entry) static inline void list_del_init(struct list_head *entry) { - __list_del(entry->prev, entry->next); + list_del_(entry->prev, entry->next); INIT_LIST_HEAD(entry); } @@ -137,7 +137,7 @@ list_del_init(struct list_head *entry) static inline void list_move(struct list_head *list, struct list_head *head) { - __list_del(list->prev, list->next); + list_del_(list->prev, list->next); list_add(list, head); } @@ -149,7 +149,7 @@ list_move(struct list_head *list, struct list_head *head) static inline void list_move_tail(struct list_head *list, struct list_head *head) { - __list_del(list->prev, list->next); + list_del_(list->prev, list->next); list_add_tail(list, head); } @@ -172,7 +172,7 @@ static inline void list_splice(struct list_head *list, struct list_head *head) { if (!list_empty(list)) - __list_splice(list, head); + list_splice_(list, head); } /** @@ -186,7 +186,7 @@ static inline void list_splice_init(struct list_head *list, struct list_head *head) { if (!list_empty(list)) { - __list_splice(list, head); + list_splice_(list, head); INIT_LIST_HEAD(list); } } diff --git a/include/edmonds_karp.h b/include/edmonds_karp.h index f9ca4b56..295de725 100644 --- a/include/edmonds_karp.h +++ b/include/edmonds_karp.h @@ -21,8 +21,8 @@ * ******************************************************************************/ -#ifndef EDMONDS_KARP_H__ -#define EDMONDS_KARP_H__ +#ifndef ALGO_EDMONDS_KARP_H__ +#define ALGO_EDMONDS_KARP_H__ #include #include diff --git a/include/fenwick_tree.h b/include/fenwick_tree.h index cc12d602..4806536e 100644 --- a/include/fenwick_tree.h +++ b/include/fenwick_tree.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef FENWICK_H__ -#define FENWICK_H__ +#ifndef ALGO_FENWICK_H__ +#define ALGO_FENWICK_H__ #include diff --git a/include/fib-heap.h b/include/fib-heap.h index b5303bf6..44af130a 100644 --- a/include/fib-heap.h +++ b/include/fib-heap.h @@ -17,8 +17,8 @@ * http://en.wikipedia.org/wiki/Fibonacci_heap ******************************************************************************/ -#ifndef FIB_HEAP_H__ -#define FIB_HEAP_H__ +#ifndef ALGO_FIB_HEAP_H__ +#define ALGO_FIB_HEAP_H__ #include #include #include diff --git a/include/generic.h b/include/generic.h index 16d50e84..785e5078 100644 --- a/include/generic.h +++ b/include/generic.h @@ -9,8 +9,8 @@ * ******************************************************************************/ -#ifndef ALG_INC_H__ -#define ALG_INC_H__ +#ifndef ALGO_ALG_INC_H__ +#define ALGO_ALG_INC_H__ #include #include #include diff --git a/include/graph_defs.h b/include/graph_defs.h index f2b61ada..06e77be2 100644 --- a/include/graph_defs.h +++ b/include/graph_defs.h @@ -1,5 +1,5 @@ -#ifndef GRAPH_DEFS_H__ -#define GRAPH_DEFS_H__ +#ifndef ALGO_GRAPH_DEFS_H__ +#define ALGO_GRAPH_DEFS_H__ #include "double_linked_list.h" diff --git a/include/graph_search.h b/include/graph_search.h index 7605aed6..e0d18f4d 100644 --- a/include/graph_search.h +++ b/include/graph_search.h @@ -20,8 +20,8 @@ * ******************************************************************************/ -#ifndef BREADTH_FIRST_SEARCH_H__ -#define BREADTH_FIRST_SEARCH_H__ +#ifndef ALGO_BREADTH_FIRST_SEARCH_H__ +#define ALGO_BREADTH_FIRST_SEARCH_H__ #include #include diff --git a/include/hash_code.h b/include/hash_code.h index 7773a108..a310580c 100644 --- a/include/hash_code.h +++ b/include/hash_code.h @@ -1,5 +1,5 @@ -#ifndef HASH_CODE_H__ -#define HASH_CODE_H__ +#ifndef ALGO_HASH_CODE_H__ +#define ALGO_HASH_CODE_H__ #include #include "hash_string.h" namespace alg { diff --git a/include/hash_multi.h b/include/hash_multi.h index 73040cef..ec22f65f 100644 --- a/include/hash_multi.h +++ b/include/hash_multi.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef HASH_MULTIPLICATION_H__ -#define HASH_MULTIPLICATION_H__ +#ifndef ALGO_HASH_MULTIPLICATION_H__ +#define ALGO_HASH_MULTIPLICATION_H__ #include #include diff --git a/include/hash_string.h b/include/hash_string.h index 9a95d4fa..6eee926c 100644 --- a/include/hash_string.h +++ b/include/hash_string.h @@ -12,8 +12,8 @@ * ******************************************************************************/ -#ifndef STRING_HASH_H__ -#define STRING_HASH_H__ +#ifndef ALGO_STRING_HASH_H__ +#define ALGO_STRING_HASH_H__ #include diff --git a/include/hash_table.h b/include/hash_table.h index 9ed41eb3..72018610 100644 --- a/include/hash_table.h +++ b/include/hash_table.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef HASH_TABLE_H__ -#define HASH_TABLE_H__ +#ifndef ALGO_HASH_TABLE_H__ +#define ALGO_HASH_TABLE_H__ #include #include diff --git a/include/heap.h b/include/heap.h index dec4f9bc..d793cdab 100644 --- a/include/heap.h +++ b/include/heap.h @@ -28,8 +28,8 @@ * http://en.wikipedia.org/wiki/Binary_heap ******************************************************************************/ -#ifndef HEAP_H__ -#define HEAP_H__ +#ifndef ALGO_HEAP_H__ +#define ALGO_HEAP_H__ #include #include diff --git a/include/huffman.h b/include/huffman.h index c95fc9b5..50088b53 100644 --- a/include/huffman.h +++ b/include/huffman.h @@ -21,8 +21,8 @@ * ******************************************************************************/ -#ifndef HUFFMAN_CODING_H__ -#define HUFFMAN_CODING_H__ +#ifndef ALGO_HUFFMAN_CODING_H__ +#define ALGO_HUFFMAN_CODING_H__ #include #include diff --git a/include/imath.h b/include/imath.h index 00e1e472..b3fa2430 100644 --- a/include/imath.h +++ b/include/imath.h @@ -9,8 +9,8 @@ * ******************************************************************************/ -#ifndef IMATH_H__ -#define IMATH_H__ +#ifndef ALGO_IMATH_H__ +#define ALGO_IMATH_H__ #include #include diff --git a/include/insertion_sort.h b/include/insertion_sort.h index 8fcf6f42..eb9f58ef 100644 --- a/include/insertion_sort.h +++ b/include/insertion_sort.h @@ -13,8 +13,8 @@ * ******************************************************************************/ -#ifndef INSERTION_SORT_H__ -#define INSERTION_SORT_H__ +#ifndef ALGO_INSERTION_SORT_H__ +#define ALGO_INSERTION_SORT_H__ namespace alg { /** diff --git a/include/integer.h b/include/integer.h index 3c8e7d1b..1d5ff609 100644 --- a/include/integer.h +++ b/include/integer.h @@ -12,8 +12,8 @@ * ******************************************************************************/ -#ifndef INTEGER_H__ -#define INTEGER_H__ +#ifndef ALGO_INTEGER_H__ +#define ALGO_INTEGER_H__ #include #include diff --git a/include/interval_tree.h b/include/interval_tree.h index 5b6848e2..ec107364 100644 --- a/include/interval_tree.h +++ b/include/interval_tree.h @@ -16,8 +16,8 @@ * ******************************************************************************/ -#ifndef INTERVAL_TREE_H__ -#define INTERVAL_TREE_H__ +#ifndef ALGO_INTERVAL_TREE_H__ +#define ALGO_INTERVAL_TREE_H__ #include #include diff --git a/include/k-means.h b/include/k-means.h index 966c085e..86fdef3c 100644 --- a/include/k-means.h +++ b/include/k-means.h @@ -12,8 +12,8 @@ * https://github.com/wycg1984 ******************************************************************************/ -#ifndef KMEANS_H__ -#define KMEANS_H__ +#ifndef ALGO_KMEANS_H__ +#define ALGO_KMEANS_H__ #include #include #include diff --git a/include/kmp.h b/include/kmp.h index acb38297..d75d207b 100644 --- a/include/kmp.h +++ b/include/kmp.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef KMP_H__ -#define KMP_H__ +#ifndef ALGO_KMP_H__ +#define ALGO_KMP_H__ #include namespace alg { diff --git a/include/kruskal_mst.h b/include/kruskal_mst.h index b4f8078e..6db3458f 100644 --- a/include/kruskal_mst.h +++ b/include/kruskal_mst.h @@ -25,8 +25,8 @@ * By Contibutor:xmuliang ******************************************************************************/ -#ifndef KRUSKAL_MST_H__ -#define KRUSKAL_MST_H__ +#ifndef ALGO_KRUSKAL_MST_H__ +#define ALGO_KRUSKAL_MST_H__ #include #include diff --git a/include/lcs.h b/include/lcs.h index 93d6fa5f..ce218022 100644 --- a/include/lcs.h +++ b/include/lcs.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef LCS_H__ -#define LCS_H__ +#ifndef ALGO_LCS_H__ +#define ALGO_LCS_H__ #include "generic.h" #include "2darray.h" diff --git a/include/max_subarray.h b/include/max_subarray.h index c791df3b..96b0d943 100644 --- a/include/max_subarray.h +++ b/include/max_subarray.h @@ -21,8 +21,8 @@ * http://en.wikipedia.org/wiki/Maximum_subarray_problem ******************************************************************************/ -#ifndef __MAX_SUBARRAY__ -#define __MAX_SUBARRAY__ +#ifndef MAX_SUBARRAY__ +#define MAX_SUBARRAY__ namespace alg { /** diff --git a/include/md5.h b/include/md5.h index 3d8c1410..284d8c70 100644 --- a/include/md5.h +++ b/include/md5.h @@ -23,8 +23,8 @@ */ -#ifndef MD5_H__ -#define MD5_H__ +#ifndef ALGO_MD5_H__ +#define ALGO_MD5_H__ #include /* Data structure for MD5 (Message Digest) computation */ diff --git a/include/merge_sort.h b/include/merge_sort.h index 519c19a2..b50d1976 100644 --- a/include/merge_sort.h +++ b/include/merge_sort.h @@ -32,15 +32,15 @@ * ******************************************************************************/ -#ifndef MERGE_SORT_H__ -#define MERGE_SORT_H__ +#ifndef ALGO_MERGE_SORT_H__ +#define ALGO_MERGE_SORT_H__ namespace alg { /** * Merge functions merges the two sorted parts. Sorted parts will be from [left, mid] and [mid+1, right]. */ template - static void __merge(T *array, int left, int mid, int right) { + static void merge_(T *array, int left, int mid, int right) { /*We need a Temporary array to store the new sorted part*/ T tempArray[right-left+1]; int pos=0,lpos = left,rpos = mid + 1; @@ -75,7 +75,7 @@ namespace alg { /* Sort the right part */ merge_sort(array,mid+1,right); /* Merge the two sorted parts */ - __merge(array,left,mid,right); + merge_(array,left,mid,right); } } diff --git a/include/perfect_hash.h b/include/perfect_hash.h index 28b23191..55af66c1 100644 --- a/include/perfect_hash.h +++ b/include/perfect_hash.h @@ -10,8 +10,8 @@ * http://en.wikipedia.org/wiki/Perfect_hash * ******************************************************************************/ -#ifndef PERFECT_HASH_H__ -#define PERFECT_HASH_H__ +#ifndef ALGO_PERFECT_HASH_H__ +#define ALGO_PERFECT_HASH_H__ #include #include #include diff --git a/include/prim_mst.h b/include/prim_mst.h index 97d8e0a7..be48ab58 100644 --- a/include/prim_mst.h +++ b/include/prim_mst.h @@ -22,8 +22,8 @@ * ******************************************************************************/ -#ifndef PRIM_MST_H__ -#define PRIM_MST_H__ +#ifndef ALGO_PRIM_MST_H__ +#define ALGO_PRIM_MST_H__ #include #include diff --git a/include/prime.h b/include/prime.h index 593fb81a..357f8b96 100644 --- a/include/prime.h +++ b/include/prime.h @@ -11,8 +11,8 @@ * http://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test * ******************************************************************************/ -#ifndef PRIME_H__ -#define PRIME_H__ +#ifndef ALGO_PRIME_H__ +#define ALGO_PRIME_H__ #include #include diff --git a/include/priority_queue.h b/include/priority_queue.h index 10214a83..8795bc08 100644 --- a/include/priority_queue.h +++ b/include/priority_queue.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef PRIORITY_QUEUE_H__ -#define PRIORITY_QUEUE_H__ +#ifndef ALGO_PRIORITY_QUEUE_H__ +#define ALGO_PRIORITY_QUEUE_H__ #include #include @@ -80,7 +80,7 @@ namespace alg { bool found = false; list_for_each_entry(pos, &m_head, node) { if (n->priority <= pos->priority) { - __list_add(&n->node, pos->node.prev, &pos->node); + list_add_(&n->node, pos->node.prev, &pos->node); m_count++; found = true; break; diff --git a/include/queue.h b/include/queue.h index 7e322aec..55051228 100644 --- a/include/queue.h +++ b/include/queue.h @@ -13,8 +13,8 @@ * ******************************************************************************/ -#ifndef QUEUE_H__ -#define QUEUE_H__ +#ifndef ALGO_QUEUE_H__ +#define ALGO_QUEUE_H__ #include #include diff --git a/include/quick_sort.h b/include/quick_sort.h index 936d0860..b3a74489 100644 --- a/include/quick_sort.h +++ b/include/quick_sort.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef QUICKSORT_H__ -#define QUICKSORT_H__ +#ifndef ALGO_QUICKSORT_H__ +#define ALGO_QUICKSORT_H__ #include @@ -25,7 +25,7 @@ namespace alg { * the quick-sort partition routine */ template - static int __partition(T list[],int begin, int end) { + static int partition_(T list[],int begin, int end) { int pivot_idx = RANDOM(begin,end); T pivot = list[pivot_idx]; swap(list[begin], list[pivot_idx]); @@ -52,7 +52,7 @@ namespace alg { template static void quicksort(T list[],int begin,int end) { if( begin < end) { - int pivot_idx = __partition(list, begin, end); + int pivot_idx = partition_(list, begin, end); quicksort(list, begin, pivot_idx-1); quicksort(list, pivot_idx+1, end); } diff --git a/include/radix_sort.h b/include/radix_sort.h index 16298355..ec5e0733 100644 --- a/include/radix_sort.h +++ b/include/radix_sort.h @@ -15,8 +15,8 @@ * ******************************************************************************/ -#ifndef RADIX_SORT_H__ -#define RADIX_SORT_H__ +#ifndef ALGO_RADIX_SORT_H__ +#define ALGO_RADIX_SORT_H__ #include #include @@ -29,7 +29,7 @@ namespace alg { /** * couting sort */ - static void __radix(int byte, const unsigned N, const uint32_t *source, uint32_t *dest) { + static void radix_(int byte, const unsigned N, const uint32_t *source, uint32_t *dest) { unsigned count[256]; unsigned index[256]; memset(count, 0, sizeof (count)); @@ -51,10 +51,10 @@ namespace alg { */ static void radix_sort(uint32_t *source, const unsigned N) { uint32_t * temp = new uint32_t[N]; - __radix(0, N, source, temp); - __radix(1, N, temp, source); - __radix(2, N, source, temp); - __radix(3, N, temp, source); + radix_(0, N, source, temp); + radix_(1, N, temp, source); + radix_(2, N, source, temp); + radix_(3, N, temp, source); delete [] temp; } diff --git a/include/random.h b/include/random.h index 2ae56aa3..1b2fd82e 100644 --- a/include/random.h +++ b/include/random.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef RANDOM_H__ -#define RANDOM_H__ +#ifndef ALGO_RANDOM_H__ +#define ALGO_RANDOM_H__ #include #include diff --git a/include/random_select.h b/include/random_select.h index 500d0c9a..8893008d 100644 --- a/include/random_select.h +++ b/include/random_select.h @@ -17,8 +17,8 @@ * ******************************************************************************/ -#ifndef RANDOM_SELECT_H__ -#define RANDOM_SELECT_H__ +#ifndef ALGO_RANDOM_SELECT_H__ +#define ALGO_RANDOM_SELECT_H__ #include @@ -27,7 +27,7 @@ namespace alg { * the random_select partition routine */ template - static int __partition(T list[],int begin, int end) { + static int partition_(T list[],int begin, int end) { int pivot_idx = RANDOM(begin,end); T pivot = list[pivot_idx]; swap(list[begin],list[pivot_idx]); @@ -56,7 +56,7 @@ namespace alg { if(begin == end) return begin; - int pivot_idx = __partition(list, begin, end); + int pivot_idx = partition_(list, begin, end); int human_idx = pivot_idx - begin + 1; if(k < human_idx) diff --git a/include/rbtree.h b/include/rbtree.h index bace1061..61c129bd 100644 --- a/include/rbtree.h +++ b/include/rbtree.h @@ -15,8 +15,8 @@ * http://en.literateprograms.org/Red-black_tree_(C) ******************************************************************************/ -#ifndef RBTREE_H__ -#define RBTREE_H__ +#ifndef ALGO_RBTREE_H__ +#define ALGO_RBTREE_H__ #include #include #include diff --git a/include/rbtree_defs.h b/include/rbtree_defs.h index 00395bb4..a99a26b0 100644 --- a/include/rbtree_defs.h +++ b/include/rbtree_defs.h @@ -15,8 +15,8 @@ * http://en.literateprograms.org/Red-black_tree_(C) ******************************************************************************/ -#ifndef RBTREE_DEFS_H__ -#define RBTREE_DEFS_H__ +#ifndef ALGO_RBTREE_DEFS_H__ +#define ALGO_RBTREE_DEFS_H__ #include #include diff --git a/include/relabel_to_front.h b/include/relabel_to_front.h index 8e1ecf37..ef933e02 100644 --- a/include/relabel_to_front.h +++ b/include/relabel_to_front.h @@ -9,8 +9,8 @@ * * */ -#ifndef RELABEL_TO_FRONT_H__ -#define RELABEL_TO_FRONT_H__ +#ifndef ALGO_RELABEL_TO_FRONT_H__ +#define ALGO_RELABEL_TO_FRONT_H__ #include #include diff --git a/include/scc.h b/include/scc.h index 5e4b9f44..ef41af12 100644 --- a/include/scc.h +++ b/include/scc.h @@ -17,8 +17,8 @@ * http://en.wikipedia.org/wiki/Strongly_connected_component ******************************************************************************/ -#ifndef SCC_H__ -#define SCC_H__ +#ifndef ALGO_SCC_H__ +#define ALGO_SCC_H__ #include #include #include diff --git a/include/selection_sort.h b/include/selection_sort.h index b08f9d96..7b0f53e3 100644 --- a/include/selection_sort.h +++ b/include/selection_sort.h @@ -17,8 +17,8 @@ * http://en.wikipedia.org/wiki/Selection_sort ******************************************************************************/ -#ifndef SELECTION_SORT_H__ -#define SELECTION_SORT_H__ +#ifndef ALGO_SELECTION_SORT_H__ +#define ALGO_SELECTION_SORT_H__ #include #include @@ -49,4 +49,4 @@ namespace alg { } } -#endif //SELECTION_SORT_H__ +#endif //ALGO_SELECTION_SORT_H__ diff --git a/include/sha1.h b/include/sha1.h index d68c0a4a..da529b94 100644 --- a/include/sha1.h +++ b/include/sha1.h @@ -37,8 +37,8 @@ * http://en.wikipedia.org/wiki/SHA-1 */ -#ifndef SHA1_H__ -#define SHA1_H__ +#ifndef ALGO_SHA1_H__ +#define ALGO_SHA1_H__ #include diff --git a/include/shell_sort.h b/include/shell_sort.h index c6a8c717..7d9285c2 100644 --- a/include/shell_sort.h +++ b/include/shell_sort.h @@ -13,8 +13,8 @@ * ******************************************************************************/ -#ifndef SHELL_SORT_H__ -#define SHELL_SORT_H__ +#ifndef ALGO_SHELL_SORT_H__ +#define ALGO_SHELL_SORT_H__ namespace alg { /** diff --git a/include/shuffle.h b/include/shuffle.h index 16f5deab..0bdd69cd 100644 --- a/include/shuffle.h +++ b/include/shuffle.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef SHUFFLE_H__ -#define SHUFFLE_H__ +#ifndef ALGO_SHUFFLE_H__ +#define ALGO_SHUFFLE_H__ #include #include diff --git a/include/simhash.h b/include/simhash.h index d98b87c0..650af6c2 100644 --- a/include/simhash.h +++ b/include/simhash.h @@ -12,8 +12,8 @@ * ******************************************************************************/ -#ifndef SIMHASH_H__ -#define SIMHASH_H__ +#ifndef ALGO_SIMHASH_H__ +#define ALGO_SIMHASH_H__ #include #include diff --git a/include/skiplist.h b/include/skiplist.h index e34d8f04..7469511d 100644 --- a/include/skiplist.h +++ b/include/skiplist.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef SKIP_LIST_H__ -#define SKIP_LIST_H__ +#ifndef ALGO_SKIP_LIST_H__ +#define ALGO_SKIP_LIST_H__ #include #include #include diff --git a/include/sol.h b/include/sol.h index a2e148b5..c8064fc8 100644 --- a/include/sol.h +++ b/include/sol.h @@ -16,8 +16,8 @@ * ******************************************************************************/ -#ifndef SOL_H__ -#define SOL_H__ +#ifndef ALGO_SOL_H__ +#define ALGO_SOL_H__ #include "double_linked_list.h" namespace alg { @@ -26,8 +26,8 @@ namespace alg { */ static inline void list_mtf(struct list_head *entry, struct list_head *head) { if (entry->prev == head) return; - __list_del(entry->prev, entry->next); - __list_add(entry, head, head->next); + list_del_(entry->prev, entry->next); + list_add_(entry, head, head->next); } @@ -38,8 +38,8 @@ namespace alg { // if the entry in the 1st position if (entry->prev == head) return; struct list_head * prev = entry->prev; - __list_del(entry->prev, entry->next); - __list_add(entry, prev->prev, prev); + list_del_(entry->prev, entry->next); + list_add_(entry, prev->prev, prev); } } #endif // diff --git a/include/stack.h b/include/stack.h index 8b664f5e..21ab1159 100644 --- a/include/stack.h +++ b/include/stack.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef STACK_H__ -#define STACK_H__ +#ifndef ALGO_STACK_H__ +#define ALGO_STACK_H__ #include #include diff --git a/include/suffix_array.h b/include/suffix_array.h index a47fe2fc..8c7e11fb 100644 --- a/include/suffix_array.h +++ b/include/suffix_array.h @@ -20,8 +20,8 @@ * AUTHOR: nowerzt@gmail.com ******************************************************************************/ -#ifndef SUFFIX_ARRAY_H__ -#define SUFFIX_ARRAY_H__ +#ifndef ALGO_SUFFIX_ARRAY_H__ +#define ALGO_SUFFIX_ARRAY_H__ #include #include @@ -100,4 +100,4 @@ namespace alg { } } -#endif // SUFFIX_ARRAY_H__ +#endif // ALGO_SUFFIX_ARRAY_H__ diff --git a/include/trie.h b/include/trie.h index ac253704..0cdba5ef 100644 --- a/include/trie.h +++ b/include/trie.h @@ -10,8 +10,8 @@ * http://en.wikipedia.org/wiki/Trie ******************************************************************************/ -#ifndef TRIE_H__ -#define TRIE_H__ +#ifndef ALGO_TRIE_H__ +#define ALGO_TRIE_H__ #include #include #include diff --git a/include/undirected_graph.h b/include/undirected_graph.h index c1e4cd08..51804de4 100644 --- a/include/undirected_graph.h +++ b/include/undirected_graph.h @@ -14,8 +14,8 @@ * ******************************************************************************/ -#ifndef UNDIRECTED_GRAPH_H__ -#define UNDIRECTED_GRAPH_H__ +#ifndef ALGO_UNDIRECTED_GRAPH_H__ +#define ALGO_UNDIRECTED_GRAPH_H__ #include #include diff --git a/include/universal_hash.h b/include/universal_hash.h index 1a8abe20..40c454ce 100644 --- a/include/universal_hash.h +++ b/include/universal_hash.h @@ -11,8 +11,8 @@ * ******************************************************************************/ -#ifndef UNIVERSAL_HASH_H__ -#define UNIVERSAL_HASH_H__ +#ifndef ALGO_UNIVERSAL_HASH_H__ +#define ALGO_UNIVERSAL_HASH_H__ #include #include diff --git a/include/word_seg.h b/include/word_seg.h index 00528827..ed99b763 100644 --- a/include/word_seg.h +++ b/include/word_seg.h @@ -17,8 +17,8 @@ * ******************************************************************************/ -#ifndef WORD_SEG_H__ -#define WORD_SEG_H__ +#ifndef ALGO_WORD_SEG_H__ +#define ALGO_WORD_SEG_H__ #include #include diff --git a/msvc/alg_vs.h b/msvc/alg_vs.h index 78e56b88..ca1d0163 100644 --- a/msvc/alg_vs.h +++ b/msvc/alg_vs.h @@ -1,5 +1,5 @@ -#ifndef ALGVS_H__ -#define ALGVS_H__ +#ifndef ALGO_ALGVS_H__ +#define ALGO_ALGVS_H__ #ifdef _MSC_VER #define _CRT_SECURE_NO_WARNINGS @@ -15,4 +15,4 @@ #define typeof decltype #endif//_MSC_VER -#endif//ALGVS_H__ \ No newline at end of file +#endif//ALGO_ALGVS_H__ \ No newline at end of file diff --git a/src/lcs_demo.cpp b/src/lcs_demo.cpp index 838c5d4b..71c2db20 100644 --- a/src/lcs_demo.cpp +++ b/src/lcs_demo.cpp @@ -6,9 +6,9 @@ #define printlistC(list,n) \ do { \ - int __list_counter; \ - for(__list_counter=0;__list_counter #include diff --git a/utils/gb18030.h b/utils/gb18030.h index fdc2803d..5da8c9f3 100644 --- a/utils/gb18030.h +++ b/utils/gb18030.h @@ -1,5 +1,5 @@ -#ifndef GB18030_H__ -#define GB18030_H__ +#ifndef ALGO_GB18030_H__ +#define ALGO_GB18030_H__ /** * Read from the string encoded in GB18030 into WORD