Skip to content

Commit

Permalink
Merge branch 'v6.8.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed Jun 28, 2020
2 parents 53a336c + 889c07d commit 0f59ea1
Show file tree
Hide file tree
Showing 33 changed files with 277 additions and 677 deletions.
6 changes: 6 additions & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ Version 7.0 - not yet released
* Raspberry Pi
- resizable mouse cursor

Version 6.8.16 - not yet released
* glide computer
- fix crash bug
* terrain
- fix several crash bugs (JasPer)

Version 6.8.15 - 2020/06/13
* user interface
- vario: fix overlapping text lines
Expand Down
4 changes: 2 additions & 2 deletions android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.xcsoar"
android:installLocation="auto"
android:versionCode="117"
android:versionName="6.8.15">
android:versionCode="118"
android:versionName="6.8.16">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".XCSoar"
android:label="@string/app_name"
Expand Down
3 changes: 0 additions & 3 deletions build/targets.mk
Original file line number Diff line number Diff line change
Expand Up @@ -593,9 +593,6 @@ ifeq ($(TARGET),ANDROID)

ifeq ($(ARMV7),y)
TARGET_LDFLAGS += -Wl,--fix-cortex-a8

# workaround for "... uses VFP register arguments, output does not"
TARGET_LDFLAGS += -Wl,--no-warn-mismatch
endif
endif

