Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SeFHT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
SeFHT
Commits
07448c37
Commit
07448c37
authored
2 years ago
by
Jonathan Schöbel
Browse files
Options
Downloads
Patches
Plain Diff
fixed type choice
An array index should be of size_t instead of unsigned int.
parent
fed99df0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
sefht.geany
+3
-3
3 additions, 3 deletions
sefht.geany
src/lib/sefht/data.c
+4
-3
4 additions, 3 deletions
src/lib/sefht/data.c
tests/test_data.c
+4
-4
4 additions, 4 deletions
tests/test_data.c
with
11 additions
and
10 deletions
sefht.geany
+
3
−
3
View file @
07448c37
...
...
@@ -28,14 +28,14 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=2
2
current_page=2
4
FILE_NAME_0=923;Sh;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fconfigure.ac;0;8
FILE_NAME_1=73;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2FMakefile.am;0;8
FILE_NAME_2=1082;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Fmain.c;0;8
FILE_NAME_3=640;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2FMakefile.am;0;8
FILE_NAME_4=944;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fcms.c;0;8
FILE_NAME_5=1021;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fcms.h;0;8
FILE_NAME_6=11
93
;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fdata.c;0;8
FILE_NAME_6=
45
11;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fdata.c;0;8
FILE_NAME_7=1145;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fdata.h;0;8
FILE_NAME_8=1733;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment.c;0;8
FILE_NAME_9=1223;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Ffragment.h;0;8
...
...
@@ -53,7 +53,7 @@ FILE_NAME_20=1077;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fp
FILE_NAME_21=937;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Fsrc%2Flib%2Fsefht%2Fsefht.h;0;8
FILE_NAME_22=499;Make;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2FMakefile.am;0;8
FILE_NAME_23=876;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_cms.c;0;8
FILE_NAME_24=
894
;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_data.c;0;8
FILE_NAME_24=
3168
;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_data.c;0;8
FILE_NAME_25=952;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_node_fragment.c;0;8
FILE_NAME_26=5736;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_text.c;0;8
FILE_NAME_27=4687;C;0;EUTF-8;1;1;0;%2Fhome%2Fjonathan%2FDokumente%2Fprojekte%2Fprgm%2Finternet%2Fweb%2FSeFHT%2Ftests%2Ftest_validator.c;0;8
...
...
This diff is collapsed.
Click to expand it.
src/lib/sefht/data.c
+
4
−
3
View file @
07448c37
...
...
@@ -24,6 +24,7 @@
#include
<errno.h>
#include
<stdbool.h>
#include
<stdint.h>
#include
<stdlib.h>
#include
<string.h>
...
...
@@ -47,7 +48,7 @@ struct SH_Page
struct
SH_Data
{
struct
SH_Validator
*
validator
;
unsigned
in
t
page_n
;
size_
t
page_n
;
struct
SH_Page
*
pages
;
page_t
last_page
;
};
...
...
@@ -157,7 +158,7 @@ init_pages (struct SH_Data * data)
static
inline
void
free_pages
(
struct
SH_Data
*
data
)
{
unsigned
in
t
index
;
size_
t
index
;
for
(
index
=
0
;
index
<
data
->
page_n
;
index
++
)
{
...
...
@@ -173,7 +174,7 @@ SH_Data_register_page (struct SH_Data * data, const char * name,
struct
SH_Status
*
status
)
{
/* abort on overflow */
if
(
data
->
page
_n
==
UINT
_MAX
||
data
->
last_
page
==
PAG
E_MAX
)
if
(
(
data
->
last_
page
==
PAGE
_MAX
)
||
(
data
->
page
_n
==
SIZ
E_MAX
)
)
{
set_status
(
status
,
E_DOMAIN
,
0
,
"Maximum number of pages reached.
\n
"
);
...
...
This diff is collapsed.
Click to expand it.
tests/test_data.c
+
4
−
4
View file @
07448c37
...
...
@@ -80,12 +80,12 @@ START_TEST(test_data_register_page)
ck_assert_str_eq
(
data
->
pages
[
0
].
name
,
page1
);
/* fail without error */
data
->
page_n
=
UINT
_MAX
;
data
->
page_n
=
SIZE
_MAX
;
page
=
SH_Data_register_page
(
data
,
page2
,
NULL
);
ck_assert_int_eq
(
page
,
PAGE_ERR
);
ck_assert_int_eq
(
data
->
page_n
,
UINT
_MAX
);
ck_assert_int_eq
(
data
->
page_n
,
SIZE
_MAX
);
ck_assert_int_eq
(
data
->
last_page
,
1
);
/* fail2 without error */
...
...
@@ -113,14 +113,14 @@ START_TEST(test_data_register_page)
ck_assert_str_eq
(
data
->
pages
[
1
].
name
,
page4
);
/* fail with error */
data
->
page_n
=
UINT
_MAX
;
data
->
page_n
=
SIZE
_MAX
;
status
.
status
=
UNDEFINED
;
page
=
SH_Data_register_page
(
data
,
page5
,
&
status
);
ck_assert_int_eq
(
page
,
PAGE_ERR
);
ck_assert_int_eq
(
status
.
status
,
E_DOMAIN
);
ck_assert_int_eq
(
data
->
page_n
,
UINT
_MAX
);
ck_assert_int_eq
(
data
->
page_n
,
SIZE
_MAX
);
ck_assert_int_eq
(
data
->
last_page
,
2
);
/* fail2 with error */
...
...
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