Skip to content

Commit

Permalink
Converted K&R func style to ANSI and placed prototypes into header file.
Browse files Browse the repository at this point in the history
  • Loading branch information
kentavv committed Feb 3, 2014
1 parent 5cb5a9a commit c8ebf6f
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
17 changes: 12 additions & 5 deletions Field.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@
/*** scalar. ***/
/********************************************************************/
#include <stdio.h>

#include "Field.h"
#include "Build_defs.h"

static int Is_prime(int Num);

#define BOUND 256 /* field has to be less than BOUND */

static int Prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,
61,67,71, 73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,
151,157,163,167, 173,179,181,191,193,197,199,211,223,227,229,233,
239,241,251,0};

/********************************************************************/
/* MODIFIES: */
/* Pntr -- pointer to the global variable field. (in main()) */
Expand All @@ -29,9 +39,7 @@
/* NOTE: */
/* This routine is called when a command "f number" is issued. */
/********************************************************************/
int Change_field(Number,Pntr)
int Number;
Scalar *Pntr;
int Change_field(int Number, Scalar *Pntr)
{
int Is_prime();

Expand All @@ -56,8 +64,7 @@ Scalar *Pntr;
/* 1 if Num is a prime number less than BOUND. */
/* 0 otherwise. */
/********************************************************************/
int Is_prime(Num)
int Num;
int Is_prime(int Num)
{
int i = 0;
int found = 0;
Expand Down
7 changes: 2 additions & 5 deletions Field.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
/*** AUTHOR: Sekhar Muddana ***/
/*******************************************************************/

#define BOUND 256 /* field has to be less than BOUND */
#include "Build_defs.h"

static int Prime[] = {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,
61,67,71, 73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,
151,157,163,167, 173,179,181,191,193,197,199,211,223,227,229,233,
239,241,251,0};
int Change_field(int Number, Scalar *Pntr);

#endif
2 changes: 1 addition & 1 deletion driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <signal.h>

#include "Build_defs.h"
#include "Field.h"
#include "Po_parse_exptext.h"
#include "Id_routines.h"
#include "Get_Command.h"
Expand Down Expand Up @@ -80,7 +81,6 @@ char *argv[];

int Parse_generator_word(); /* Generators.c */
int Assoc_number(); /* Ty_routines.c */
int Change_field(); /* Field.c */

int ReadDotAlbert(); /* Get_command.c */
int Substr(); /* Get_Command.c */
Expand Down

0 comments on commit c8ebf6f

Please sign in to comment.