Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Side by Side Diff: third_party/fips181/randpass.cc

Issue 2571113002: Remove unnecessary typedefs in third_party/fips181. (Closed)
Patch Set: Solve for MSVC warning C4805. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/fips181/randpass.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 ** Copyright (c) 1999, 2000, 2001, 2002, 2003 2 ** Copyright (c) 1999, 2000, 2001, 2002, 2003
3 ** Adel I. Mirzazhanov. All rights reserved 3 ** Adel I. Mirzazhanov. All rights reserved
4 ** 4 **
5 ** Redistribution and use in source and binary forms, with or without 5 ** Redistribution and use in source and binary forms, with or without
6 ** modification, are permitted provided that the following conditions 6 ** modification, are permitted provided that the following conditions
7 ** are met: 7 ** are met:
8 ** 8 **
9 ** 1.Redistributions of source code must retain the above copyright notice, 9 ** 1.Redistributions of source code must retain the above copyright notice,
10 ** this list of conditions and the following disclaimer. 10 ** this list of conditions and the following disclaimer.
(...skipping 18 matching lines...) Expand all
29 29
30 /* 30 /*
31 ** randpass.c - Random password generation module of PWGEN program 31 ** randpass.c - Random password generation module of PWGEN program
32 */ 32 */
33 33
34 #include <stdio.h> 34 #include <stdio.h>
35 #include <stdlib.h> 35 #include <stdlib.h>
36 #include <time.h> 36 #include <time.h>
37 37
38 #include "base/rand_util.h" 38 #include "base/rand_util.h"
39 #include "owntypes.h"
40 #include "randpass.h" 39 #include "randpass.h"
41 #include "smbl.h" 40 #include "smbl.h"
42 41
43 /* 42 /*
44 ** gen_rand_pass - generates random password of specified type 43 ** gen_rand_pass - generates random password of specified type
45 ** INPUT: 44 ** INPUT:
46 ** char * - password string. 45 ** char * - password string.
47 ** int - minimum password length. 46 ** int - minimum password length.
48 ** int - maximum password length. 47 ** int - maximum password length.
49 ** unsigned int - password generation mode. 48 ** unsigned int - password generation mode.
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 max_weight = 0; 135 max_weight = 0;
137 max_weight_element_number = 0; 136 max_weight_element_number = 0;
138 return (0); 137 return (0);
139 } 138 }
140 139
141 /* 140 /*
142 ** is_restricted_symbol - detcts if symbol is restricted rigt now 141 ** is_restricted_symbol - detcts if symbol is restricted rigt now
143 ** INPUT: 142 ** INPUT:
144 ** char - symbol. 143 ** char - symbol.
145 ** OUTPUT: 144 ** OUTPUT:
146 ** int - 0 - not restricted 145 ** bool - false - not restricted
147 ** 1 - restricted 146 ** true - restricted
148 ** NOTES: 147 ** NOTES:
149 ** none. 148 ** none.
150 */ 149 */
151 int 150 bool
152 is_restricted_symbol (char symbol) 151 is_restricted_symbol (char symbol)
153 { 152 {
154 int j = 0; 153 int j = 0;
155 for (j = 0; j <= 93 ; j++) 154 for (j = 0; j <= 93 ; j++)
156 if (symbol == smbl[j].ch) 155 if (symbol == smbl[j].ch)
157 if ((S_RS & smbl[j].type) > 0) 156 if ((S_RS & smbl[j].type) > 0)
158 return(1); 157 return(true);
159 return(0); 158 return(false);
160 } 159 }
OLDNEW
« no previous file with comments | « third_party/fips181/randpass.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698