Format source code
This commit is contained in:
parent
b6df536fe9
commit
d0be6165c0
165 changed files with 30306 additions and 33687 deletions
106
mk2claus.c
106
mk2claus.c
|
|
@ -1,6 +1,6 @@
|
|||
/*
|
||||
* Copyright (c) 1991-1994 Sony Corporation
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
|
|
@ -8,10 +8,10 @@
|
|||
* distribute, sublicense, and/or sell copies of the Software, and to
|
||||
* permit persons to whom the Software is furnished to do so, subject to
|
||||
* the following conditions:
|
||||
*
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be
|
||||
* included in all copies or substantial portions of the Software.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*
|
||||
*
|
||||
* Except as contained in this notice, the name of Sony Corporation
|
||||
* shall not be used in advertising or otherwise to promote the sale, use
|
||||
* or other dealings in this Software without prior written authorization
|
||||
|
|
@ -28,68 +28,65 @@
|
|||
*/
|
||||
|
||||
/*
|
||||
* $SonyRCSfile: mk2claus.c,v $
|
||||
* $SonyRevision: 1.1 $
|
||||
* $SonyRCSfile: mk2claus.c,v $
|
||||
* $SonyRevision: 1.1 $
|
||||
* $SonyDate: 1994/06/03 08:02:00 $
|
||||
*/
|
||||
|
||||
|
||||
|
||||
#include "sj_kcnv.h"
|
||||
#include "sj_right.h"
|
||||
|
||||
int terminate(), priority();
|
||||
void mkjiritu(), mkbunsetu(), wakachi(), pritiny();
|
||||
void free_clall(), free_jall();
|
||||
int terminate(), priority();
|
||||
void mkjiritu(), mkbunsetu(), wakachi(), pritiny();
|
||||
void free_clall(), free_jall();
|
||||
|
||||
static int set2nd(clrec)
|
||||
CLREC *clrec;
|
||||
static int set2nd(clrec)
|
||||
CLREC* clrec;
|
||||
{
|
||||
|
||||
CLREC *rec2;
|
||||
CLREC* rec2;
|
||||
|
||||
mkjiritu(DO_IKKATU | DO_CLSTUDY);
|
||||
|
||||
mkbunsetu();
|
||||
|
||||
if (!maxclptr) {
|
||||
if(!maxclptr) {
|
||||
wakachi();
|
||||
return clrec -> cllen;
|
||||
return clrec->cllen;
|
||||
}
|
||||
|
||||
for (rec2 = maxclptr ; rec2 ; rec2 = rec2 -> clsort) {
|
||||
if (terminate(rec2->right, cnvstart+rec2->cllen) != SHU)
|
||||
for(rec2 = maxclptr; rec2; rec2 = rec2->clsort) {
|
||||
if(terminate(rec2->right, cnvstart + rec2->cllen) != SHU)
|
||||
break;
|
||||
}
|
||||
|
||||
return rec2 ? (clrec -> cllen + rec2 -> cllen) : (clrec -> cllen);
|
||||
return rec2 ? (clrec->cllen + rec2->cllen) : (clrec->cllen);
|
||||
}
|
||||
|
||||
void mk2claus()
|
||||
{
|
||||
unsigned char *keepptr;
|
||||
int keeplen;
|
||||
CLREC *clrec;
|
||||
int len;
|
||||
int save2ln;
|
||||
int prty;
|
||||
int maxprty;
|
||||
int count;
|
||||
int prty2;
|
||||
void mk2claus() {
|
||||
unsigned char* keepptr;
|
||||
int keeplen;
|
||||
CLREC* clrec;
|
||||
int len;
|
||||
int save2ln;
|
||||
int prty;
|
||||
int maxprty;
|
||||
int count;
|
||||
int prty2;
|
||||
|
||||
prty = maxprty = prty2 = 0;
|
||||
|
||||
clt2nd = maxclptr = NULL;
|
||||
jrt2nd = maxjptr = NULL;
|
||||
jrt2nd = maxjptr = NULL;
|
||||
|
||||
selcl = clt1st;
|
||||
|
||||
if (selcl -> right == R_FZKKGU) {
|
||||
if(selcl->right == R_FZKKGU) {
|
||||
pritiny();
|
||||
return;
|
||||
}
|
||||
|
||||
if (cnvlen == selcl -> cllen) {
|
||||
if(cnvlen == selcl->cllen) {
|
||||
pritiny();
|
||||
return;
|
||||
}
|
||||
|
|
@ -98,13 +95,13 @@ void mk2claus()
|
|||
keeplen = cnvlen;
|
||||
|
||||
len = count = 0;
|
||||
for (clrec = selcl ; clrec && count < 5 ; clrec = clrec -> clsort) {
|
||||
for(clrec = selcl; clrec && count < 5; clrec = clrec->clsort) {
|
||||
|
||||
cnvstart = keepptr + clrec -> cllen;
|
||||
cnvlen = keeplen - clrec -> cllen;
|
||||
cnvstart = keepptr + clrec->cllen;
|
||||
cnvlen = keeplen - clrec->cllen;
|
||||
|
||||
if (len != clrec -> cllen) {
|
||||
if (clt2nd != maxclptr) {
|
||||
if(len != clrec->cllen) {
|
||||
if(clt2nd != maxclptr) {
|
||||
free_clall(maxclptr);
|
||||
free_jall(maxjptr);
|
||||
}
|
||||
|
|
@ -112,37 +109,37 @@ void mk2claus()
|
|||
save2ln = set2nd(clrec);
|
||||
|
||||
count++;
|
||||
len = clrec -> cllen;
|
||||
len = clrec->cllen;
|
||||
prty2 = 0;
|
||||
}
|
||||
|
||||
if (Termtbl[clrec -> right] & T_SHUUJO)
|
||||
clrec -> cl2len = (unsigned char)len;
|
||||
if(Termtbl[clrec->right] & T_SHUUJO)
|
||||
clrec->cl2len = (unsigned char)len;
|
||||
else
|
||||
clrec -> cl2len = (unsigned char)save2ln;
|
||||
clrec->cl2len = (unsigned char)save2ln;
|
||||
|
||||
if (selcl -> cl2len > clrec -> cl2len) continue;
|
||||
if(selcl->cl2len > clrec->cl2len) continue;
|
||||
|
||||
prty = priority(clrec) - prty2;
|
||||
|
||||
prty2++;
|
||||
|
||||
if (selcl -> cl2len == clrec -> cl2len) {
|
||||
if (clrec -> cllen == nextcllen) {
|
||||
if (selcl -> cllen != nextcllen)
|
||||
if(selcl->cl2len == clrec->cl2len) {
|
||||
if(clrec->cllen == nextcllen) {
|
||||
if(selcl->cllen != nextcllen)
|
||||
;
|
||||
else if (prty <= maxprty)
|
||||
else if(prty <= maxprty)
|
||||
continue;
|
||||
}
|
||||
|
||||
else if (prty <= maxprty)
|
||||
else if(prty <= maxprty)
|
||||
continue;
|
||||
}
|
||||
|
||||
selcl = clrec;
|
||||
selcl = clrec;
|
||||
maxprty = prty;
|
||||
|
||||
if (clt2nd == maxclptr) continue;
|
||||
if(clt2nd == maxclptr) continue;
|
||||
|
||||
free_clall(clt2nd);
|
||||
free_jall(jrt2nd);
|
||||
|
|
@ -150,14 +147,13 @@ void mk2claus()
|
|||
clt2nd = maxclptr;
|
||||
}
|
||||
|
||||
if (clt2nd != maxclptr) {
|
||||
if(clt2nd != maxclptr) {
|
||||
free_clall(maxclptr);
|
||||
maxclptr = NULL;
|
||||
maxclptr = NULL;
|
||||
free_jall(maxjptr);
|
||||
maxjptr = NULL;
|
||||
maxjptr = NULL;
|
||||
}
|
||||
|
||||
cnvstart = keepptr;
|
||||
cnvlen = keeplen;
|
||||
cnvlen = keeplen;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue