1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Use C-sylte comments exclusively, never C++ comments. Ticket #2406. (CVS 4052)

FossilOrigin-Name: 8f5b789fea23d76128c10b37158de2525a54ce20
This commit is contained in:
drh
2007-06-08 18:27:03 +00:00
parent b70429577f
commit 3b62b2fa8b
3 changed files with 37 additions and 37 deletions

View File

@@ -1,5 +1,5 @@
C Additional\stest\scases\sfor\scomparisons\sagainst\sNULL\sin\sthe\sWHERE\sclause\nand\selsewhere\sin\sa\sSELECT.\s(CVS\s4051) C Use\sC-sylte\scomments\sexclusively,\snever\sC++\scomments.\s\sTicket\s#2406.\s(CVS\s4052)
D 2007-06-08T08:43:10 D 2007-06-08T18:27:03
F Makefile.in a42354804b50c2708ce72cf79e4daa30f50191b5 F Makefile.in a42354804b50c2708ce72cf79e4daa30f50191b5
F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -89,7 +89,7 @@ F src/os_os2.c 2ce97909b926a598823f97338027dbec1dcf4165
F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3 F src/os_os2.h e5f17dd69333632bbc3112881ea407c37d245eb3
F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c F src/os_test.c 49833426101f99aee4bb5f6a44b7c4b2029fda1c
F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3 F src/os_test.h 903c93554c23d88f34f667f1979e4a1cee792af3
F src/os_unix.c cb1fb044b84870c7b1b8b2902e9d7be779f8b7ce F src/os_unix.c f2ccf2e9a925fc679faf7a8fe85700e0f13cf0e1
F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e F src/os_unix.h 5768d56d28240d3fe4537fac08cc85e4fb52279e
F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd F src/os_win.c d868d5f9e95ec9c1b9e2a30c54c996053db6dddd
F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b F src/os_win.h 41a946bea10f61c158ce8645e7646b29d44f122b
@@ -501,7 +501,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
P 11ee8ea43f20f6146f4e4fcd9299468b3a99f998 P 72612a0373c7abf8aadfdeb46358c0b0ae7b07a0
R 05a9a5f63d57dfcd13c111df92ba4c0c R 4a0de78da8c062d2f4e8738bd1c4d8d0
U drh U drh
Z 2f14a325dddcad80036ac767af210cc8 Z c63d7a71f7409006622c28c29603bd15

View File

@@ -1 +1 @@
72612a0373c7abf8aadfdeb46358c0b0ae7b07a0 8f5b789fea23d76128c10b37158de2525a54ce20

View File

