Skip to content

Commit

Permalink
fix Warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
asukaminato0721 committed Oct 9, 2024
1 parent 8188e44 commit 91fe595
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
set -eux
cargo build
BASEDIR="$( cd "$( dirname "$0" )" && pwd )"
gcc -o main examples/basic.c -L${BASEDIR}/target/debug/ -lrs_fsrs_c -I${BASEDIR}/include/
env LD_LIBRARY_PATH=${BASEDIR}/target/debug/ ./main
gcc -o a.out examples/basic.c -L${BASEDIR}/target/debug/ -lrs_fsrs_c -I${BASEDIR}/include/ -Wall -Wextra -pedantic
env LD_LIBRARY_PATH=${BASEDIR}/target/debug/ ./a.out
10 changes: 7 additions & 3 deletions examples/basic.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include "../include/fsrs.h"
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
#include <time.h>

int main(void) {
fsrs_Fsrs F1 = fsrs_Fsrs_new(
fsrs_Fsrs _F1 = fsrs_Fsrs_new(
(fsrs_Parameters){.maximum_interval = 36000,
.request_retention = 0.9,
.w = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
Expand All @@ -26,8 +27,11 @@ int main(void) {
fsrs_Card card = fsrs_SchedulingInfo_card(&scheduling_info);
fsrs_ReviewLog log = fsrs_SchedulingInfo_review_log(&scheduling_info);

printf("scheduled_days: %ld\nelapsed_days: %ld\ndate: %srating: %d\nstate: "
"%d\n",
printf("scheduled_days: %" PRId64 "\nelapsed_days: %" PRId64
"\ndate: %s"
"rating: %d"
"\nstate: %d"
"\n",
log.scheduled_days, log.elapsed_days,
asctime(localtime(&log.reviewed_date_s)), log.rating, log.state);
printf("card:\n elapsed_days: %ld\n scheduled_days: %ld\n due: %ld\n "
Expand Down

0 comments on commit 91fe595

Please sign in to comment.