Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
lyskom-server-ceder-1616-generations-topgit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
49ca1410
Commit
49ca1410
authored
Oct 22, 1998
by
Per Cederqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(greater): Added const qualifier.
(find_previous_text_no): Fixed the returned error status.
parent
261258c9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
src/server/text.c
src/server/text.c
+10
-7
No files found.
src/server/text.c
View file @
49ca1410
/*
/*
* $Id: text.c,v 0.5
5 1998/08/09 19:06:50
ceder Exp $
* $Id: text.c,v 0.5
6 1998/10/22 22:08:47
ceder Exp $
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996 Lysator Academic Computer Association.
*
*
* This file is part of the LysKOM server.
* This file is part of the LysKOM server.
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
*/
*/
static
const
char
*
static
const
char
*
rcsid
=
"$Id: text.c,v 0.5
5 1998/08/09 19:06:50
ceder Exp $"
;
rcsid
=
"$Id: text.c,v 0.5
6 1998/10/22 22:08:47
ceder Exp $"
;
#include "rcs.h"
#include "rcs.h"
USE
(
rcsid
);
USE
(
rcsid
);
...
@@ -2439,8 +2439,8 @@ delete_text( Text_no text_no )
...
@@ -2439,8 +2439,8 @@ delete_text( Text_no text_no )
/* Return TRUE if ``a'' is greater than ``b'. */
/* Return TRUE if ``a'' is greater than ``b'. */
static
Bool
static
Bool
greater
(
struct
tm
*
a
,
greater
(
const
struct
tm
*
a
,
struct
tm
*
b
)
const
struct
tm
*
b
)
{
{
if
(
a
->
tm_year
<
b
->
tm_year
)
if
(
a
->
tm_year
<
b
->
tm_year
)
return
FALSE
;
return
FALSE
;
...
@@ -2485,7 +2485,6 @@ extern Success
...
@@ -2485,7 +2485,6 @@ extern Success
get_last_text
(
struct
tm
*
wanted_time
,
get_last_text
(
struct
tm
*
wanted_time
,
Text_no
*
result
)
Text_no
*
result
)
{
{
/* FIXME: this looks bogus */
struct
tm
*
texttime
;
struct
tm
*
texttime
;
Text_no
lower
=
0
;
Text_no
lower
=
0
;
Text_no
higher
=
query_next_text_num
()
-
1
;
Text_no
higher
=
query_next_text_num
()
-
1
;
...
@@ -2506,6 +2505,9 @@ get_last_text(struct tm *wanted_time,
...
@@ -2506,6 +2505,9 @@ get_last_text(struct tm *wanted_time,
try
=
middle
;
try
=
middle
;
text_stat
=
NULL
;
text_stat
=
NULL
;
/* FIXME: Once there is a more efficient structure that maps
Text_nos to the internal cache_node this loop could
probably be rewritten in a more efficient way. */
while
(
text_stat
==
NULL
&&
try
<=
higher
)
while
(
text_stat
==
NULL
&&
try
<=
higher
)
text_stat
=
cached_get_text_stat
(
try
++
);
text_stat
=
cached_get_text_stat
(
try
++
);
...
@@ -2516,7 +2518,7 @@ get_last_text(struct tm *wanted_time,
...
@@ -2516,7 +2518,7 @@ get_last_text(struct tm *wanted_time,
texttime
=
localtime
(
&
text_stat
->
creation_time
);
texttime
=
localtime
(
&
text_stat
->
creation_time
);
if
(
greater
(
wanted_time
,
texttime
))
if
(
greater
(
wanted_time
,
texttime
))
lower
=
try
-
1
;
lower
=
try
-
1
;
else
/* The intervall is "halved" */
else
higher
=
middle
-
1
;
higher
=
middle
-
1
;
}
}
}
}
...
@@ -2564,8 +2566,8 @@ find_previous_text_no (Text_no start,
...
@@ -2564,8 +2566,8 @@ find_previous_text_no (Text_no start,
{
{
Text_stat
*
text_s
;
Text_stat
*
text_s
;
Text_no
next_tno
;
Text_no
next_tno
;
const
Text_no
saved_start
=
start
;
err_stat
=
start
;
if
(
start
>
(
next_tno
=
query_next_text_num
()))
if
(
start
>
(
next_tno
=
query_next_text_num
()))
start
=
next_tno
;
start
=
next_tno
;
...
@@ -2580,6 +2582,7 @@ find_previous_text_no (Text_no start,
...
@@ -2580,6 +2582,7 @@ find_previous_text_no (Text_no start,
}
}
kom_errno
=
KOM_NO_SUCH_TEXT
;
kom_errno
=
KOM_NO_SUCH_TEXT
;
err_stat
=
saved_start
;
return
FAILURE
;
return
FAILURE
;
}
}
...
...
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