@@ -619,7 +619,7 @@ static sqlite3LockingStyle sqlite3DetectLockingStyle(const char *filePath,
return unsupportedLockingStyle; return unsupportedLockingStyle;
return sqlite3TestLockingStyle(filePath, fd); return sqlite3TestLockingStyle(filePath, fd);
#endif // SQLITE_FIXED_LOCKING_STYLE #endif /* SQLITE_FIXED_LOCKING_STYLE */
} }
#endif /* SQLITE_ENABLE_LOCKING_STYLE */ #endif /* SQLITE_ENABLE_LOCKING_STYLE */
@@ -1733,7 +1733,7 @@ static int _AFPFSSetLock(const char *path, int fd, unsigned long long offset,
if ( err==-1 ) { if ( err==-1 ) {
OSTRACE4("AFPLOCK failed to fsctl() '%s' %d %s\n", path, errno, OSTRACE4("AFPLOCK failed to fsctl() '%s' %d %s\n", path, errno,
strerror(errno)); strerror(errno));
return 1; // error return 1; /* error */
} else { } else {
return 0; return 0;
} }
@@ -1760,7 +1760,7 @@ static int afpUnixCheckReservedLock(OsFile *id){
/* Otherwise see if some other process holds it. /* Otherwise see if some other process holds it.
*/ */
if ( !r ) { if ( !r ) {
// lock the byte /* lock the byte */
int failed = _AFPFSSetLock(context->filePath, pFile->h, RESERVED_BYTE, 1,1); int failed = _AFPFSSetLock(context->filePath, pFile->h, RESERVED_BYTE, 1,1);
if (failed) { if (failed) {
/* if we failed to get the lock then someone else must have it */ /* if we failed to get the lock then someone else must have it */
@@ -2015,36 +2015,36 @@ static int flockUnixCheckReservedLock(OsFile *id) {
unixFile *pFile = (unixFile*)id; unixFile *pFile = (unixFile*)id;
if (pFile->locktype == RESERVED_LOCK) { if (pFile->locktype == RESERVED_LOCK) {
return 1; // already have a reserved lock return 1; /* already have a reserved lock */
} else { } else {
// attempt to get the lock /* attempt to get the lock */
int rc = flock(pFile->h, LOCK_EX | LOCK_NB); int rc = flock(pFile->h, LOCK_EX | LOCK_NB);
if (!rc) { if (!rc) {
// got the lock, unlock it /* got the lock, unlock it */
flock(pFile->h, LOCK_UN); flock(pFile->h, LOCK_UN);
return 0; // no one has it reserved return 0; /* no one has it reserved */
} }
return 1; // someone else might have it reserved return 1; /* someone else might have it reserved */
} }
} }
static int flockUnixLock(OsFile *id, int locktype) { static int flockUnixLock(OsFile *id, int locktype) {
unixFile *pFile = (unixFile*)id; unixFile *pFile = (unixFile*)id;
// if we already have a lock, it is exclusive. /* if we already have a lock, it is exclusive.
// Just adjust level and punt on outta here. ** Just adjust level and punt on outta here. */
if (pFile->locktype > NO_LOCK) { if (pFile->locktype > NO_LOCK) {
pFile->locktype = locktype; pFile->locktype = locktype;
return SQLITE_OK; return SQLITE_OK;
} }
// grab an exclusive lock /* grab an exclusive lock */
int rc = flock(pFile->h, LOCK_EX | LOCK_NB); int rc = flock(pFile->h, LOCK_EX | LOCK_NB);
if (rc) { if (rc) {
// didn't get, must be busy /* didn't get, must be busy */
return SQLITE_BUSY; return SQLITE_BUSY;
} else { } else {
// got it, set the type and return ok /* got it, set the type and return ok */
pFile->locktype = locktype; pFile->locktype = locktype;
return SQLITE_OK; return SQLITE_OK;
} }
@@ -2055,18 +2055,18 @@ static int flockUnixUnlock(OsFile *id, int locktype) {
assert( locktype<=SHARED_LOCK ); assert( locktype<=SHARED_LOCK );
// no-op if possible /* no-op if possible */
if( pFile->locktype==locktype ){ if( pFile->locktype==locktype ){
return SQLITE_OK; return SQLITE_OK;
} }
// shared can just be set because we always have an exclusive /* shared can just be set because we always have an exclusive */
if (locktype==SHARED_LOCK) { if (locktype==SHARED_LOCK) {
pFile->locktype = locktype; pFile->locktype = locktype;
return SQLITE_OK; return SQLITE_OK;
} }
// no, really, unlock. /* no, really, unlock. */
int rc = flock(pFile->h, LOCK_UN); int rc = flock(pFile->h, LOCK_UN);
if (rc) if (rc)
return SQLITE_IOERR_UNLOCK; return SQLITE_IOERR_UNLOCK;
@@ -2117,14 +2117,14 @@ static int dotlockUnixCheckReservedLock(OsFile *id) {
(dotlockLockingContext *) pFile->lockingContext; (dotlockLockingContext *) pFile->lockingContext;
if (pFile->locktype == RESERVED_LOCK) { if (pFile->locktype == RESERVED_LOCK) {
return 1; // already have a reserved lock return 1; /* already have a reserved lock */
} else { } else {
struct stat statBuf; struct stat statBuf;
if (lstat(context->lockPath,&statBuf) == 0) if (lstat(context->lockPath,&statBuf) == 0)
// file exists, someone else has the lock /* file exists, someone else has the lock */
return 1; return 1;
else else
// file does not exist, we could have it if we want it /* file does not exist, we could have it if we want it */
return 0; return 0;
} }
} }
@@ -2134,8 +2134,8 @@ static int dotlockUnixLock(OsFile *id, int locktype) {
dotlockLockingContext *context = dotlockLockingContext *context =
(dotlockLockingContext *) pFile->lockingContext; (dotlockLockingContext *) pFile->lockingContext;
// if we already have a lock, it is exclusive. /* if we already have a lock, it is exclusive.
// Just adjust level and punt on outta here. ** Just adjust level and punt on outta here. */
if (pFile->locktype > NO_LOCK) { if (pFile->locktype > NO_LOCK) {
pFile->locktype = locktype; pFile->locktype = locktype;
@@ -2144,21 +2144,21 @@ static int dotlockUnixLock(OsFile *id, int locktype) {
return SQLITE_OK; return SQLITE_OK;
} }
// check to see if lock file already exists /* check to see if lock file already exists */
struct stat statBuf; struct stat statBuf;
if (lstat(context->lockPath,&statBuf) == 0){ if (lstat(context->lockPath,&statBuf) == 0){
return SQLITE_BUSY; // it does, busy return SQLITE_BUSY; /* it does, busy */
} }
// grab an exclusive lock /* grab an exclusive lock */
int fd = open(context->lockPath,O_RDONLY|O_CREAT|O_EXCL,0600); int fd = open(context->lockPath,O_RDONLY|O_CREAT|O_EXCL,0600);
if (fd < 0) { if (fd < 0) {
// failed to open/create the file, someone else may have stolen the lock /* failed to open/create the file, someone else may have stolen the lock */
return SQLITE_BUSY; return SQLITE_BUSY;
} }
close(fd); close(fd);
// got it, set the type and return ok /* got it, set the type and return ok */
pFile->locktype = locktype; pFile->locktype = locktype;
return SQLITE_OK; return SQLITE_OK;
} }
@@ -2170,18 +2170,18 @@ static int dotlockUnixUnlock(OsFile *id, int locktype) {
assert( locktype<=SHARED_LOCK ); assert( locktype<=SHARED_LOCK );
// no-op if possible /* no-op if possible */
if( pFile->locktype==locktype ){ if( pFile->locktype==locktype ){
return SQLITE_OK; return SQLITE_OK;
} }
// shared can just be set because we always have an exclusive /* shared can just be set because we always have an exclusive */
if (locktype==SHARED_LOCK) { if (locktype==SHARED_LOCK) {
pFile->locktype = locktype; pFile->locktype = locktype;
return SQLITE_OK; return SQLITE_OK;
} }
// no, really, unlock. /* no, really, unlock. */
unlink(context->lockPath); unlink(context->lockPath);
pFile->locktype = NO_LOCK; pFile->locktype = NO_LOCK;
return SQLITE_OK; return SQLITE_OK;
@@ -2496,7 +2496,7 @@ static int allocateUnixFile(
return SQLITE_NOMEM; return SQLITE_NOMEM;
} }
} else { } else {
// pLock and pOpen are only used for posix advisory locking /* pLock and pOpen are only used for posix advisory locking */
f.pLock = NULL; f.pLock = NULL;
f.pOpen = NULL; f.pOpen = NULL;
} }