projects
/
paraslash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix trivial compiler warning in net.c
[paraslash.git]
/
random_selector.c
diff --git
a/random_selector.c
b/random_selector.c
index 37e9116bc24d9ea21e388b7b85576fdeae541525..ec1f5c6c53c39982cdf2ed488447598bcbfb59cd 100644
(file)
--- a/
random_selector.c
+++ b/
random_selector.c
@@
-33,7
+33,7
@@
extern struct misc_meta_data *mmd;
static unsigned int num_audio_files, audio_file_count;
static char **audio_file_list;
static unsigned int num_audio_files, audio_file_count;
static char **audio_file_list;
-static int count_audio_files(__
unused const char *dir, _
_unused const char *name)
+static int count_audio_files(__
a_unused const char *dir, __a
_unused const char *name)
{
num_audio_files++;
return 1;
{
num_audio_files++;
return 1;
@@
-64,7
+64,7
@@
static struct server_command cmds[] = {
}
};
}
};
-static int com_random_info(int fd, __
unused int argc, _
_unused char *argv[])
+static int com_random_info(int fd, __
a_unused int argc, __a
_unused char *argv[])
{
return send_buffer(fd, "Don't use for huge directories as it is "
"very inefficient in this case.\n");
{
return send_buffer(fd, "Don't use for huge directories as it is "
"very inefficient in this case.\n");
@@
-98,7
+98,7
@@
static char **random_get_audio_file_list(unsigned int num)
goto out;
/* careful, files might got deleted underneath */
num_audio_files = audio_file_count; /* can only decrease */
goto out;
/* careful, files might got deleted underneath */
num_audio_files = audio_file_count; /* can only decrease */
- len = MIN(num, num_audio_files);
+ len =
PARA_
MIN(num, num_audio_files);
ret = -E_NOTHING_FOUND;
if (!len) /* nothing found, return NULL */
goto out;
ret = -E_NOTHING_FOUND;
if (!len) /* nothing found, return NULL */
goto out;
@@
-124,23
+124,21
@@
static void random_shutdown(void)
{
}
{
}
-/** random's (constant) database info text */
-#define DBINFO "dbinfo1:database info? You're kidding. I'm still dopey!\ndbinfo2:\ndbinfo3:\n"
-
/**
* the init function for the random audio file selector
*
/**
* the init function for the random audio file selector
*
- * Init all function pointers of \a db, init the
db
info text and seed the
+ * Init all function pointers of \a db, init the info text and seed the
* PRNG.
*
* PRNG.
*
- * \sa struct audio_file_selector, misc_meta_data::
db
info, mysql.c
+ * \sa struct audio_file_selector, misc_meta_data::
selector_
info, mysql.c
*/
int random_selector_init(struct audio_file_selector *db)
{
struct timeval now;
PARA_INFO_LOG("%s", "registering random handlers ;)\n");
*/
int random_selector_init(struct audio_file_selector *db)
{
struct timeval now;
PARA_INFO_LOG("%s", "registering random handlers ;)\n");
- sprintf(mmd->dbinfo, DBINFO);
+ sprintf(mmd->selector_info, "dbinfo1:database info? You're kidding. "
+ "I'm still dopey!\ndbinfo2:\ndbinfo3:\n");
gettimeofday(&now, NULL);
srand(now.tv_usec);
db->cmd_list = cmds;
gettimeofday(&now, NULL);
srand(now.tv_usec);
db->cmd_list = cmds;