• Home
  • Raw
  • Download

Lines Matching refs:fprintf

65     fprintf(fp, "// Generated Code - DO NOT EDIT !!\n");  in printHeader()
66 fprintf(fp, "// generated by 'emugen'\n"); in printHeader()
80 fprintf(fp, "#ifndef __%s_%s_proc_t_h\n", basename, sideString(side)); in genProcTypes()
81 fprintf(fp, "#define __%s_%s_proc_t_h\n", basename, sideString(side)); in genProcTypes()
82 fprintf(fp, "\n\n"); in genProcTypes()
83 fprintf(fp, "\n#include \"%s_types.h\"\n",basename); in genProcTypes()
84 fprintf(fp, "#ifndef %s_APIENTRY\n",basename); in genProcTypes()
85 fprintf(fp, "#define %s_APIENTRY \n",basename); in genProcTypes()
86 fprintf(fp, "#endif\n"); in genProcTypes()
92 fprintf(fp, "typedef "); in genProcTypes()
94fprintf(fp, " (%s_APIENTRY *%s_%s_proc_t) (", basename, e->name().c_str(), sideString(side)); in genProcTypes()
95 if (side == CLIENT_SIDE) { fprintf(fp, "void * ctx"); } in genProcTypes()
96 if (e->customDecoder() && side == SERVER_SIDE) { fprintf(fp, "void *ctx"); } in genProcTypes()
103 …f (j != 0 || side == CLIENT_SIDE || (side == SERVER_SIDE && e->customDecoder())) fprintf(fp, ", "); in genProcTypes()
107 fprintf(fp, ");\n"); in genProcTypes()
110 fprintf(fp, "typedef "); in genProcTypes()
112fprintf(fp, " (%s_APIENTRY *%s_dec_%s_proc_t) (", basename, e->name().c_str(), sideString(side)); in genProcTypes()
119 if (j != 0) fprintf(fp, ", "); in genProcTypes()
123 fprintf(fp, ");\n"); in genProcTypes()
126 fprintf(fp, "\n\n#endif\n"); in genProcTypes()
139 fprintf(fp, "#ifndef __%s_%s_ftable_t_h\n", m_basename.c_str(), sideString(side)); in genFuncTable()
140 fprintf(fp, "#define __%s_%s_ftable_t_h\n", m_basename.c_str(), sideString(side)); in genFuncTable()
141 fprintf(fp, "\n\n"); in genFuncTable()
142 fprintf(fp, "static const struct _%s_funcs_by_name {\n", m_basename.c_str()); in genFuncTable()
143 fprintf(fp, in genFuncTable()
152 fprintf(fp, "\t{\"%s\", (void*)%s},\n", e->name().c_str(), e->name().c_str()); in genFuncTable()
154 fprintf(fp, "};\n"); in genFuncTable()
155fprintf(fp, "static const int %s_num_funcs = sizeof(%s_funcs_by_name) / sizeof(struct _%s_funcs_by… in genFuncTable()
157 fprintf(fp, "\n\n#endif\n"); in genFuncTable()
170 fprintf(fp, "#ifndef __%s_%s_context_t_h\n", m_basename.c_str(), sideString(side)); in genContext()
171 fprintf(fp, "#define __%s_%s_context_t_h\n", m_basename.c_str(), sideString(side)); in genContext()
173 fprintf(fp, "\n#include \"%s_%s_proc.h\"\n", in genContext()
176 fprintf(fp, "\n#include \"%s_types.h\"\n", m_basename.c_str()); in genContext()
180 fprintf(fp, "#include %s\n", contextHeaders[i].c_str()); in genContext()
182 fprintf(fp, "\n"); in genContext()
184 fprintf(fp, "\nstruct %s_%s_context_t {\n\n", in genContext()
191fprintf(fp, "\t%s_dec_%s_proc_t %s;\n", e->name().c_str(), sideString(side), e->name().c_str()); in genContext()
192fprintf(fp, "\t%s_%s_proc_t %s_dec;\n", e->name().c_str(), sideString(side), e->name().c_str()); in genContext()
194fprintf(fp, "\t%s_%s_proc_t %s;\n", e->name().c_str(), sideString(side), e->name().c_str()); in genContext()
199 fprintf(fp, "\tvirtual ~%s_%s_context_t() {}\n", m_basename.c_str(), sideString(side)); in genContext()
202 fprintf(fp, "\n\ttypedef %s_%s_context_t *CONTEXT_ACCESSOR_TYPE(void);\n", in genContext()
204 fprintf(fp, "\tstatic void setContextAccessor(CONTEXT_ACCESSOR_TYPE *f);\n"); in genContext()
208fprintf(fp, "\tint initDispatchByName( void *(*getProc)(const char *name, void *userData), void *u… in genContext()
212 fprintf(fp, "\tvirtual void setError(unsigned int error){ (void)error; };\n"); in genContext()
213 fprintf(fp, "\tvirtual unsigned int getError(){ return 0; };\n"); in genContext()
216 fprintf(fp, "};\n"); in genContext()
218 fprintf(fp, "\n#endif\n"); in genContext()
227 fprintf(stderr, "Entry points are only defined for Client and Wrapper components\n"); in genEntryPoints()
239 fprintf(fp, "#include <stdio.h>\n"); in genEntryPoints()
240 fprintf(fp, "#include <stdlib.h>\n"); in genEntryPoints()
241 fprintf(fp, "#include \"%s_%s_context.h\"\n", m_basename.c_str(), sideString(side)); in genEntryPoints()
242 fprintf(fp, "\n"); in genEntryPoints()
244 fprintf(fp, "extern \"C\" {\n"); in genEntryPoints()
247 fprintf(fp, "\t"); at(i).print(fp, false); fprintf(fp, ";\n"); in genEntryPoints()
249 fprintf(fp, "};\n\n"); in genEntryPoints()
251 fprintf(fp, "#ifndef GET_CONTEXT\n"); in genEntryPoints()
252 fprintf(fp, "static %s_%s_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;\n", in genEntryPoints()
255 fprintf(fp, in genEntryPoints()
258 fprintf(fp, "#define GET_CONTEXT %s_%s_context_t * ctx = getCurrentContext()\n", in genEntryPoints()
260 fprintf(fp, "#endif\n\n"); in genEntryPoints()
266 fprintf(fp, "{\n"); in genEntryPoints()
267 fprintf(fp, "\tGET_CONTEXT;\n"); in genEntryPoints()
275 fprintf(fp, "\t%s\n", e->vars()[j].paramCheckExpression().c_str()); in genEntryPoints()
278 fprintf(fp, "\t%sctx->%s(%s", in genEntryPoints()
286 fprintf(fp, "%s %s", in genEntryPoints()
291 fprintf(fp, ");\n"); in genEntryPoints()
292 fprintf(fp, "}\n\n"); in genEntryPoints()
308 fprintf(fp, "#ifndef __GUARD_%s_opcodes_h_\n", m_basename.c_str()); in genOpcodes()
309 fprintf(fp, "#define __GUARD_%s_opcodes_h_\n\n", m_basename.c_str()); in genOpcodes()
311fprintf(fp, "#define OP_%s \t\t\t\t\t%u\n", at(i).name().c_str(), (unsigned int)i + m_baseOpcode); in genOpcodes()
313 fprintf(fp, "#define OP_last \t\t\t\t\t%u\n", (unsigned int)size() + m_baseOpcode); in genOpcodes()
314 fprintf(fp,"\n\n#endif\n"); in genOpcodes()
329 fprintf(fp, "#"); in genAttributesTemplate()
331 fprintf(fp, "%s\n\n", at(i).name().c_str()); in genAttributesTemplate()
349 fprintf(fp, "\n#ifndef GUARD_%s\n", classname.c_str()); in genEncoderHeader()
350 fprintf(fp, "#define GUARD_%s\n\n", classname.c_str()); in genEncoderHeader()
352 fprintf(fp, "#include \"IOStream.h\"\n"); in genEncoderHeader()
353 fprintf(fp, "#include \"ChecksumCalculator.h\"\n"); in genEncoderHeader()
354 fprintf(fp, "#include \"%s_%s_context.h\"\n\n\n", m_basename.c_str(), sideString(CLIENT_SIDE)); in genEncoderHeader()
357 fprintf(fp, "#include %s\n", m_encoderHeaders[i].c_str()); in genEncoderHeader()
359 fprintf(fp, "\n"); in genEncoderHeader()
361 fprintf(fp, "struct %s : public %s_%s_context_t {\n\n", in genEncoderHeader()
363 fprintf(fp, "\tIOStream *m_stream;\n"); in genEncoderHeader()
364 fprintf(fp, "\tChecksumCalculator *m_checksumCalculator;\n\n"); in genEncoderHeader()
366fprintf(fp, "\t%s(IOStream *stream, ChecksumCalculator *checksumCalculator);\n", classname.c_str()… in genEncoderHeader()
367 fprintf(fp, "\tvirtual uint64_t lockAndWriteDma(void* data, uint32_t sz) { return 0; }\n"); in genEncoderHeader()
368 fprintf(fp, "};\n\n"); in genEncoderHeader()
370 fprintf(fp, "#endif // GUARD_%s\n", classname.c_str()); in genEncoderHeader()
410 fprintf(stderr, "%s: data len is undefined for '%s'\n", in getVarEncodingSizeExpression()
426 fprintf(fp, "%u", (unsigned int) var.type()->bytes()); in writeVarEncodingSize()
430 fprintf(fp, "8"); in writeVarEncodingSize()
435 fprintf(fp, "0"); in writeVarEncodingSize()
437 fprintf(fp, "__size_%s", var.name().c_str()); in writeVarEncodingSize()
450fprintf(fp, "\t*(uint64_t *)(ptr) = ctx->lockAndWriteDma(%s, __size_%s); ptr += 8;\n", varname, va… in writeVarEncodingExpression()
452 fprintf(fp, "\t*(unsigned int *)(ptr) = __size_%s; ptr += 4;\n", varname); in writeVarEncodingExpression()
457 fprintf(fp, "\tif (%s != NULL) ", varname); in writeVarEncodingExpression()
459 fprintf(fp, "\t"); in writeVarEncodingExpression()
463 fprintf(fp, "%s;", var.packExpression().c_str()); in writeVarEncodingExpression()
465 fprintf(fp, "memcpy(ptr, %s, __size_%s);", in writeVarEncodingExpression()
469 fprintf(fp, "ptr += __size_%s;\n", varname); in writeVarEncodingExpression()
475 fprintf(fp, "\t\tmemcpy(ptr, &%s, %u); ptr += %u;\n", in writeVarEncodingExpression()
488 fprintf(fp, "\tstream->writeFully(&__size_%s,4);\n", varname); in writeVarLargeEncodingExpression()
489 fprintf(fp, "\tif (useChecksum) checksumCalculator->addBuffer(&__size_%s,4);\n", varname); in writeVarLargeEncodingExpression()
491 fprintf(fp, "\tif (%s != NULL) {\n", varname); in writeVarLargeEncodingExpression()
494 fprintf(fp, "%s", var.writeExpression().c_str()); in writeVarLargeEncodingExpression()
496 fprintf(fp, "\t\tstream->writeFully(%s, __size_%s);\n", varname, varname); in writeVarLargeEncodingExpression()
497fprintf(fp, "\t\tif (useChecksum) checksumCalculator->addBuffer(%s, __size_%s);\n", varname, varna… in writeVarLargeEncodingExpression()
499 if (var.nullAllowed()) fprintf(fp, "\t}\n"); in writeVarLargeEncodingExpression()
504 fprintf(fp, "\tif (useChecksum) {\n" in writeEncodingChecksumValidatorOnReturn()
521 fprintf(fp, "\tclock_gettime(CLOCK_REALTIME, &ts1);\n"); in addGuestTimePrinting()
522fprintf(fp, "\tlong timeDiff = ts1.tv_sec*1000000 + ts1.tv_nsec/1000 - (ts0.tv_sec*1000000 + ts0.t… in addGuestTimePrinting()
524fprintf(fp, "\tlong timeDiff2 = ts1.tv_sec*1000000 + ts1.tv_nsec/1000 - (ts2.tv_sec*1000000 + ts2.… in addGuestTimePrinting()
525fprintf(fp, "\tALOGW(\"%s: %%ld (%%ld) us\\n\", timeDiff, timeDiff2);\n", e->name().c_str()); in addGuestTimePrinting()
527 fprintf(fp, "\tALOGW(\"%s: %%ld us\\n\", timeDiff);\n", e->name().c_str()); in addGuestTimePrinting()
541 fprintf(fp, "\n\n"); in genEncoderImpl()
542 fprintf(fp, "#include <string.h>\n"); in genEncoderImpl()
543 fprintf(fp, "#include \"%s_opcodes.h\"\n\n", m_basename.c_str()); in genEncoderImpl()
544 fprintf(fp, "#include \"%s_enc.h\"\n\n\n", m_basename.c_str()); in genEncoderImpl()
545 fprintf(fp, "#include <vector>\n\n"); in genEncoderImpl()
546 fprintf(fp, "#include <stdio.h>\n\n"); in genEncoderImpl()
547 fprintf(fp, "namespace {\n\n"); in genEncoderImpl()
550 fprintf(fp, in genEncoderImpl()
566 fprintf(fp, "{\n"); in genEncoderImpl()
568 fprintf(fp, "ALOGD(\"%%s: enter\", __FUNCTION__);\n"); in genEncoderImpl()
572 fprintf(fp, "\tstruct timespec ts0, ts1;\n"); in genEncoderImpl()
573 fprintf(fp, "\tclock_gettime(CLOCK_REALTIME, &ts0);\n"); in genEncoderImpl()
577 fprintf(fp, "\n\t%s *ctx = (%s *)self;\n", in genEncoderImpl()
580 fprintf(fp, "\tIOStream *stream = ctx->m_stream;\n" in genEncoderImpl()
598 fprintf(fp, "\tconst unsigned int __size_%s = ", varname); in genEncoderImpl()
602 fprintf(fp, "%s;\n", buff); in genEncoderImpl()
617 fprintf(fp, "\t unsigned char *ptr;\n"); in genEncoderImpl()
618 fprintf(fp, "\t unsigned char *buf;\n"); in genEncoderImpl()
619 fprintf(fp, "\t const size_t sizeWithoutChecksum = 8"); in genEncoderImpl()
622 fprintf(fp, " + "); in genEncoderImpl()
626 fprintf(fp, " + %zu*4", npointers); in genEncoderImpl()
628 fprintf(fp, ";\n"); in genEncoderImpl()
631 fprintf(fp, "\t const size_t checksumSize = checksumCalculator->checksumByteSize();\n"); in genEncoderImpl()
634 fprintf(fp, "\t const size_t totalSize = sizeWithoutChecksum + checksumSize;\n"); in genEncoderImpl()
657 fprintf(fp, "\tbuf = stream->alloc(totalSize);\n"); in genEncoderImpl()
662 fprintf(fp, "\tbuf = stream->alloc("); in genEncoderImpl()
666 fprintf(fp,"8"); plus = " + "; in genEncoderImpl()
671 fprintf(fp, "%s", plus); plus = " + "; in genEncoderImpl()
675 fprintf(fp, "%s%zu*4", plus, npointers); plus = " + "; in genEncoderImpl()
678 fprintf(fp,");\n"); in genEncoderImpl()
680 fprintf(fp, "\tptr = buf;\n"); in genEncoderImpl()
684fprintf(fp, "\tint tmp = OP_%s;memcpy(ptr, &tmp, 4); ptr += 4;\n", e->name().c_str()); in genEncoderImpl()
685 fprintf(fp, "\tmemcpy(ptr, &totalSize, 4); ptr += 4;\n\n"); in genEncoderImpl()
689fprintf(fp, "\n\tif (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);\n"); in genEncoderImpl()
698 fprintf(fp, "\n\tif (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);\n"); in genEncoderImpl()
701 fprintf(fp, "\tstream->flush();\n"); in genEncoderImpl()
717 fprintf(fp, "\tunsigned char *ptr;\n"); in genEncoderImpl()
718 fprintf(fp, "\tunsigned char *buf;\n"); in genEncoderImpl()
719 fprintf(fp, "\tconst size_t sizeWithoutChecksum = 8"); in genEncoderImpl()
727 fprintf(fp, " + %s", buff); in genEncoderImpl()
729 fprintf(fp, " + %u * 4;\n", (unsigned int)npointers); in genEncoderImpl()
731 fprintf(fp, "\t const size_t checksumSize = checksumCalculator->checksumByteSize();\n"); in genEncoderImpl()
733 fprintf(fp, "\t const size_t totalSize = sizeWithoutChecksum + checksumSize;\n"); in genEncoderImpl()
736 fprintf(fp, "\tptr = buf = stream->alloc(totalSize);\n\n"); in genEncoderImpl()
739 fprintf(fp, "\tint tmp = OP_%s; memcpy(ptr, &tmp, 4); ptr += 4;\n", e->name().c_str()); in genEncoderImpl()
740 fprintf(fp, "\tmemcpy(ptr, &totalSize, 4); ptr += 4;\n\n"); in genEncoderImpl()
747 fprintf(fp, "\tif (useChecksum) checksumCalculator->addBuffer(buf, ptr - buf);\n"); in genEncoderImpl()
752 fprintf(fp, "\tbuf = stream->alloc(checksumSize);\n"); in genEncoderImpl()
753fprintf(fp, "\tif (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);\n\n"); in genEncoderImpl()
755fprintf(fp, "\tif (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += check… in genEncoderImpl()
772 fprintf(fp, "\tstream->flush();\n"); in genEncoderImpl()
773 fprintf(fp, "\tstruct timespec ts2;\n"); in genEncoderImpl()
774 fprintf(fp, "\tclock_gettime(CLOCK_REALTIME, &ts2);\n"); in genEncoderImpl()
778 fprintf(fp, "\tif (%s != NULL) {\n",varname); in genEncoderImpl()
783 fprintf(fp, "%s%s;\n", indent, evars[j].guestUnpackExpression().c_str()); in genEncoderImpl()
785 fprintf(fp, "%sstream->readback(%s, __size_%s);\n", in genEncoderImpl()
788fprintf(fp, "%sif (useChecksum) checksumCalculator->addBuffer(%s, __size_%s);\n", in genEncoderImpl()
791 fprintf(fp, "\t}\n"); in genEncoderImpl()
801 fprintf(stderr, "WARNING: %s : return value of pointer is unsupported\n", in genEncoderImpl()
804 fprintf(fp, "\tstream->flush();\n"); in genEncoderImpl()
807 fprintf(fp, "\t return NULL;\n"); in genEncoderImpl()
812 fprintf(fp, "\tstream->flush();\n"); in genEncoderImpl()
813 fprintf(fp, "\tstruct timespec ts2;\n"); in genEncoderImpl()
814 fprintf(fp, "\tclock_gettime(CLOCK_REALTIME, &ts2);\n"); in genEncoderImpl()
818 fprintf(fp, "\n\t%s retval;\n", e->retval().type()->name().c_str()); in genEncoderImpl()
819fprintf(fp, "\tstream->readback(&retval, %u);\n",(unsigned) e->retval().type()->bytes()); in genEncoderImpl()
820 fprintf(fp, "\tif (useChecksum) checksumCalculator->addBuffer(&retval, %u);\n", in genEncoderImpl()
824 fprintf(fp, "\treturn retval;\n"); in genEncoderImpl()
826 if (e->flushOnEncode()) fprintf(fp, "\tstream->flush();\n"); in genEncoderImpl()
830 fprintf(fp, "}\n\n"); in genEncoderImpl()
833 fprintf(fp, "} // namespace\n\n"); in genEncoderImpl()
836fprintf(fp, "%s::%s(IOStream *stream, ChecksumCalculator *checksumCalculator)\n{\n", classname.c_s… in genEncoderImpl()
837 fprintf(fp, "\tm_stream = stream;\n"); in genEncoderImpl()
838 fprintf(fp, "\tm_checksumCalculator = checksumCalculator;\n\n"); in genEncoderImpl()
843 fprintf(fp, in genEncoderImpl()
849 fprintf(fp, in genEncoderImpl()
855 fprintf(fp, "}\n\n"); in genEncoderImpl()
873 fprintf(fp, "\n#ifndef GUARD_%s\n", classname.c_str()); in genDecoderHeader()
874 fprintf(fp, "#define GUARD_%s\n\n", classname.c_str()); in genDecoderHeader()
876 fprintf(fp, "#include \"OpenglRender/IOStream.h\"\n"); in genDecoderHeader()
877 fprintf(fp, "#include \"ChecksumCalculator.h\"\n"); in genDecoderHeader()
878 fprintf(fp, "#include \"%s_%s_context.h\"\n\n\n", m_basename.c_str(), sideString(SERVER_SIDE)); in genDecoderHeader()
879 fprintf(fp, "#include \"emugl/common/logging.h\"\n"); in genDecoderHeader()
881 fprintf(fp, "#include \"time.h\"\n"); in genDecoderHeader()
885 fprintf(fp, "#include %s\n", m_decoderHeaders[i].c_str()); in genDecoderHeader()
887 fprintf(fp, "\n"); in genDecoderHeader()
889 fprintf(fp, "struct %s : public %s_%s_context_t {\n\n", in genDecoderHeader()
891fprintf(fp, "\tsize_t decode(void *buf, size_t bufsize, IOStream *stream, ChecksumCalculator* chec… in genDecoderHeader()
892 fprintf(fp, "\n};\n\n"); in genDecoderHeader()
893 fprintf(fp, "#endif // GUARD_%s\n", classname.c_str()); in genDecoderHeader()
910 fprintf(fp, "\n\n#include <string.h>\n"); in genContextImpl()
911 fprintf(fp, "#include \"%s_%s_context.h\"\n\n\n", m_basename.c_str(), sideString(side)); in genContextImpl()
912 fprintf(fp, "#include <stdio.h>\n\n"); in genContextImpl()
914fprintf(fp, "int %s::initDispatchByName(void *(*getProc)(const char *, void *userData), void *user… in genContextImpl()
918 fprintf(fp, "\t%s = (%s_dec_%s_proc_t) getProc(\"%s\", userData);\n", in genContextImpl()
924 fprintf(fp, "\t%s = (%s_%s_proc_t) getProc(\"%s\", userData);\n", in genContextImpl()
931 fprintf(fp, "\treturn 0;\n"); in genContextImpl()
932 fprintf(fp, "}\n\n"); in genContextImpl()
960 fprintf(fp, "\n\n#include <string.h>\n"); in genDecoderImpl()
961 fprintf(fp, "#include \"%s_opcodes.h\"\n\n", m_basename.c_str()); in genDecoderImpl()
962 fprintf(fp, "#include \"%s_dec.h\"\n\n\n", m_basename.c_str()); in genDecoderImpl()
963 fprintf(fp, "#include \"ProtocolUtils.h\"\n\n"); in genDecoderImpl()
964 fprintf(fp, "#include \"ChecksumCalculatorThreadInfo.h\"\n\n"); in genDecoderImpl()
965 fprintf(fp, "#include <stdio.h>\n\n"); in genDecoderImpl()
966fprintf(fp, "typedef unsigned int tsize_t; // Target \"size_t\", which is 32-bit for now. It may o… in genDecoderImpl()
969 fprintf(fp, in genDecoderImpl()
976 fprintf(fp, in genDecoderImpl()
987 fprintf(fp, "using namespace emugl;\n\n"); in genDecoderImpl()
990fprintf(fp, "size_t %s::decode(void *buf, size_t len, IOStream *stream, ChecksumCalculator* checks… in genDecoderImpl()
991 fprintf(fp, in genDecoderImpl()
999 fprintf(fp, in genDecoderImpl()
1004 fprintf(fp, in genDecoderImpl()
1010 fprintf(fp, in genDecoderImpl()
1017 fprintf(fp, "\t\tswitch(opcode) {\n"); in genDecoderImpl()
1041 fprintf(fp, "\t\tcase OP_%s: {\n", e->name().c_str()); in genDecoderImpl()
1044 fprintf(fp, "\t\t\tstruct timespec ts0, ts1, ts2;\n"); in genDecoderImpl()
1045 fprintf(fp, "\t\t\tclock_gettime(CLOCK_REALTIME, &ts0);\n"); in genDecoderImpl()
1060 fprintf(fp, "\t\t\tclock_gettime(CLOCK_REALTIME, &ts2);\n"); in genDecoderImpl()
1066 fprintf(fp, "\t\t\t*(%s *)(&tmpBuf[%s]) = ", retvalType.c_str(), in genDecoderImpl()
1072 fprintf(fp, "\t\t\tthis->%s_dec(", e->name().c_str()); in genDecoderImpl()
1074 fprintf(fp, "\t\t\tthis->%s(", e->name().c_str()); in genDecoderImpl()
1077 fprintf(fp, "this"); // add a context to the call in genDecoderImpl()
1081 fprintf(fp, "\t\t#ifdef CHECK_GL_ERRORS\n"); in genDecoderImpl()
1082 fprintf(fp, "\t\tGLint err = this->glGetError();\n"); in genDecoderImpl()
1083fprintf(fp, "\t\tif (err) fprintf(stderr, \"%s Error (pre-call): 0x%%X before %s\\n\", err);\n", in genDecoderImpl()
1085 fprintf(fp, "\t\t#endif\n"); in genDecoderImpl()
1087 fprintf(fp, in genDecoderImpl()
1093 fprintf(fp, ", "); in genDecoderImpl()
1111 fprintf(fp, ", "); in genDecoderImpl()
1114 fprintf(fp, ", "); in genDecoderImpl()
1119 fprintf(fp, in genDecoderImpl()
1130 fprintf(fp, "var_%s", var_name); in genDecoderImpl()
1137 fprintf(fp, in genDecoderImpl()
1148 fprintf(fp, "var_%s", var_name); in genDecoderImpl()
1155 fprintf(fp, in genDecoderImpl()
1165 fprintf(fp, in genDecoderImpl()
1171 fprintf(fp, in genDecoderImpl()
1182 fprintf(fp, in genDecoderImpl()
1189 fprintf(fp, in genDecoderImpl()
1194 fprintf(fp, in genDecoderImpl()
1202 fprintf(fp, in genDecoderImpl()
1209 fprintf(fp, in genDecoderImpl()
1217 fprintf(fp, in genDecoderImpl()
1223 fprintf(fp, in genDecoderImpl()
1230 fprintf(fp, in genDecoderImpl()
1243 fprintf(fp, in genDecoderImpl()
1247 fprintf(fp, in genDecoderImpl()
1257 fprintf(fp, in genDecoderImpl()
1264 fprintf(fp, in genDecoderImpl()
1272 fprintf(fp, "\t\t\tvoid* forPacking_%s = nullptr;\n", var_name); in genDecoderImpl()
1275 fprintf(fp, "\t\t\t%s;\n", v->hostPackTmpAllocExpression().c_str()); in genDecoderImpl()
1279 fprintf(fp, in genDecoderImpl()
1285 fprintf(fp, in genDecoderImpl()
1291 fprintf(fp, in genDecoderImpl()
1298 fprintf(fp, in genDecoderImpl()
1306 fprintf(fp, in genDecoderImpl()
1312 fprintf(fp, in genDecoderImpl()
1317 fprintf(fp, in genDecoderImpl()
1321 fprintf(fp, in genDecoderImpl()
1327 fprintf(fp, in genDecoderImpl()
1333 fprintf(fp, in genDecoderImpl()
1339 fprintf(fp, in genDecoderImpl()
1354 fprintf(fp, in genDecoderImpl()
1372 fprintf(fp, ");\n"); in genDecoderImpl()
1383 fprintf(fp, in genDecoderImpl()
1394 fprintf(fp, in genDecoderImpl()
1398 fprintf(fp, in genDecoderImpl()
1405 fprintf(fp, in genDecoderImpl()
1414 fprintf(fp, in genDecoderImpl()
1426 fprintf(fp, "\t\t\tclock_gettime(CLOCK_REALTIME, &ts1);\n");
1427fprintf(fp, "\t\t\tlong timeDiff = ts1.tv_sec*1000000 + ts1.tv_nsec/1000 - (ts0.tv_sec*1000000 + t…
1428fprintf(fp, "\t\t\tlong timeDiff2 = ts1.tv_sec*1000000 + ts1.tv_nsec/1000 - (ts2.tv_sec*1000000 + …
1429 fprintf(fp, "\t\t\tprintf(\"(timing) %%4ld.%%06ld %s: %%ld (%%ld) us\\n\", "
1432 fprintf(fp, "\t\t\tSET_LASTCALL(\"%s\");\n", e->name().c_str());
1433 fprintf(fp, "\t\t\tbreak;\n");
1434 fprintf(fp, "\t\t}\n");
1438 fprintf(fp, "\t\tdefault:\n");
1439 fprintf(fp, "\t\t\treturn ptr - (unsigned char*)buf;\n");
1440 fprintf(fp, "\t\t} //switch\n");
1442 fprintf(fp, "\t\t#ifdef CHECK_GL_ERRORS\n");
1443 fprintf(fp, "\t\tGLint err = this->glGetError();\n");
1444fprintf(fp, "\t\tif (err) fprintf(stderr, \"%s Error (post-call): 0x%%X in %%s\\n\", err, lastCall…
1445 fprintf(fp, "\t\t#endif\n");
1448 fprintf(fp, "\t\tptr += packetLen;\n");
1449 fprintf(fp, "\t} // while\n");
1450 fprintf(fp, "\treturn ptr - (unsigned char*)buf;\n");
1451 fprintf(fp, "}\n");
1514fprintf(stderr, "WARNING: %u: attribute of non existant entry point %s\n", (unsigned int)lc, line.… in readAttributes()
1542 fprintf(stderr, "line %u: missing value for base_opcode\n", (unsigned) lc); in setGlobalAttribute()
1580fprintf(stderr, "WARNING: %u : unknown global attribute %s\n", (unsigned int)lc, line.c_str()); in setGlobalAttribute()