Changeset 26acab5 in git


Ignore:
Timestamp:
Feb 17, 2012, 5:21:53 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
e3198f2a9226b630c86adfee27dac28803f035df
Parents:
48a41a57bdd254025dd7b8a326d86ce47b43af1683976e9bc401b17d22105563dd2a0ef27349c967
Message:
Merge pull request #68 from mmklee/factory_tmpl_sw

Factory tmpl sw
Location:
factory
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • factory/gfops.cc

    r48a41a r26acab5  
    6464}
    6565
     66static char *gftable_dir;
     67extern "C" {
     68  void set_gftable_dir(char *d){
     69    gftable_dir = d;
     70  }
     71}
     72
    6673static void gf_get_table ( int p, int n )
    6774{
     
    94101
    95102    // try to open file
     103    char *gffilename;
     104    FILE * inputfile;
     105    if (gftable_dir)
     106    {
     107      sprintf( buffer, "/gftable.%d.%d", p, n );
     108      gffilename = (char *)malloc(strlen(gftable_dir) + strlen(buffer) + 1);
     109      STICKYASSERT(gffilename,"out of memory");
     110      strcpy(gffilename,gftable_dir);
     111      strcat(gffilename,buffer);
     112      inputfile = fopen( gffilename, "r" );
     113    }
     114    else
     115    {
    96116#ifndef SINGULAR
    97     sprintf( buffer, GFTABLEDIR "/%d", q);
    98     FILE * inputfile = fopen( buffer, "r" );
     117      sprintf( buffer, GFTABLEDIR "/gftable.%d.%d", p, n );
     118      gffilename = buffer;
     119      inputfile = fopen( buffer, "r" );
    99120#else
    100     int check= sprintf( buffer, "gftables/%d", q );
    101     FILE * inputfile = feFopen( buffer, "r" );
     121      sprintf( buffer, "gftables/%d", q );
     122      gffilename = buffer;
     123      inputfile = feFopen( buffer, "r" );
    102124#endif
    103     STICKYASSERT( inputfile, "can not open GF(q) table" );
     125    }
     126    if (!inputfile)
     127    {
     128      fprintf(stderr,"can not open GF(q) addition table: %s\n",gffilename);
     129      STICKYASSERT(inputfile, "can not open GF(q) table");
     130    }
    104131
    105132    // read ID
  • factory/libfac/test.cc

    r48a41a r26acab5  
    33// Factor - Includes
    44#include "libfac.h"
     5#include <string.h>
     6
    57#ifdef HAVE_IOSTREAM
    68#include <iostream>
Note: See TracChangeset for help on using the changeset viewer.