Expand Down
14 changes: 8 additions & 6 deletions src/Computer/GlideComputerAirData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ GlideComputerAirData::ProcessVertical(const MoreData &basic,
wind_computer.Select(settings.wind, basic, calculated);
wind_computer.ComputeHeadWind(basic, calculated);

thermallocator.Process(calculated.circling && calculated.turning,
basic.time, basic.location,
basic.netto_vario,
calculated.GetWindOrZero(),
calculated.thermal_locator);
if (basic.location_available)
thermallocator.Process(calculated.circling && calculated.turning,
basic.time, basic.location,
basic.netto_vario,
calculated.GetWindOrZero(),
calculated.thermal_locator);

LastThermalStats(basic, calculated, last_circling);

Expand Down Expand Up @@ -212,7 +213,8 @@ GlideComputerAirData::GR(const MoreData &basic, const FlyingState &flying,
inline void
GlideComputerAirData::CruiseGR(const MoreData &basic, DerivedInfo &calculated)
{
if (!calculated.circling && basic.NavAltitudeAvailable()) {
if (!calculated.circling && basic.location_available &&
basic.NavAltitudeAvailable()) {
if (calculated.cruise_start_time < 0) {
calculated.cruise_start_location = basic.location;
calculated.cruise_start_altitude = basic.nav_altitude;
Expand Down
2 changes: 1 addition & 1 deletion src/Device/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ NMEAParser::GGA(NMEAInputLine &line, NMEAInfo &info)
// If the separation doesn't appear in the sentence,
// we can assume the GPS unit is giving ellipsoid height
//
if (use_geoid) {
if (use_geoid && info.location_available) {
// JMW TODO really need to know the actual device..
geoid_separation = EGM96::LookupSeparation(info.location);
info.gps_altitude -= geoid_separation;
Expand Down
8 changes: 4 additions & 4 deletions src/Terrain/jasper/base/jas_malloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@
* Includes.
\******************************************************************************/

#include "jasper/jas_malloc.h"
#include "jasper/jas_debug.h"
#include "jasper/jas_math.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
Expand All @@ -80,10 +84,6 @@
/* We need the prototype for memset. */
#include <string.h>

#include "jasper/jas_malloc.h"
#include "jasper/jas_debug.h"
#include "jasper/jas_math.h"

/******************************************************************************\
* Code.
\******************************************************************************/
Expand Down
126 changes: 14 additions & 112 deletions src/Terrain/jasper/base/jas_seq.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@
* Includes.
\******************************************************************************/

#include <stdlib.h>
#include <assert.h>
#include <math.h>

#include "jasper/jas_seq.h"
#include "jasper/jas_malloc.h"
#include "jasper/jas_math.h"

#include <stdlib.h>
#include <assert.h>
#include <math.h>

/******************************************************************************\
* Constructors and destructors.
\******************************************************************************/
Expand Down Expand Up @@ -107,24 +107,23 @@ jas_matrix_t *jas_matrix_create(jas_matind_t numrows, jas_matind_t numcols)
matrix = 0;

if (numrows < 0 || numcols < 0) {
goto error;
return NULL;
}

// matrix->datasize_ = numrows * numcols;
if (!jas_safe_size_mul(numrows, numcols, &size)) {
return NULL;
}

if (!(matrix = jas_malloc(sizeof(jas_matrix_t)))) {
goto error;
return NULL;
}
matrix->flags_ = 0;
matrix->numrows_ = numrows;
matrix->numcols_ = numcols;
matrix->rows_ = 0;
matrix->maxrows_ = numrows;
matrix->data_ = 0;
matrix->datasize_ = 0;

// matrix->datasize_ = numrows * numcols;
if (!jas_safe_size_mul(numrows, numcols, &size)) {
goto error;
}
matrix->datasize_ = size;

if (matrix->maxrows_ > 0) {
Expand Down Expand Up @@ -156,23 +155,17 @@ jas_matrix_t *jas_matrix_create(jas_matind_t numrows, jas_matind_t numcols)
return matrix;

error:
if (matrix) {
jas_matrix_destroy(matrix);
}
jas_matrix_destroy(matrix);
return 0;
}

void jas_matrix_destroy(jas_matrix_t *matrix)
{
if (matrix->data_) {
assert(!(matrix->flags_ & JAS_MATRIX_REF));
jas_free(matrix->data_);
matrix->data_ = 0;
}
if (matrix->rows_) {
jas_free(matrix->rows_);
matrix->rows_ = 0;
}
jas_free(matrix->data_);
jas_free(matrix->rows_);
jas_free(matrix);
}

Expand Down Expand Up @@ -422,94 +415,3 @@ void jas_matrix_setall(jas_matrix_t *matrix, jas_seqent_t val)
}
}
}

#ifdef ENABLE_JASPER_DUMP
jas_matrix_t *jas_seq2d_input(FILE *in)
{
jas_matrix_t *matrix;
jas_matind_t i;
jas_matind_t j;
long x;
jas_matind_t numrows;
jas_matind_t numcols;
jas_matind_t xoff;
jas_matind_t yoff;
long tmp_xoff;
long tmp_yoff;
long tmp_numrows;
long tmp_numcols;

if (fscanf(in, "%ld %ld", &tmp_xoff, &tmp_yoff) != 2) {
return 0;
}
xoff = tmp_xoff;
yoff = tmp_yoff;
if (fscanf(in, "%ld %ld", &tmp_numcols, &tmp_numrows) != 2) {
return 0;
}
numrows = tmp_numrows;
numcols = tmp_numcols;
if (!(matrix = jas_seq2d_create(xoff, yoff, xoff + numcols,
yoff + numrows))) {
return 0;
}

if (jas_matrix_numrows(matrix) != numrows ||
jas_matrix_numcols(matrix) != numcols) {
abort();
}

/* Get matrix data. */
for (i = 0; i < jas_matrix_numrows(matrix); i++) {
for (j = 0; j < jas_matrix_numcols(matrix); j++) {
if (fscanf(in, "%ld", &x) != 1) {
jas_matrix_destroy(matrix);
return 0;
}
jas_matrix_set(matrix, i, j, JAS_CAST(jas_seqent_t, x));
}
}

return matrix;
}

int jas_seq2d_output(jas_matrix_t *matrix, FILE *out)
{
#define MAXLINELEN 80
jas_matind_t i;
jas_matind_t j;
jas_seqent_t x;
char buf[MAXLINELEN + 1];
char sbuf[MAXLINELEN + 1];
int n;

fprintf(out, "%"PRIiFAST32" %"PRIiFAST32"\n", jas_seq2d_xstart(matrix),
jas_seq2d_ystart(matrix));
fprintf(out, "%"PRIiFAST32" %"PRIiFAST32"\n", jas_matrix_numcols(matrix),
jas_matrix_numrows(matrix));

buf[0] = '\0';
for (i = 0; i < jas_matrix_numrows(matrix); ++i) {
for (j = 0; j < jas_matrix_numcols(matrix); ++j) {
x = jas_matrix_get(matrix, i, j);
sprintf(sbuf, "%s%4ld", (strlen(buf) > 0) ? " " : "",
JAS_CAST(long, x));
n = JAS_CAST(int, strlen(buf));
if (n + JAS_CAST(int, strlen(sbuf)) > MAXLINELEN) {
fputs(buf, out);
fputs("\n", out);
buf[0] = '\0';
}
strcat(buf, sbuf);
if (j == jas_matrix_numcols(matrix) - 1) {
fputs(buf, out);
fputs("\n", out);
buf[0] = '\0';
}
}
}
fputs(buf, out);

return 0;
}
#endif /* ENABLE_JASPER_DUMP */
19 changes: 8 additions & 11 deletions src/Terrain/jasper/base/jas_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,11 @@
* Includes.
\******************************************************************************/

/* The configuration header file should be included first. */
#include "jasper/jas_config.h"
#include "jasper/jas_stream.h"
#include "jasper/jas_debug.h"
#include "jasper/jas_types.h"
#include "jasper/jas_malloc.h"
#include "jasper/jas_math.h"

#include <assert.h>
#if defined(JAS_HAVE_FCNTL_H)
Expand All @@ -89,12 +92,6 @@
#include <io.h>
#endif

#include "jasper/jas_debug.h"
#include "jasper/jas_types.h"
#include "jasper/jas_stream.h"
#include "jasper/jas_malloc.h"
#include "jasper/jas_math.h"

/******************************************************************************\
* Local function prototypes.
\******************************************************************************/
Expand Down Expand Up @@ -126,22 +123,22 @@ static int file_close(jas_stream_obj_t *obj);
\******************************************************************************/

#ifdef JASPER_DISABLED
static jas_stream_ops_t jas_stream_fileops = {
static const jas_stream_ops_t jas_stream_fileops = {
file_read,
file_write,
file_seek,
file_close
};

static jas_stream_ops_t jas_stream_sfileops = {
static const jas_stream_ops_t jas_stream_sfileops = {
sfile_read,
sfile_write,
sfile_seek,
sfile_close
};
#endif /* JASPER_DISABLED */

static jas_stream_ops_t jas_stream_memops = {
static const jas_stream_ops_t jas_stream_memops = {
mem_read,
mem_write,
mem_seek,
Expand Down
6 changes: 3 additions & 3 deletions src/Terrain/jasper/base/jas_string.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
* Includes
\******************************************************************************/

#include <string.h>

#include "jasper/jas_malloc.h"
#include "jasper/jas_string.h"
#include "jasper/jas_malloc.h"

#include <string.h>

/******************************************************************************\
* Miscellaneous Functions
Expand Down
20 changes: 10 additions & 10 deletions src/Terrain/jasper/base/jas_tvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@
* Includes.
\******************************************************************************/

#include "jasper/jas_tvp.h"
#include "jasper/jas_malloc.h"
#include "jasper/jas_string.h"

#include <assert.h>
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

#include "jasper/jas_malloc.h"
#include "jasper/jas_string.h"
#include "jasper/jas_tvp.h"

/******************************************************************************\
* Macros.
\******************************************************************************/
Expand Down Expand Up @@ -195,13 +195,13 @@ int jas_tvparser_next(jas_tvparser_t *tvp)
\******************************************************************************/

/* Get the current tag. */
char *jas_tvparser_gettag(jas_tvparser_t *tvp)
const char *jas_tvparser_gettag(const jas_tvparser_t *tvp)
{
return tvp->tag;
}

/* Get the current value. */
const char *jas_tvparser_getval(jas_tvparser_t *tvp)
const char *jas_tvparser_getval(const jas_tvparser_t *tvp)
{
return tvp->val;
}
Expand All @@ -211,9 +211,9 @@ const char *jas_tvparser_getval(jas_tvparser_t *tvp)
\******************************************************************************/

/* Lookup a tag by name. */
jas_taginfo_t *jas_taginfos_lookup(jas_taginfo_t *taginfos, const char *name)
const jas_taginfo_t *jas_taginfos_lookup(const jas_taginfo_t *taginfos, const char *name)
{
jas_taginfo_t *taginfo;
const jas_taginfo_t *taginfo;
taginfo = taginfos;
while (taginfo->id >= 0) {
if (!strcmp(taginfo->name, name)) {
Expand All @@ -227,9 +227,9 @@ jas_taginfo_t *jas_taginfos_lookup(jas_taginfo_t *taginfos, const char *name)
/* This function is simply for convenience. */
/* One can avoid testing for the special case of a null pointer, by
using this function. This function never returns a null pointer. */
jas_taginfo_t *jas_taginfo_nonull(jas_taginfo_t *taginfo)
const jas_taginfo_t *jas_taginfo_nonull(const jas_taginfo_t *taginfo)
{
static jas_taginfo_t invalidtaginfo = {
static const jas_taginfo_t invalidtaginfo = {
-1, 0
};

Expand Down
Loading

0 comments on commit 0f59ea1

Please sign in to comment.