aboutsummaryrefslogtreecommitdiff
path: root/src/regex
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2013-09-26 12:50:40 +0000
committerBart Polot <bart@net.in.tum.de>2013-09-26 12:50:40 +0000
commit31e50803fd8e15d167e048adf58cfb5190464e45 (patch)
tree2a5206f0f3f29f7f4e71b6602be516e80077ff48 /src/regex
parent4f35d02a21820b2a3120c4cae04f1c543a727874 (diff)
downloadgnunet-31e50803fd8e15d167e048adf58cfb5190464e45.tar.gz
gnunet-31e50803fd8e15d167e048adf58cfb5190464e45.zip
- indentation, style
Diffstat (limited to 'src/regex')
-rw-r--r--src/regex/regex_internal.c9
-rw-r--r--src/regex/regex_internal_dht.c15
2 files changed, 11 insertions, 13 deletions
diff --git a/src/regex/regex_internal.c b/src/regex/regex_internal.c
index 9ea6cb8f5..38a95976a 100644
--- a/src/regex/regex_internal.c
+++ b/src/regex/regex_internal.c
@@ -2822,7 +2822,7 @@ REGEX_INTERNAL_construct_nfa (const char *regex, const size_t len)
2822 nfa_add_concatenation (&ctx); 2822 nfa_add_concatenation (&ctx);
2823 } 2823 }
2824 if (poff == psize) 2824 if (poff == psize)
2825 GNUNET_array_grow (p, psize, psize * 2 + 4); 2825 GNUNET_array_grow (p, psize, psize * 2 + 4); /* FIXME why *2 +4? */
2826 p[poff].altcount = altcount; 2826 p[poff].altcount = altcount;
2827 p[poff].atomcount = atomcount; 2827 p[poff].atomcount = atomcount;
2828 poff++; 2828 poff++;
@@ -3023,7 +3023,7 @@ construct_dfa_states (struct REGEX_INTERNAL_Context *ctx,
3023 */ 3023 */
3024struct REGEX_INTERNAL_Automaton * 3024struct REGEX_INTERNAL_Automaton *
3025REGEX_INTERNAL_construct_dfa (const char *regex, const size_t len, 3025REGEX_INTERNAL_construct_dfa (const char *regex, const size_t len,
3026 unsigned int max_path_len) 3026 unsigned int max_path_len)
3027{ 3027{
3028 struct REGEX_INTERNAL_Context ctx; 3028 struct REGEX_INTERNAL_Context ctx;
3029 struct REGEX_INTERNAL_Automaton *dfa; 3029 struct REGEX_INTERNAL_Automaton *dfa;
@@ -3308,9 +3308,8 @@ REGEX_INTERNAL_get_first_key (const char *input_string, size_t string_len,
3308{ 3308{
3309 size_t size; 3309 size_t size;
3310 3310
3311 size = 3311 size = string_len < GNUNET_REGEX_INITIAL_BYTES ? string_len :
3312 string_len < 3312 GNUNET_REGEX_INITIAL_BYTES;
3313 GNUNET_REGEX_INITIAL_BYTES ? string_len : GNUNET_REGEX_INITIAL_BYTES;
3314 if (NULL == input_string) 3313 if (NULL == input_string)
3315 { 3314 {
3316 GNUNET_log (GNUNET_ERROR_TYPE_ERROR, 3315 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
diff --git a/src/regex/regex_internal_dht.c b/src/regex/regex_internal_dht.c
index 85fb7bcb8..26562d35a 100644
--- a/src/regex/regex_internal_dht.c
+++ b/src/regex/regex_internal_dht.c
@@ -104,20 +104,19 @@ regex_iterator (void *cls,
104 104
105 LOG (GNUNET_ERROR_TYPE_DEBUG, 105 LOG (GNUNET_ERROR_TYPE_DEBUG,
106 "State %s is accepting, putting own id\n", 106 "State %s is accepting, putting own id\n",
107 GNUNET_h2s(key)); 107 GNUNET_h2s (key));
108 size = sizeof (struct RegexAcceptBlock); 108 size = sizeof (struct RegexAcceptBlock);
109 ab.purpose.size = ntohl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) + 109 ab.purpose.size = ntohl (sizeof (struct GNUNET_CRYPTO_EccSignaturePurpose) +
110 sizeof (struct GNUNET_TIME_AbsoluteNBO) + 110 sizeof (struct GNUNET_TIME_AbsoluteNBO) +
111 sizeof (struct GNUNET_HashCode)); 111 sizeof (struct GNUNET_HashCode));
112 ab.purpose.purpose = ntohl (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT); 112 ab.purpose.purpose = ntohl (GNUNET_SIGNATURE_PURPOSE_REGEX_ACCEPT);
113 ab.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_DHT_MAX_EXPIRATION)); 113 ab.expiration_time = GNUNET_TIME_absolute_hton (GNUNET_TIME_relative_to_absolute (GNUNET_CONSTANTS_DHT_MAX_EXPIRATION));
114 ab.key = *key; 114 ab.key = *key;
115 GNUNET_CRYPTO_ecc_key_get_public_for_signature (h->priv, 115 GNUNET_CRYPTO_ecc_key_get_public_for_signature (h->priv, &ab.public_key);
116 &ab.public_key);
117 GNUNET_assert (GNUNET_OK == 116 GNUNET_assert (GNUNET_OK ==
118 GNUNET_CRYPTO_ecc_sign (h->priv, 117 GNUNET_CRYPTO_ecc_sign (h->priv,
119 &ab.purpose, 118 &ab.purpose,
120 &ab.signature)); 119 &ab.signature));
121 120
122 GNUNET_STATISTICS_update (h->stats, "# regex accepting blocks stored", 121 GNUNET_STATISTICS_update (h->stats, "# regex accepting blocks stored",
123 1, GNUNET_NO); 122 1, GNUNET_NO);