Skip to content

Commit

Permalink
Fix complaint from cran about truncation
Browse files Browse the repository at this point in the history
  • Loading branch information
sgaure committed Aug 23, 2018
1 parent f410687 commit 3b9abf4
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: lfe
Version: 2.8-1
Version: 2.8-2
Date: 2018-08-22
Title: Linear Group Fixed Effects
Authors@R: person("Simen", "Gaure", email="[email protected]", role=c("aut","cre"))
Expand Down
5 changes: 5 additions & 0 deletions src/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* src/config.h. Generated from config.h.in by configure. */
#define HAVE_SEM 1
/* #undef NOTHREADS */
/* #undef HUGE_INT */
#define HAVE_THREADNAME 1
7 changes: 6 additions & 1 deletion src/demean.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,12 @@ static void *demeanlist_thr(void *varg) {
#ifdef HAVE_THREADNAME
#ifndef USEOMP
char thrname[16];
snprintf(thrname,16, "Ct %5d/%5d",vecnum+1, arg->K);
char buf[256];
// snprintf(thrname,16, "Ct %d/%d",vecnum+1, arg->K);
// cran whines about truncation
snprintf(buf,256,"Ct %d/%d",vecnum+1, arg->K);
buf[15] = 0;
memcpy(thrname,buf,16);
STNAME(thrname);
#endif
#endif
Expand Down
7 changes: 6 additions & 1 deletion src/kaczmarz.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ static void *kaczmarz_thr(void *varg) {
if(vecnum >= arg->numvec) break;
#ifdef HAVE_THREADNAME
char thrname[16];
snprintf(thrname, 16, "Kz %5d/%5d",vecnum+1, arg->numvec);
// cran whines about truncation here, that's the &%#@/%! purpose
//snprintf(thrname, 16, "Kz %d/%d",vecnum+1, arg->numvec);
char buf[256];
snprintf(buf,256,"Kz %d/%d",vecnum+1, arg->numvec);
buf[15] = 0;
memcpy(thrname,buf,16);
STNAME(thrname);
#endif

Expand Down

0 comments on commit 3b9abf4

Please sign in to comment.