static void LoadConstants (LoadState *S, Proto *f) { int i; int n = LoadInt(S); f->k = luaM_newvector(S->L, n, TValue); f->sizek = n; for (i = 0; i < n; i++) setnilvalue(&f->k[i]); for (i = 0; i < n; i++) { TValue *o = &f->k[i]; int t = LoadByte(S); switch (t) { case LUA_TNIL: setnilvalue(o); break; case LUA_TBOOLEAN: setbvalue(o, LoadByte(S)); break; case LUA_TNUMFLT: setfltvalue(o, LoadNumber(S)); break; case LUA_TNUMINT: setivalue(o, LoadInteger(S)); break; case LUA_TSHRSTR: case LUA_TLNGSTR: setsvalue2n(S->L, o, LoadString(S)); break; default: lua_assert(0); } } }
static int InitFaceParam(void) { int score=0; gFaceGroupCnt=LoadInteger("FaceGroupCnt",50); gFaceDefGroupCnt=LoadInteger("FaceDefGroupCnt",100); gFaceGroupNum=LoadInteger("FaceGroupNum",24); AdminFaceScore=LoadInteger("AdminFaceScore",85); score = (gOptions.FaceVThreshold + (gOptions.FaceMThreshold - gOptions.FaceVThreshold)/2); if(score < 65) score=65; FaceLearnThreshold=LoadInteger("FaceLearnThreshold", score); CurFaceGroup=gOptions.DefFaceGroup; return 1; }
static void checkHeader (LoadState *S) { checkliteral(S, LUA_SIGNATURE + 1, "not a"); /* 1st char already checked */ if (LoadByte(S) != LUAC_VERSION) error(S, "version mismatch in"); if (LoadByte(S) != LUAC_FORMAT) error(S, "format mismatch in"); checkliteral(S, LUAC_DATA, "corrupted"); checksize(S, int); checksize(S, size_t); checksize(S, Instruction); checksize(S, lua_Integer); checksize(S, lua_Number); if (LoadInteger(S) != LUAC_INT) error(S, "endianness mismatch in"); if (LoadNumber(S) != LUAC_NUM) error(S, "float format mismatch in"); }
static void LoadConstants(LoadState* S, Proto* f) { int i,n; n=LoadInt(S); f->k=luaM_newvector(S->L,n,TValue); f->sizek=n; for (i=0; i<n; i++) setnilvalue(&f->k[i]); for (i=0; i<n; i++) { TValue* o=&f->k[i]; int t=LoadChar(S); switch (t) { case LUA_TNIL: setnilvalue(o); break; case LUA_TBOOLEAN: setbvalue(o,LoadChar(S)!=0); break; case LUA_TNUMBER: setnvalue(o,LoadNumber(S)); break; #ifdef LUA_TINT case LUA_TINT: /* Integer type saved in bytecode (see lcode.c) */ setivalue(o,LoadInteger(S)); break; #endif case LUA_TSTRING: setsvalue2n(S->L,o,LoadString(S)); break; default: error(S,"bad constant"); break; } } n=LoadInt(S); f->p=luaM_newvector(S->L,n,Proto*); f->sizep=n; for (i=0; i<n; i++) f->p[i]=NULL; for (i=0; i<n; i++) f->p[i]=LoadFunction(S,f->source); }
static void InitModemWin(HWND hWnd) { int rows = 0; int item = 0; HWND tmpstatic[9]; char ipaddr[4][4]; char staticbuf[20]; module_type = LoadInteger("ModemModule", MODEM_MODULE_Q24PL); memset(ModemAPN, 0x00, sizeof(ModemAPN)); memset(ModemDialNumber, 0x00, sizeof(ModemDialNumber)); memset(ModemUserName, 0x00, sizeof(ModemUserName)); memset(ModemPassWord, 0x00, sizeof(ModemPassWord)); memset(HeartBeatServer, 0x00, sizeof(HeartBeatServer)); if (module_type != MODEM_MODULE_EM660) { LoadStr("APN", ModemAPN); } LoadStr("ModemDialNumber", ModemDialNumber); LoadStr("ModemUserName", ModemUserName); LoadStr("ModemPassword", ModemPassWord); LoadStr("HeartBeatServer", HeartBeatServer); //tmpstatic[0] = CreateWindow(CTRL_STATIC, LoadStrByID(1192), WS_VISIBLE | SS_LEFT, 0xbf, 10, rows * 30 + 12, 100, 23, hWnd, 0); tmpstatic[0] = CreateWindow(CTRL_STATIC, LoadStrByID(MID_GPRS_CONNECT), WS_VISIBLE | SS_LEFT, 0xbf, 10, rows * 30 + 12, 100, 23, hWnd, 0); ModemWnd[0] = CreateWindow(CTRL_COMBOBOX, "", WS_VISIBLE | CBS_READONLY | CBS_SPINLIST | CBS_SPINARROW_LEFTRIGHT | CBS_AUTOFOCUS, 0xd0, 115, rows * 30 + 6, 55, 23, hWnd, 0); SendMessage(ModemWnd[0], CB_ADDSTRING, 0, (LPARAM)LoadStrByID(HID_NO)); SendMessage(ModemWnd[0], CB_ADDSTRING, 0, (LPARAM)LoadStrByID(HID_YES)); SendMessage(ModemWnd[0], CB_SETCURSEL, gOptions.ModemEnable, 0); rows++; if (module_type != MODEM_MODULE_EM660){ tmpstatic[1] = CreateWindow(CTRL_STATIC, LoadStrByID(MID_GPRS_APN), WS_VISIBLE | SS_LEFT, 0xc0, 10, rows * 30 + 12, 100, 23, hWnd, 0); ModemWnd[1] = CreateWindow(CTRL_SLEDIT, ModemAPN, WS_VISIBLE | ES_AUTOSELECT | ES_BASELINE | WS_BORDER, 0xd0, 115, rows * 30 + 8, 120, 24, hWnd, 0); SendMessage(ModemWnd[1], MAX_NUM_LEN, 0, 0); rows++; } tmpstatic[2] = CreateWindow(CTRL_STATIC, LoadStrByID(MID_GPRS_NMB), WS_VISIBLE | SS_LEFT, 0xc1, 10, rows * 30 + 12, 100, 23, hWnd, 0); ModemWnd[2] = CreateWindow(CTRL_SLEDIT, ModemDialNumber, WS_VISIBLE | ES_AUTOSELECT | ES_BASELINE | WS_BORDER, 0xd1, 115, rows*30 + 8, 120, 24, hWnd, 0); SendMessage(ModemWnd[2], MAX_NUM_LEN, 0, 0); rows++; tmpstatic[3] = CreateWindow(CTRL_STATIC, LoadStrByID(MID_GPRS_USER), WS_VISIBLE | SS_LEFT, 0xc2, 10, rows * 30 + 12, 100, 23, hWnd, 0); ModemWnd[3] = CreateWindow(CTRL_SLEDIT, ModemUserName, WS_VISIBLE | ES_AUTOSELECT | ES_BASELINE | WS_BORDER, 0xd2, 115, rows * 30 + 8, 120, 24, hWnd, 0); SendMessage(ModemWnd[3], MAX_NUM_LEN, 0, 0); rows++; tmpstatic[4] = CreateWindow(CTRL_STATIC, LoadStrByID(MID_GPRS_PWD), WS_VISIBLE | SS_LEFT, 0xc3, 10, rows * 30 + 12, 100, 23, hWnd, 0); ModemWnd[4] = CreateWindow(CTRL_SLEDIT, ModemPassWord, WS_VISIBLE | ES_AUTOSELECT | ES_BASELINE | WS_BORDER, 0xd3, 115, rows * 30 + 8, 120, 24, hWnd, 0); SendMessage(ModemWnd[4], MAX_NUM_LEN, 0, 0); rows++; tmpstatic[5] = CreateWindow(CTRL_STATIC, LoadStrByID(MID_MODEM_HTSERVER), WS_VISIBLE | SS_LEFT, 0xc4, 10, rows * 30 + 12, 100, 23, hWnd, 0); ModemWnd[5] = CreateWindow(CTRL_SLEDIT, "", WS_VISIBLE | ES_AUTOSELECT| ES_BASELINE | WS_BORDER, 0xd4, 115, rows * 30 + 8, 35, 24, hWnd, 0); SendMessage(ModemWnd[rows + item], 3, 0, 0); tmpstatic[6] = CreateWindow(CTRL_STATIC, ".", WS_VISIBLE | SS_LEFT, 0xc5, 150, rows * 30 + 12, 10, 23, hWnd, 0); ModemWnd[6] = CreateWindow(CTRL_SLEDIT, "", WS_VISIBLE | ES_AUTOSELECT | ES_BASELINE | WS_BORDER, 0xd5, 160, rows * 30 + 8, 35, 24, hWnd, 0); SendMessage(ModemWnd[rows + item], 3, 0, 0); tmpstatic[7] = CreateWindow(CTRL_STATIC, ".", WS_VISIBLE | SS_LEFT, 0xc6, 195, rows * 30 + 12, 10, 23, hWnd, 0); ModemWnd[7] = CreateWindow(CTRL_SLEDIT, "", WS_VISIBLE | ES_AUTOSELECT | ES_BASELINE | WS_BORDER, 0xd6, 205, rows * 30 + 8, 35, 24, hWnd, 0); SendMessage(ModemWnd[rows + item], 3, 0, 0); tmpstatic[8] = CreateWindow(CTRL_STATIC, ".", WS_VISIBLE | SS_LEFT, 0xc7, 245, rows * 30 + 12, 10, 23, hWnd, 0); ModemWnd[8] = CreateWindow(CTRL_SLEDIT, "", WS_VISIBLE | ES_AUTOSELECT | ES_BASELINE | WS_BORDER, 0xd7, 250, rows * 30 + 8, 35, 24, hWnd, 0); SendMessage(ModemWnd[rows + item], 3, 0, 0); rows++; if(ParseIP(HeartBeatServer, ipaddr[0], ipaddr[1], ipaddr[2], ipaddr[3])){ SetWindowText(ModemWnd[5], ipaddr[0]); SetWindowText(ModemWnd[6], ipaddr[1]); SetWindowText(ModemWnd[7], ipaddr[2]); SetWindowText(ModemWnd[8], ipaddr[3]); } SendMessage(ModemWnd[5],EM_LIMITTEXT,3,0); SendMessage(ModemWnd[6],EM_LIMITTEXT,3,0); SendMessage(ModemWnd[7],EM_LIMITTEXT,3,0); SendMessage(ModemWnd[8],EM_LIMITTEXT,3,0); sprintf(staticbuf, "%s", LoadStrByID(1504)); ModemWnd[9] = CreateWindow(CTRL_BUTTON, LoadStrByID(HIT_OK), WS_VISIBLE | BS_DEFPUSHBUTTON, IDOK, 5, 185, 85, 23, hWnd, 0); ModemWnd[10] = CreateWindow(CTRL_BUTTON, LoadStrByID(HIT_CANCEL), WS_VISIBLE | BS_DEFPUSHBUTTON, IDCANCEL, 103+gOptions.ControlOffset, 185, 85, 23, hWnd, 0); ModemWnd[11] = CreateWindow(CTRL_BUTTON, staticbuf, WS_VISIBLE | BS_DEFPUSHBUTTON, IDCANCEL, 202+gOptions.ControlOffset, 185, 115, 23, hWnd, 0); }