Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
e96ffca9
Commit
e96ffca9
authored
14 years ago
by
rswindell
Browse files
Options
Downloads
Patches
Plain Diff
Fix Deuce's previous "fix": Apparently macros are *not* how you should work
around C++ scoping issues (return from a macro?). :-)
parent
ec348349
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sbbs3/inkey.cpp
+16
-14
16 additions, 14 deletions
src/sbbs3/inkey.cpp
with
16 additions
and
14 deletions
src/sbbs3/inkey.cpp
+
16
−
14
View file @
e96ffca9
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.tab-size 4 (Plain Text/Source Code File Header) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* @format.use-tabs true (see http://www.synchro.net/ptsc_hdr.html) *
* *
* *
* Copyright 20
09
Rob Swindell - http://www.synchro.net/copyright.html *
* Copyright 20
11
Rob Swindell - http://www.synchro.net/copyright.html *
* *
* *
* This program is free software; you can redistribute it and/or *
* This program is free software; you can redistribute it and/or *
* modify it under the terms of the GNU General Public License *
* modify it under the terms of the GNU General Public License *
...
@@ -41,16 +41,18 @@
...
@@ -41,16 +41,18 @@
#define nosound()
#define nosound()
#define KBINCOM(ch, timeout) \
int
kbincom
(
sbbs_t
*
sbbs
,
unsigned
long
timeout
)
{ \
{
if(keybuftop!=keybufbot) { \
int
ch
;
ch=keybuf[keybufbot++]; \
if(keybufbot==KEY_BUFSIZE) \
if
(
sbbs
->
keybuftop
!=
sbbs
->
keybufbot
)
{
keybufbot=0; \
ch
=
sbbs
->
keybuf
[
sbbs
->
keybufbot
++
];
} else \
if
(
sbbs
->
keybufbot
==
KEY_BUFSIZE
)
ch=incom(timeout); \
sbbs
->
keybufbot
=
0
;
\
}
else
return ch; \
ch
=
sbbs
->
incom
(
timeout
);
return
ch
;
}
}
/****************************************************************************/
/****************************************************************************/
...
@@ -61,7 +63,7 @@ char sbbs_t::inkey(long mode, unsigned long timeout)
...
@@ -61,7 +63,7 @@ char sbbs_t::inkey(long mode, unsigned long timeout)
{
{
uchar
ch
=
0
;
uchar
ch
=
0
;
KBINCOM
(
ch
,
timeout
);
ch
=
kbincom
(
this
,
timeout
);
if
(
ch
==
0
)
{
if
(
ch
==
0
)
{
// moved here from getkey() on AUG-29-2001
// moved here from getkey() on AUG-29-2001
...
@@ -261,7 +263,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
...
@@ -261,7 +263,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
hotkey_inside
--
;
hotkey_inside
--
;
return
(
0
);
return
(
0
);
case
ESC
:
case
ESC
:
KBINCOM
(
i
,
mode
&
K_GETSTR
?
3000
:
1000
);
i
=
kbincom
(
this
,
(
mode
&
K_GETSTR
)
?
3000
:
1000
);
if
(
i
==
NOINP
)
// timed-out waiting for '['
if
(
i
==
NOINP
)
// timed-out waiting for '['
return
(
ESC
);
return
(
ESC
);
ch
=
i
;
ch
=
i
;
...
@@ -277,7 +279,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
...
@@ -277,7 +279,7 @@ char sbbs_t::handle_ctrlkey(char ch, long mode)
putuserrec
(
&
cfg
,
useron
.
number
,
U_MISC
,
8
,
ultoa
(
useron
.
misc
,
str
,
16
));
putuserrec
(
&
cfg
,
useron
.
number
,
U_MISC
,
8
,
ultoa
(
useron
.
misc
,
str
,
16
));
}
}
while
(
i
<
10
&&
j
<
30
)
{
/* up to 3 seconds */
while
(
i
<
10
&&
j
<
30
)
{
/* up to 3 seconds */
KBINCOM
(
ch
,
100
);
ch
=
kbincom
(
this
,
100
);
if
(
ch
==
(
NOINP
&
0xff
))
{
if
(
ch
==
(
NOINP
&
0xff
))
{
j
++
;
j
++
;
continue
;
continue
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment