mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Centralise TRUE and FALSE definitions into defs.h.
This removes a lot of pointless duplications of those constants. Of course, _ideally_, I should upgrade to C99 bool throughout the code base, replacing TRUE and FALSE with true and false and tagging variables explicitly as bool when that's what they semantically are. But that's a much bigger piece of work, and shouldn't block this trivial cleanup!
This commit is contained in:
parent
43ec3397b6
commit
c9bad331e6
7
defs.h
7
defs.h
@ -11,6 +11,13 @@
|
||||
#ifndef PUTTY_DEFS_H
|
||||
#define PUTTY_DEFS_H
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
typedef struct conf_tag Conf;
|
||||
typedef struct backend_tag Backend;
|
||||
typedef struct terminal_tag Terminal;
|
||||
|
7
misc.h
7
misc.h
@ -13,13 +13,6 @@
|
||||
#include <stdarg.h> /* for va_list */
|
||||
#include <time.h> /* for struct tm */
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
unsigned long parse_blocksize(const char *bs);
|
||||
char ctrlparse(char *s, char **next);
|
||||
|
||||
|
@ -8,13 +8,6 @@
|
||||
#include "putty.h"
|
||||
#include "ssh.h"
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
struct PortForwarding {
|
||||
const struct plug_function_table *fn;
|
||||
/* the above variable absolutely *must* be the first in this structure */
|
||||
|
7
raw.c
7
raw.c
@ -8,13 +8,6 @@
|
||||
|
||||
#include "putty.h"
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define RAW_MAX_BACKLOG 4096
|
||||
|
||||
typedef struct raw_backend_data {
|
||||
|
7
rlogin.c
7
rlogin.c
@ -9,13 +9,6 @@
|
||||
|
||||
#include "putty.h"
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define RLOGIN_MAX_BACKLOG 4096
|
||||
|
||||
typedef struct rlogin_tag {
|
||||
|
7
ssh.c
7
ssh.c
@ -25,13 +25,6 @@
|
||||
#define GSS_CTXT_MAYFAIL (1<<3) /* Context may expire during handshake */
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Packet type contexts, so that ssh2_pkt_type can correctly decode
|
||||
* the ambiguous type numbers back into the correct type strings.
|
||||
|
14
sshzlib.c
14
sshzlib.c
@ -41,6 +41,8 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
#ifdef ZLIB_STANDALONE
|
||||
|
||||
/*
|
||||
@ -57,13 +59,15 @@
|
||||
#define sresize(x, n, type) ( (type *) realloc((x), (n) * sizeof(type)) )
|
||||
#define sfree(x) ( free((x)) )
|
||||
|
||||
#else
|
||||
#include "ssh.h"
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#define TRUE (!FALSE)
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#else
|
||||
#include "ssh.h"
|
||||
#endif
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
7
telnet.c
7
telnet.c
@ -8,13 +8,6 @@
|
||||
|
||||
#include "putty.h"
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
#define IAC 255 /* interpret as command: */
|
||||
#define DONT 254 /* you are not to use option */
|
||||
#define DO 253 /* please, you use option */
|
||||
|
@ -29,13 +29,6 @@
|
||||
#include <utmpx.h>
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
/* updwtmpx() needs the name of the wtmp file. Try to find it. */
|
||||
#ifndef WTMPX_FILE
|
||||
#ifdef _PATH_WTMPX
|
||||
|
Loading…
Reference in New Issue
Block a user