Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
e810457d
Commit
e810457d
authored
Apr 27, 2011
by
Paul Eggert
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* doprnt.c (doprnt): Support "ll" length modifier, for long long.
parent
2a782793
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
3 deletions
+32
-3
src/ChangeLog
src/ChangeLog
+4
-0
src/doprnt.c
src/doprnt.c
+28
-3
No files found.
src/ChangeLog
View file @
e810457d
2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
* doprnt.c (doprnt): Support "ll" length modifier, for long long.
2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
* buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
...
...
src/doprnt.c
View file @
e810457d
...
...
@@ -80,7 +80,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
The l (lower-case letter ell) flag is a `long' data type modifier: it is
supported for %d, %o, and %x conversions of integral arguments, and means
that the respective argument is to be treated as `long int' or `unsigned
long int'. The EMACS_INT data type should use this modifier.
long int'. ll means to use 'long long'. EMACS_INT arguments
should use the pI macro, which expands to whatever length modifier
is needed for the target host, e.g., "", "l", "ll".
The width specifier supplies a lower limit for the length of the printed
representation. The padding, if any, normally goes on the left, but it goes
...
...
@@ -205,6 +207,11 @@ doprnt (char *buffer, register size_t bufsize, const char *format,
else
if
(
*
fmt
==
'l'
)
{
long_flag
=
1
;
if
(
fmt
[
1
]
==
'l'
)
{
long_flag
=
2
;
fmt
++
;
}
if
(
!
strchr
(
"dox"
,
fmt
[
1
]))
/* %l as conversion specifier, not as modifier. */
break
;
...
...
@@ -244,7 +251,16 @@ doprnt (char *buffer, register size_t bufsize, const char *format,
int
i
;
long
l
;
if
(
long_flag
)
if
(
1
<
long_flag
)
{
#ifdef HAVE_LONG_LONG_INT
long
long
ll
=
va_arg
(
ap
,
long
long
);
sprintf
(
sprintf_buffer
,
fmtcpy
,
ll
);
#else
abort
();
#endif
}
else
if
(
long_flag
)
{
l
=
va_arg
(
ap
,
long
);
sprintf
(
sprintf_buffer
,
fmtcpy
,
l
);
...
...
@@ -265,7 +281,16 @@ doprnt (char *buffer, register size_t bufsize, const char *format,
unsigned
u
;
unsigned
long
ul
;
if
(
long_flag
)
if
(
1
<
long_flag
)
{
#ifdef HAVE_UNSIGNED_LONG_LONG_INT
unsigned
long
long
ull
=
va_arg
(
ap
,
unsigned
long
long
);
sprintf
(
sprintf_buffer
,
fmtcpy
,
ull
);
#else
abort
();
#endif
}
else
if
(
long_flag
)
{
ul
=
va_arg
(
ap
,
unsigned
long
);
sprintf
(
sprintf_buffer
,
fmtcpy
,
ul
);
...
...
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