Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Commits on Source (3)
C99 allows for loops to declare counters inline
· 7d785546
Matt Selsky
authored
Oct 08, 2016
and
Eric S. Raymond
committed
Oct 11, 2016
7d785546
Fix IndentationError: unindent does not match any outer indentation level
· 0b9b3750
Matt Selsky
authored
Oct 09, 2016
and
Eric S. Raymond
committed
Oct 11, 2016
0b9b3750
vulture: Unused attribute 'current_value'
· 50b0284a
Matt Selsky
authored
Oct 09, 2016
and
Eric S. Raymond
committed
Oct 11, 2016
50b0284a
Hide whitespace changes
Inline
Side-by-side
contrib/gps-log
View file @
50b0284a
...
...
@@ -15,7 +15,6 @@ class GpsPoller(threading.Thread):
threading
.
Thread
.
__init__
(
self
)
global
gpsd
#bring it in scope
gpsd
=
gps
(
mode
=
WATCH_ENABLE
)
#starting the stream of info
self
.
current_value
=
None
self
.
running
=
True
def
run
(
self
):
...
...
@@ -47,8 +46,8 @@ if __name__ == '__main__':
except
AttributeError
as
e
:
print
(
'
parse error
\n
'
)
sys
.
stdout
.
flush
()
time
.
sleep
(
5
)
#set to whatever
sys
.
stdout
.
flush
()
time
.
sleep
(
5
)
#set to whatever
except
(
KeyboardInterrupt
,
SystemExit
):
#when you press ctrl+c
print
(
"
\n
Killing Thread...
"
)
...
...
libntp/authkeys.c
View file @
50b0284a
...
...
@@ -315,9 +315,7 @@ auth_findkey(
keyid_t
id
)
{
symkey
*
sk
;
for
(
sk
=
key_hash
[
KEYHASH
(
id
)];
sk
!=
NULL
;
sk
=
sk
->
hlink
)
{
for
(
symkey
*
sk
=
key_hash
[
KEYHASH
(
id
)];
sk
!=
NULL
;
sk
=
sk
->
hlink
)
{
if
(
id
==
sk
->
keyid
)
{
return
sk
;
}
...
...
@@ -335,13 +333,11 @@ auth_havekey(
keyid_t
id
)
{
symkey
*
sk
;
if
(
0
==
id
||
cache_keyid
==
id
)
{
return
true
;
}
for
(
sk
=
key_hash
[
KEYHASH
(
id
)];
sk
!=
NULL
;
sk
=
sk
->
hlink
)
{
for
(
symkey
*
sk
=
key_hash
[
KEYHASH
(
id
)];
sk
!=
NULL
;
sk
=
sk
->
hlink
)
{
if
(
id
==
sk
->
keyid
)
{
return
true
;
}
...
...
@@ -497,7 +493,6 @@ MD5auth_setkey(
size_t
len
)
{
symkey
*
sk
;
symkey
**
bucket
;
uint8_t
*
secret
;
size_t
secretsize
;
...
...
@@ -509,7 +504,7 @@ MD5auth_setkey(
* new value.
*/
bucket
=
&
key_hash
[
KEYHASH
(
keyno
)];
for
(
sk
=
*
bucket
;
sk
!=
NULL
;
sk
=
sk
->
hlink
)
{
for
(
symkey
*
sk
=
*
bucket
;
sk
!=
NULL
;
sk
=
sk
->
hlink
)
{
if
(
keyno
==
sk
->
keyid
)
{
sk
->
type
=
(
unsigned
short
)
keytype
;
secretsize
=
len
;
...
...
@@ -535,11 +530,9 @@ MD5auth_setkey(
(
unsigned
short
)
secretsize
,
secret
);
#ifdef DEBUG
if
(
debug
>=
4
)
{
size_t
j
;
printf
(
"auth_setkey: key %d type %d len %d "
,
(
int
)
keyno
,
keytype
,
(
int
)
secretsize
);
for
(
j
=
0
;
j
<
secretsize
;
j
++
)
for
(
size_t
j
=
0
;
j
<
secretsize
;
j
++
)
printf
(
"%02x"
,
secret
[
j
]);
printf
(
"
\n
"
);
}
...
...
libntp/socktoa.c
View file @
50b0284a
...
...
@@ -102,7 +102,6 @@ sock_hash(
)
{
u_int
hashVal
;
u_int
j
;
size_t
len
;
const
uint8_t
*
pch
;
...
...
@@ -132,7 +131,7 @@ sock_hash(
break
;
}
for
(
j
=
0
;
j
<
len
;
j
++
)
for
(
u_int
j
=
0
;
j
<
len
;
j
++
)
hashVal
=
37
*
hashVal
+
pch
[
j
];
return
(
u_short
)(
hashVal
&
USHRT_MAX
);
...
...
ntpd/ntpd.c
View file @
50b0284a
...
...
@@ -555,7 +555,6 @@ ntpdmain(
if
(
!
dumpopts
)
{
int
i
;
char
buf
[
1024
];
/* Secret knowledge of msyslog buf length */
char
*
cp
=
buf
;
...
...
@@ -565,7 +564,7 @@ ntpdmain(
snprintf
(
cp
,
sizeof
(
buf
),
"Command line:"
);
cp
+=
strlen
(
cp
);
for
(
i
=
0
;
i
<
saved_argc
;
++
i
)
{
for
(
int
i
=
0
;
i
<
saved_argc
;
++
i
)
{
snprintf
(
cp
,
sizeof
(
buf
)
-
(
cp
-
buf
),
" %s"
,
saved_argv
[
i
]);
cp
+=
strlen
(
cp
);
...
...
ntpdig/kod_management.c
View file @
50b0284a
...
...
@@ -123,7 +123,6 @@ write_kod_db(void)
FILE
*
db_s
;
char
*
pch
;
int
dirmode
;
register
int
a
;
db_s
=
fopen
(
kod_db_file
,
"w"
);
...
...
@@ -157,7 +156,7 @@ write_kod_db(void)
return
false
;
}
for
(
a
=
0
;
a
<
kod_db_cnt
;
a
++
)
{
for
(
register
int
a
=
0
;
a
<
kod_db_cnt
;
a
++
)
{
fprintf
(
db_s
,
"%16.16llx %s %s
\n
"
,
(
unsigned
long
long
)
kod_db
[
a
]
->
timestamp
,
kod_db
[
a
]
->
type
,
kod_db
[
a
]
->
hostname
);
...
...