Changeset 2bb17c9 in git


Ignore:
Timestamp:
16/09/11 13:54:04 (8 years ago)
Author:
Olly Betts <olly@…>
Branches:
add-show-splays, line_contents, master, stereo, svn/github/master, svn/origin/master, svn/tags/1.2.0, svn/tags/1.2.1, svn/tags/1.2.2, svn/tags/1.2.3, svn/tags/1.2.4, svn/tags/1.2.5, svn/trunk, travis-osx
Children:
4833448
Parents:
a6e8d45
Message:

src/img.c,src/img.h: Make the highest and lowest valid values for
img_output_version available in img.h as IMG_VERSION_MIN and
IMG_VERSION_MAX.

git-svn-id: file:///home/survex-svn/survex/trunk@3642 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    ra6e8d45 r2bb17c9  
     1Fri Sep 16 12:52:55 GMT 2011  Olly Betts <olly@survex.com>
     2
     3        * src/img.c,src/img.h: Make the highest and lowest valid values for
     4          img_output_version available in img.h as IMG_VERSION_MIN and
     5          IMG_VERSION_MAX.
     6
    17Fri Sep 16 05:49:12 GMT 2011  Olly Betts <olly@survex.com>
    28
  • src/img.c

    ra6e8d45 r2bb17c9  
    3030
    3131#include "img.h"
    32 
    33 #define LATEST_IMG_VERSION 7
    3432
    3533#ifndef IMG_API_VERSION
     
    169167#endif
    170168
    171 unsigned int img_output_version = LATEST_IMG_VERSION;
     169unsigned int img_output_version = IMG_VERSION_MAX;
    172170
    173171#ifdef IMG_HOSTED
     
    575573      /* nothing special to do */
    576574   } else if (pimg->version == 0) {
    577       if (ch < '2' || ch > '0' + LATEST_IMG_VERSION || GETC(pimg->fh) != '\n') {
     575      if (ch < '2' || ch > '0' + IMG_VERSION_MAX || GETC(pimg->fh) != '\n') {
    578576         img_errno = IMG_TOONEW;
    579577         goto error;
     
    684682      fputs("Bv0.01\n", pimg->fh); /* binary file format version number */
    685683   } else {
    686       pimg->version = (img_output_version > LATEST_IMG_VERSION) ? LATEST_IMG_VERSION : img_output_version;
     684      pimg->version = (img_output_version > IMG_VERSION_MAX) ? IMG_VERSION_MAX : img_output_version;
    687685      fprintf(pimg->fh, "v%d\n", pimg->version); /* file format version no. */
    688686   }
  • src/img.h

    ra6e8d45 r2bb17c9  
    11/* img.h
    22 * Header file for routines to read and write Survex ".3d" image files
    3  * Copyright (C) Olly Betts 1993,1994,1997,2001,2002,2003,2004,2005,2006,2010
     3 * Copyright (C) Olly Betts 1993,1994,1997,2001,2002,2003,2004,2005,2006,2010,2011
    44 *
    55 * This program is free software; you can redistribute it and/or modify
     
    135135extern unsigned int img_output_version;
    136136
     137/* Minimum supported value for img_output_version: */
     138#define IMG_VERSION_MIN 1
     139
     140/* Maximum supported value for img_output_version: */
     141#define IMG_VERSION_MAX 7
     142
    137143/* Open a .3d file for reading
    138144 * fnm is the filename
Note: See TracChangeset for help on using the changeset viewer.