$(call SAY, DISTCLEAN)
rm -f Makefile autoscan.log config.status config.log
rm -f config.h configure config.h.in
-maintainer-clean: distclean
+maintainer-clean: distclean test-clean
$(call SAY, MAINTAINER-CLEAN)
rm -f *.tar.bz2 *.tar.xz
rm -f GPATH GRTAGS GSYMS GTAGS
NEWS
====
+------------------------------------------
+0.7.2 (to be announced) "optical friction"
+------------------------------------------
+
+- Minor cleanup of the net subsystem.
+
+Downloads:
+[tarball](./releases/paraslash-git.tar.xz)
+
--------------------------------------
0.7.1 (2022-10-03) "digital spindrift"
--------------------------------------
requires support from the compiler, the oldest supported gcc version
has been bumped to gcc-5.4 (released in 2015).
+Downloads:
[tarball](./releases/paraslash-0.7.1.tar.xz),
[signature](./releases/paraslash-0.7.1.tar.xz.asc)
return send_sb(ct, 0, command, len, SBD_COMMAND, false);
}
+/* Find out if the given string is contained in the features vector. */
static bool has_feature(const char *feature, struct client_task *ct)
{
- return find_arg(feature, ct->features) >= 0? true : false;
+ if (!ct->features)
+ return false;
+ for (int i = 0; ct->features[i]; i++)
+ if (strcmp(feature, ct->features[i]) == 0)
+ return i;
+ return false;
}
/*
PARA_ERROR(AO_OPEN_LIVE, "ao: could not open audio device"), \
PARA_ERROR(AO_PLAY, "ao_play() failed"), \
PARA_ERROR(AO_PTHREAD, "pthread error"), \
- PARA_ERROR(ARG_NOT_FOUND, "argument not found in arg vector"), \
PARA_ERROR(ASN1_PARSE, "could not parse ASN.1 key"), \
PARA_ERROR(ATOI_JUNK_AT_END, "further characters after number"), \
PARA_ERROR(ATOI_NO_DIGITS, "no digits found in string"), \
d[SI_status_flags].align = LEFT;
d[SI_status_flags].x = 11;
d[SI_status_flags].y = 17;
- d[SI_status_flags].len = 10;
+ d[SI_status_flags].len = 8;
d[SI_image_id].prefix = "img: ";
d[SI_image_id].postfix = "";
d[SI_image_id].color.fg = COLOR_RED;
d[SI_image_id].color.bg = COLOR_BLACK;
d[SI_image_id].align = CENTER;
- d[SI_image_id].x = 21;
+ d[SI_image_id].x = 19;
d[SI_image_id].y = 17;
- d[SI_image_id].len = 10;
+ d[SI_image_id].len = 12;
d[SI_lyrics_id].prefix = "lyr: ";
d[SI_lyrics_id].postfix = "";
* overflows and rounding errors we store the common divisor of the
* correction factors separately.
*/
-static int64_t normalized_value(int64_t x, int64_t n, int64_t sum, int64_t qd)
-{
- if (!n || !qd)
- return 0;
- return 100 * (n * x - sum) / (int64_t)int_sqrt(n) / (int64_t)int_sqrt(qd);
-}
-
static long compute_score(struct afs_info *afsi)
{
- long score = -normalized_value(afsi->num_played, statistics.num,
- statistics.num_played_sum, statistics.num_played_qd);
- score -= normalized_value(afsi->last_played, statistics.num,
- statistics.last_played_sum, statistics.last_played_qd);
- return score / 2;
+ int64_t mean_n, mean_l,score_n, score_l;
+
+ assert(statistics.normalization_divisor > 0);
+ assert(statistics.num > 0);
+ mean_n = statistics.num_played_sum / statistics.num;
+ mean_l = statistics.last_played_sum / statistics.num;
+
+ score_n = -((int64_t)afsi->num_played - mean_n)
+ * statistics.num_played_correction
+ / statistics.normalization_divisor;
+ score_l = -((int64_t)afsi->last_played - mean_l)
+ * statistics.last_played_correction
+ / statistics.normalization_divisor;
+ return (score_n + score_l) / 2;
}
static int add_afs_statistics(const struct osl_row *row)
return create_argv_offset(1, buf, delim, result);
}
-/**
- * Find out if the given string is contained in the arg vector.
- *
- * \param arg The string to look for.
- * \param argv The array to search.
- *
- * \return The first index whose value equals \a arg, or \p -E_ARG_NOT_FOUND if
- * arg was not found in \a argv.
- */
-int find_arg(const char *arg, char **argv)
-{
- int i;
-
- if (!argv)
- return -E_ARG_NOT_FOUND;
- for (i = 0; argv[i]; i++)
- if (strcmp(arg, argv[i]) == 0)
- return i;
- return -E_ARG_NOT_FOUND;
-}
-
/**
* Compile a regular expression.
*
int read_size_header(const char *buf);
int create_argv(const char *buf, const char *delim, char ***result);
int create_shifted_argv(const char *buf, const char *delim, char ***result);
-int find_arg(const char *arg, char **argv);
void free_argv(char **argv);
int para_regcomp(regex_t *preg, const char *regex, int cflags);
void freep(void *arg);