Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d50338fb
Commit
d50338fb
authored
Jul 06, 2000
by
Jack Jansen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for H (unsigned short) specifier in PyArg_ParseTuple and
Py_BuildValue.
parent
63f3d174
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
1 deletion
+30
-1
Python/getargs.c
Python/getargs.c
+27
-1
Python/modsupport.c
Python/modsupport.c
+3
-0
No files found.
Python/getargs.c
View file @
d50338fb
...
...
@@ -489,6 +489,27 @@ convertsimple1(arg, p_format, p_va)
break
;
}
case
'H'
:
/* unsigned short int */
{
unsigned
short
*
p
=
va_arg
(
*
p_va
,
unsigned
short
*
);
long
ival
=
PyInt_AsLong
(
arg
);
if
(
ival
==
-
1
&&
PyErr_Occurred
())
return
"integer<H>"
;
else
if
(
ival
<
0
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"unsigned short integer is less than minimum"
);
return
"integer<H>"
;
}
else
if
(
ival
>
USHRT_MAX
)
{
PyErr_SetString
(
PyExc_OverflowError
,
"unsigned short integer is greater than maximum"
);
return
"integer<H>"
;
}
else
*
p
=
(
unsigned
short
)
ival
;
break
;
}
case
'i'
:
/* signed int */
{
int
*
p
=
va_arg
(
*
p_va
,
int
*
);
...
...
@@ -509,7 +530,6 @@ convertsimple1(arg, p_format, p_va)
*
p
=
ival
;
break
;
}
case
'l'
:
/* long int */
{
long
*
p
=
va_arg
(
*
p_va
,
long
*
);
...
...
@@ -1207,6 +1227,12 @@ skipitem(p_format, p_va)
break
;
}
case
'H'
:
/* unsigned short int */
{
(
void
)
va_arg
(
*
p_va
,
unsigned
short
*
);
break
;
}
case
'i'
:
/* int */
{
(
void
)
va_arg
(
*
p_va
,
int
*
);
...
...
Python/modsupport.c
View file @
d50338fb
...
...
@@ -278,6 +278,9 @@ do_mkvalue(p_format, p_va)
case
'h'
:
case
'i'
:
return
PyInt_FromLong
((
long
)
va_arg
(
*
p_va
,
int
));
case
'H'
:
return
PyInt_FromLong
((
long
)
va_arg
(
*
p_va
,
unsigned
int
));
case
'l'
:
return
PyInt_FromLong
((
long
)
va_arg
(
*
p_va
,
long
));
...
...
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