Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
jlib
Commits
58c8344c
Commit
58c8344c
authored
Aug 12, 2017
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix vs2017 warnings
parent
6225f0bb
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
90 deletions
+99
-90
icmp_header.hpp
net/icmp_header.hpp
+56
-49
ipv4_header.hpp
net/ipv4_header.hpp
+41
-39
FileOper.h
win32/mfc/FileOper.h
+2
-2
No files found.
net/icmp_header.hpp
View file @
58c8344c
...
...
@@ -33,12 +33,14 @@
class
icmp_header
{
public
:
enum
{
echo_reply
=
0
,
destination_unreachable
=
3
,
source_quench
=
4
,
enum
{
echo_reply
=
0
,
destination_unreachable
=
3
,
source_quench
=
4
,
redirect
=
5
,
echo_request
=
8
,
time_exceeded
=
11
,
parameter_problem
=
12
,
timestamp_request
=
13
,
timestamp_reply
=
14
,
info_request
=
15
,
info_reply
=
16
,
address_request
=
17
,
address_reply
=
18
};
info_reply
=
16
,
address_request
=
17
,
address_reply
=
18
};
icmp_header
()
{
std
::
fill
(
rep_
,
rep_
+
sizeof
(
rep_
),
0
);
}
icmp_header
()
{
memset
(
rep_
,
0
,
sizeof
(
rep_
)
);
}
unsigned
char
type
()
const
{
return
rep_
[
0
];
}
unsigned
char
code
()
const
{
return
rep_
[
1
];
}
...
...
@@ -53,14 +55,20 @@ public:
void
sequence_number
(
unsigned
short
n
)
{
encode
(
6
,
7
,
n
);
}
friend
std
::
istream
&
operator
>>
(
std
::
istream
&
is
,
icmp_header
&
header
)
{
return
is
.
read
(
reinterpret_cast
<
char
*>
(
header
.
rep_
),
8
);
}
{
return
is
.
read
(
reinterpret_cast
<
char
*>
(
header
.
rep_
),
8
);
}
friend
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
const
icmp_header
&
header
)
{
return
os
.
write
(
reinterpret_cast
<
const
char
*>
(
header
.
rep_
),
8
);
}
{
return
os
.
write
(
reinterpret_cast
<
const
char
*>
(
header
.
rep_
),
8
);
}
private
:
unsigned
short
decode
(
int
a
,
int
b
)
const
{
return
((
rep_
[
a
]
<<
8
)
+
rep_
[
b
])
&
0xFFFF
;
}
{
return
((
rep_
[
a
]
<<
8
)
+
rep_
[
b
])
&
0xFFFF
;
}
void
encode
(
int
a
,
int
b
,
unsigned
short
n
)
{
...
...
@@ -79,8 +87,7 @@ void compute_checksum(icmp_header& header,
+
header
.
identifier
()
+
header
.
sequence_number
();
Iterator
body_iter
=
body_begin
;
while
(
body_iter
!=
body_end
)
{
while
(
body_iter
!=
body_end
)
{
sum
+=
(
static_cast
<
unsigned
char
>
(
*
body_iter
++
)
<<
8
);
if
(
body_iter
!=
body_end
)
sum
+=
static_cast
<
unsigned
char
>
(
*
body_iter
++
);
...
...
net/ipv4_header.hpp
View file @
58c8344c
...
...
@@ -51,7 +51,7 @@
class
ipv4_header
{
public
:
ipv4_header
()
{
std
::
fill
(
rep_
,
rep_
+
sizeof
(
rep_
),
0
);
}
ipv4_header
()
{
memset
(
rep_
,
0
,
sizeof
(
rep_
)
);
}
unsigned
char
version
()
const
{
return
(
rep_
[
0
]
>>
4
)
&
0xF
;
}
unsigned
short
header_length
()
const
{
return
((
rep_
[
0
]
&
0xF
)
*
4
)
&
0xFFFF
;
}
...
...
@@ -94,7 +94,9 @@ public:
private
:
unsigned
short
decode
(
int
a
,
int
b
)
const
{
return
((
rep_
[
a
]
<<
8
)
+
rep_
[
b
])
&
0xFFFF
;
}
{
return
((
rep_
[
a
]
<<
8
)
+
rep_
[
b
])
&
0xFFFF
;
}
unsigned
char
rep_
[
60
];
};
...
...
win32/mfc/FileOper.h
View file @
58c8344c
...
...
@@ -253,7 +253,7 @@ public:
num
.
ReleaseBuffer
();
num
.
Format
(
_T
(
"%03d"
),
nums
);
tittle
+=
num
;
newFileName
.
Format
(
_T
(
"%s%s"
),
tittle
,
ext
);
newFileName
.
Format
(
_T
(
"%s%s"
),
(
LPCWSTR
)
tittle
,
(
LPCWSTR
)
ext
);
LPCTSTR
szOldName
=
fileName
.
GetBuffer
(
fileName
.
GetLength
());
fileName
.
ReleaseBuffer
();
LPCTSTR
szNewName
=
newFileName
.
GetBuffer
(
newFileName
.
GetLength
());
...
...
@@ -281,7 +281,7 @@ public:
filepath
=
find
.
GetFilePath
();
if
(
DeleteFile
(
filepath
.
GetBuffer
(
filepath
.
GetLength
()))){
CString
trace
;
trace
.
Format
(
_T
(
"CFileOper::DeleteFilesInFolder delete file %s
\n
"
),
find
.
GetFilePath
());
(
LPCWSTR
)
find
.
GetFilePath
());
TRACE
(
trace
);
bfoundone
=
TRUE
;
dwDeletedFileNums
++
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment