OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2012 Lawrence Livermore National Laboratory | 3 * Copyright (c) 2012 Lawrence Livermore National Laboratory |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 152 |
153 | 153 |
154 //#include <sys/types.h> //PDB | 154 //#include <sys/types.h> //PDB |
155 | 155 |
156 #define FNV_VERSION "5.0.2" /**< @(#) FNV Version */ | 156 #define FNV_VERSION "5.0.2" /**< @(#) FNV Version */ |
157 | 157 |
158 | 158 |
159 /** | 159 /** |
160 * 32 bit FNV-0 hash type | 160 * 32 bit FNV-0 hash type |
161 */ | 161 */ |
162 typedef u_int32_t Fnv32_t; | 162 typedef uint32_t Fnv32_t; //PDB |
163 | 163 |
164 | 164 |
165 /** | 165 /** |
166 * 32 bit FNV-0 zero initial basis | 166 * 32 bit FNV-0 zero initial basis |
167 * | 167 * |
168 * This historic hash is not recommended. One should use | 168 * This historic hash is not recommended. One should use |
169 * the FNV-1 hash and initial basis instead. | 169 * the FNV-1 hash and initial basis instead. |
170 */ | 170 */ |
171 // Use fully qualified type so this define works outside this scope //PDB | 171 // Use fully qualified type so this define works outside this scope //PDB |
172 #define FNV0_32_INIT ((Fnv1aImplementation::Fnv32_t)0) | 172 #define FNV0_32_INIT ((Fnv1aImplementation::Fnv32_t)0) |
(...skipping 22 matching lines...) Expand all Loading... |
195 */ | 195 */ |
196 //#include "longlong.h" //PDB - assume `unsigned long long' is 64 bit | 196 //#include "longlong.h" //PDB - assume `unsigned long long' is 64 bit |
197 #define HAVE_64BIT_LONG_LONG·· | 197 #define HAVE_64BIT_LONG_LONG·· |
198 ·· | 198 ·· |
199 | 199 |
200 | 200 |
201 /**· | 201 /**· |
202 * 64 bit FNV-0 hash | 202 * 64 bit FNV-0 hash |
203 */ | 203 */ |
204 #if defined(HAVE_64BIT_LONG_LONG) | 204 #if defined(HAVE_64BIT_LONG_LONG) |
205 typedef u_int64_t Fnv64_t; | 205 typedef uint64_t Fnv64_t; //PDB |
206 #else /* HAVE_64BIT_LONG_LONG */ | 206 #else /* HAVE_64BIT_LONG_LONG */ |
207 typedef struct { | 207 typedef struct { |
208 u_int32_t w32[2]; /* w32[0] is low order, w32[1] is high order word */ | 208 uint32_t w32[2]; /* w32[0] is low order, w32[1] is high order word */ //PDB |
209 } Fnv64_t; | 209 } Fnv64_t; |
210 #endif /* HAVE_64BIT_LONG_LONG */ | 210 #endif /* HAVE_64BIT_LONG_LONG */ |
211 | 211 |
212 | 212 |
213 /** | 213 /** |
214 * 64 bit FNV-0 zero initial basis | 214 * 64 bit FNV-0 zero initial basis |
215 * | 215 * |
216 * This historic hash is not recommended. One should use | 216 * This historic hash is not recommended. One should use |
217 * the FNV-1 hash and initial basis instead. | 217 * the FNV-1 hash and initial basis instead. |
218 */ | 218 */ |
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
772 { | 772 { |
773 m_hash32 = FNV1_32A_INIT; | 773 m_hash32 = FNV1_32A_INIT; |
774 m_hash64 = FNV1A_64_INIT; | 774 m_hash64 = FNV1A_64_INIT; |
775 } | 775 } |
776 | 776 |
777 } // namespace Function | 777 } // namespace Function |
778 | 778 |
779 } // namespace Hash | 779 } // namespace Hash |
780 | 780 |
781 } // namespace ns3 | 781 } // namespace ns3 |
OLD | NEW |