MySQL++

Check-in [78fc2ae13b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Removed "register" qualifiers from all variable declarations. It's deprecated in C++11 and C++14 and is now illegal in C++17. Closes [648dafd5ed].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA3-256:78fc2ae13bcfa8eb627d905b1b32028ff8da41c4716f8a478d9cd9d252e2a6a4
User & Date: tangent 2018-05-02 14:34:38
References
2018-05-02
14:35 Closed ticket [648dafd5ed]: register keyword is removed in C++17 plus 6 other changes artifact: 5778eb1430 user: tangent
Context
2018-05-02
14:34
Removed "register" qualifiers from all variable declarations. It's deprecated in C++11 and C++14 and is now illegal in C++17. Closes [648dafd5ed]. Leaf check-in: 78fc2ae13b user: tangent tags: trunk
2017-11-23
01:06
Added some SSQLSv2 testing files present in previous svn repo but not in tarballs, thus not restored in Fossil conversion, which prevented dtest from running to completion. Since SSQLSv2 has never been completed, this is purely annoying rather than actually important. check-in: 143985738d user: tangent tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/beemutex.cpp.

69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#if defined(MYSQLPP_PLATFORM_WINDOWS)
	*impl_ptr(pmutex_) = CreateMutex((LPSECURITY_ATTRIBUTES) 0, FALSE,
			(LPCTSTR) 0);
	if (!impl_val(pmutex_))
		throw MutexFailed("CreateMutex failed");
#else
#	if HAVE_SYNCH_H || HAVE_PTHREAD
	register int rc;
#	endif
#	if HAVE_PTHREAD
		if ((rc = pthread_mutex_init(impl_ptr(pmutex_), 0)))
			throw MutexFailed(strerror(rc));
#	elif HAVE_SYNCH_H
		if ((rc = mutex_init(impl_ptr(pmutex_), USYNC_THREAD, 0)))
			throw MutexFailed(strerror(rc));
................................................................................
{
#if defined(MYSQLPP_PLATFORM_WINDOWS)
	if (WaitForSingleObject(impl_val(pmutex_), INFINITE) == WAIT_OBJECT_0)
		return;
	throw MutexFailed("WaitForSingleObject failed");
#else
#	if HAVE_SYNCH_H || HAVE_PTHREAD
	register int rc;
#	endif
#	if HAVE_PTHREAD
		if ((rc = pthread_mutex_lock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
#	elif HAVE_SYNCH_H
		if ((rc = mutex_lock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
................................................................................
				return false;
			case WAIT_OBJECT_0:
				return true;
			default:
				throw MutexFailed("WaitForSingleObbject failed");
		}
#	else
		register int rc;
#		if HAVE_PTHREAD
			if ((rc = pthread_mutex_trylock(impl_ptr(pmutex_))) == 0)
				return true;
			if (rc == EBUSY)
				return false;
			throw MutexFailed(strerror(rc));
#		elif HAVE_SYNCH_H
................................................................................
BeecryptMutex::unlock() throw (MutexFailed)
{
#if defined(MYSQLPP_PLATFORM_WINDOWS)
	if (!ReleaseMutex(impl_val(pmutex_)))
		throw MutexFailed("ReleaseMutex failed");
#else
#	if HAVE_SYNCH_H || HAVE_PTHREAD
		register int rc;
#	endif
#	if HAVE_PTHREAD
		if ((rc = pthread_mutex_unlock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
#	elif HAVE_SYNCH_H
		if ((rc = mutex_unlock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
#	endif
#endif
}

} // end namespace mysqlpp








|







 







|







 







|







 







|













69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
...
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
#if defined(MYSQLPP_PLATFORM_WINDOWS)
	*impl_ptr(pmutex_) = CreateMutex((LPSECURITY_ATTRIBUTES) 0, FALSE,
			(LPCTSTR) 0);
	if (!impl_val(pmutex_))
		throw MutexFailed("CreateMutex failed");
#else
#	if HAVE_SYNCH_H || HAVE_PTHREAD
	int rc;
#	endif
#	if HAVE_PTHREAD
		if ((rc = pthread_mutex_init(impl_ptr(pmutex_), 0)))
			throw MutexFailed(strerror(rc));
#	elif HAVE_SYNCH_H
		if ((rc = mutex_init(impl_ptr(pmutex_), USYNC_THREAD, 0)))
			throw MutexFailed(strerror(rc));
................................................................................
{
#if defined(MYSQLPP_PLATFORM_WINDOWS)
	if (WaitForSingleObject(impl_val(pmutex_), INFINITE) == WAIT_OBJECT_0)
		return;
	throw MutexFailed("WaitForSingleObject failed");
#else
#	if HAVE_SYNCH_H || HAVE_PTHREAD
	int rc;
#	endif
#	if HAVE_PTHREAD
		if ((rc = pthread_mutex_lock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
#	elif HAVE_SYNCH_H
		if ((rc = mutex_lock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
................................................................................
				return false;
			case WAIT_OBJECT_0:
				return true;
			default:
				throw MutexFailed("WaitForSingleObbject failed");
		}
#	else
		int rc;
#		if HAVE_PTHREAD
			if ((rc = pthread_mutex_trylock(impl_ptr(pmutex_))) == 0)
				return true;
			if (rc == EBUSY)
				return false;
			throw MutexFailed(strerror(rc));
#		elif HAVE_SYNCH_H
................................................................................
BeecryptMutex::unlock() throw (MutexFailed)
{
#if defined(MYSQLPP_PLATFORM_WINDOWS)
	if (!ReleaseMutex(impl_val(pmutex_)))
		throw MutexFailed("ReleaseMutex failed");
#else
#	if HAVE_SYNCH_H || HAVE_PTHREAD
		int rc;
#	endif
#	if HAVE_PTHREAD
		if ((rc = pthread_mutex_unlock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
#	elif HAVE_SYNCH_H
		if ((rc = mutex_unlock(impl_ptr(pmutex_))))
			throw MutexFailed(strerror(rc));
#	endif
#endif
}

} // end namespace mysqlpp

Changes to lib/cmdline.cpp.

51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
		// getopt(), if autoconf test fails to find it.
		static const char* optarg;
		static int optind = 1;
		static int getopt(int argc, char* const argv[], const char* opts)
		{
			static int optopt;
			static int sp = 1;
			register int c;
			register const char *cp;

			if (sp == 1) {
				/* If all args are processed, finish */
				if (optind >= argc) {
					return EOF;
				}
				if (argv[optind][0] != '-' || argv[optind][1] == '\0') {







|
|







51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
		// getopt(), if autoconf test fails to find it.
		static const char* optarg;
		static int optind = 1;
		static int getopt(int argc, char* const argv[], const char* opts)
		{
			static int optopt;
			static int sp = 1;
			int c;
			const char *cp;

			if (sp == 1) {
				/* If all args are processed, finish */
				if (optind >= argc) {
					return EOF;
				}
				if (argv[optind][0] != '-' || argv[optind][1] == '\0') {