summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/teams.c6
-rw-r--r--src/teams.h8
2 files changed, 8 insertions, 6 deletions
diff --git a/src/teams.c b/src/teams.c
index e8dbf74..9b6d37b 100644
--- a/src/teams.c
+++ b/src/teams.c
@@ -24,17 +24,17 @@ DEL(team, {
// Setter definitions
// @set char[]: TEAM.name -> bool
-SETTER(team, name, char *, {
+SETTER(team, name, const ref(char), {
return !(strncpy(self->name, value, 255) == NULL);
})
// @set char[]: TEAM.institution -> bool
-SETTER(team, institution, char *, {
+SETTER(team, institution, const ref(char), {
return !(strncpy(self->institution, value, 255) == NULL);
})
// @set char[]: TEAM.member_name, int: id -> bool
-SETTER(team, member_name, char *, {
+SETTER(team, member_name, const ref(char), {
return (id > 0 && id < 4 && !(strncpy(self->members[id-1], value, 255) == NULL));
}, int id)
diff --git a/src/teams.h b/src/teams.h
index e22b262..342ce95 100644
--- a/src/teams.h
+++ b/src/teams.h
@@ -3,6 +3,8 @@
# include <stdint.h>
# include <stdbool.h>
# include "cobj.h"
+# include "common.h"
+
// Type definition
typedef struct team_impl_struct * team;
@@ -11,9 +13,9 @@ NEW(team);
DEL(team);
// field getters
-SETTER(team, name, char *);
-SETTER(team, institution, char *);
-SETTER(team, member_name, char *, int);
+SETTER(team, name, const ref(char));
+SETTER(team, institution, const ref(char));
+SETTER(team, member_name, const ref(char), int);
SETTER(team, solved, uint8_t);
// field setters