Skip to content

Commit

Permalink
modified: src/version.h
Browse files Browse the repository at this point in the history
  • Loading branch information
jvo203 committed Aug 30, 2022
1 parent f7fcc8c commit 0147cb2
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 27 deletions.
69 changes: 46 additions & 23 deletions WebAssembly/FFmpeg/libavutil/dict.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
#include "time_internal.h"
#include "bprint.h"

struct AVDictionary {
struct AVDictionary
{
int count;
AVDictionaryEntry *elems;
};
Expand All @@ -50,7 +51,8 @@ AVDictionaryEntry *av_dict_get(const AVDictionary *m, const char *key,
else
i = 0;

for (; i < m->count; i++) {
for (; i < m->count; i++)
{
const char *s = m->elems[i].key;
if (flags & AV_DICT_MATCH_CASE)
for (j = 0; s[j] == key[j] && key[j]; j++)
Expand All @@ -74,7 +76,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
AVDictionaryEntry *tag = NULL;
char *oldval = NULL, *copy_key = NULL, *copy_value = NULL;

if (!(flags & AV_DICT_MULTIKEY)) {
if (!(flags & AV_DICT_MULTIKEY))
{
tag = av_dict_get(m, key, NULL, flags);
}
if (flags & AV_DICT_DONT_STRDUP_KEY)
Expand All @@ -90,8 +93,10 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
if (!m || (key && !copy_key) || (value && !copy_value))
goto err_out;

if (tag) {
if (flags & AV_DICT_DONT_OVERWRITE) {
if (tag)
{
if (flags & AV_DICT_DONT_OVERWRITE)
{
av_free(copy_key);
av_free(copy_value);
return 0;
Expand All @@ -102,17 +107,21 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
av_free(tag->value);
av_free(tag->key);
*tag = m->elems[--m->count];
} else if (copy_value) {
}
else if (copy_value)
{
AVDictionaryEntry *tmp = av_realloc(m->elems,
(m->count + 1) * sizeof(*m->elems));
if (!tmp)
goto err_out;
m->elems = tmp;
}
if (copy_value) {
if (copy_value)
{
m->elems[m->count].key = copy_key;
m->elems[m->count].value = copy_value;
if (oldval && flags & AV_DICT_APPEND) {
if (oldval && flags & AV_DICT_APPEND)
{
size_t len = strlen(oldval) + strlen(copy_value) + 1;
char *newval = av_mallocz(len);
if (!newval)
Expand All @@ -124,18 +133,22 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
av_freep(&copy_value);
}
m->count++;
} else {
}
else
{
av_freep(&copy_key);
}
if (!m->count) {
if (!m->count)
{
av_freep(&m->elems);
av_freep(pm);
}

return 0;

err_out:
if (m && !m->count) {
if (m && !m->count)
{
av_freep(&m->elems);
av_freep(pm);
}
Expand All @@ -145,10 +158,10 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value,
}

int av_dict_set_int(AVDictionary **pm, const char *key, int64_t value,
int flags)
int flags)
{
char valuestr[22];
snprintf(valuestr, sizeof(valuestr), "%"PRId64, value);
snprintf(valuestr, sizeof(valuestr), "%" PRId64, value);
flags &= ~AV_DICT_DONT_STRDUP_VAL;
return av_dict_set(pm, key, valuestr, flags);
}
Expand All @@ -161,7 +174,8 @@ static int parse_key_value_pair(AVDictionary **pm, const char **buf,
char *val = NULL;
int ret;

if (key && *key && strspn(*buf, key_val_sep)) {
if (key && *key && strspn(*buf, key_val_sep))
{
(*buf)++;
val = av_get_token(buf, pairs_sep);
}
Expand Down Expand Up @@ -189,7 +203,8 @@ int av_dict_parse_string(AVDictionary **pm, const char *str,
/* ignore STRDUP flags */
flags &= ~(AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);

while (*str) {
while (*str)
{
if ((ret = parse_key_value_pair(pm, &str, key_val_sep, pairs_sep, flags)) < 0)
return ret;

Expand All @@ -204,8 +219,10 @@ void av_dict_free(AVDictionary **pm)
{
AVDictionary *m = *pm;

if (m) {
while (m->count--) {
if (m)
{
while (m->count--)
{
av_freep(&m->elems[m->count].key);
av_freep(&m->elems[m->count].value);
}
Expand All @@ -218,7 +235,8 @@ int av_dict_copy(AVDictionary **dst, const AVDictionary *src, int flags)
{
AVDictionaryEntry *t = NULL;

while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX))) {
while ((t = av_dict_get(src, "", t, AV_DICT_IGNORE_SUFFIX)))
{
int ret = av_dict_set(dst, t->key, t->value, flags);
if (ret < 0)
return ret;
Expand All @@ -239,13 +257,15 @@ int av_dict_get_string(const AVDictionary *m, char **buffer,
pairs_sep == '\\' || key_val_sep == '\\')
return AVERROR(EINVAL);

if (!av_dict_count(m)) {
if (!av_dict_count(m))
{
*buffer = av_strdup("");
return *buffer ? 0 : AVERROR(ENOMEM);
}

av_bprint_init(&bprint, 64, AV_BPRINT_SIZE_UNLIMITED);
while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX))) {
while ((t = av_dict_get(m, "", t, AV_DICT_IGNORE_SUFFIX)))
{
if (cnt++)
av_bprint_append_data(&bprint, &pairs_sep, 1);
av_bprint_escape(&bprint, t->key, special_chars, AV_ESCAPE_MODE_BACKSLASH, 0);
Expand All @@ -259,14 +279,17 @@ int avpriv_dict_set_timestamp(AVDictionary **dict, const char *key, int64_t time
{
time_t seconds = timestamp / 1000000;
struct tm *ptm, tmbuf;
ptm = gmtime_r(&seconds, &tmbuf);
if (ptm) {
ptm = (struct tm *)gmtime_r(&seconds, &tmbuf);
if (ptm)
{
char buf[32];
if (!strftime(buf, sizeof(buf), "%Y-%m-%dT%H:%M:%S", ptm))
return AVERROR_EXTERNAL;
av_strlcatf(buf, sizeof(buf), ".%06dZ", (int)(timestamp % 1000000));
return av_dict_set(dict, key, buf, 0);
} else {
}
else
{
return AVERROR_EXTERNAL;
}
}
2 changes: 1 addition & 1 deletion WebAssembly/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.DEFAULT_GOAL := wasm
VERSION = 22.08.XX.X
VERSION = 22.08.30.0

ZFP = zfp
ZFP_SRC := $(wildcard $(ZFP)/src/*.c)
Expand Down
1 change: 1 addition & 0 deletions htdocs/fitswebql/client.22.08.30.0.js

Large diffs are not rendered by default.

Binary file not shown.
1 change: 0 additions & 1 deletion htdocs/fitswebql/client.22.08.XX.X.js

This file was deleted.

4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"FITSWEBQLSE v" STR(VERSION_MAJOR) "." STR(VERSION_MINOR) "." STR( \
VERSION_SUB)

#define WASM_VERSION "22.08.XX.X"
#define VERSION_STRING "F/SV2022-08-XX.X-BETA"
#define WASM_VERSION "22.08.30.0"
#define VERSION_STRING "F/SV2022-08-30.0-BETA"

0 comments on commit 0147cb2

Please sign in to comment.