Example #1
0
 void serialize(Archive& ar) {
   ar & MEMBER(type2internal_)
       & MEMBER(floor2c_t_)
       & MEMBER(table_restaurant_)
       & MEMBER(num_stop_customers_)
       & MEMBER(num_pass_customers_);
 }
Example #2
0
static void 
__cint_ast_dump_Declaration(cint_ast_t* ast, int indent)
{
    int dimension = 0;

    START("TYPE"); 
    cint_ast_dump(ast->utype.declaration.type, indent+4); 
    END(); 

    MEMBER((indent, "PCOUNT %d", ast->utype.declaration.pcount)); 

    START("DIMENSIONS");
    for(dimension = 0;
        dimension < CINT_CONFIG_ARRAY_DIMENSION_LIMIT; 
        ++dimension) {
        cint_ast_dump(
            ast->utype.declaration.dimension_initializers[dimension], 
            indent+4); 
    }
    END(); 

    START("IDENT"); 
    cint_ast_dump(ast->utype.declaration.identifier, indent+4); 
    END(); 
    
    START("INIT"); 
    cint_ast_dump(ast->utype.declaration.init, indent+4); 
    END(); 

    MEMBER(
        (indent, 
        "ARRAYDIMENSIONS %d",
        ast->utype.declaration.num_dimension_initializers));
}
  void serialize(Ar& ar) {
    ar & MEMBER(inv_)
       & MEMBER(inv_diff_)
       & MEMBER(column2norm_)
       & MEMBER(column2norm_diff_)
       & MEMBER(column2id_);

  }
Example #4
0
BOOL NEAR AcceptJM (NPA npA)
{
  NPC npC = npA->npC;
  UCHAR combined;

  /* AHCI mode is not supported yet! */
  if (GetRegB (PAdr, PCIREG_SUBCLASS) != PCI_IDE_CONTROLLER) return (FALSE);

  switch (PciInfo->Level) {
    case 0 : npC->numChannels = 1;
    default: npC->numChannels = 2;
  }
goto JMexit;
  combined = GetRegB (PAdr, 0x42) & 0x80;

  if (combined) {  // combined, primary SATA, secondary PATA
    npA->maxUnits = 2;
    if (npA->IDEChannel > 0) goto JMexit; // PATA channel
  } else {
    npA->maxUnits = 1;
  }

  npA->SCR.Offsets = 0x3120;
  GenericSATA (npA);
  npA->UnitCB[0].SStatus = GetAHCISCR (npA, npA->IDEChannel + 0);
  if (npA->maxUnits > 1)
    npA->UnitCB[1].SStatus = GetAHCISCR (npA, npA->IDEChannel + 1);

JMexit:
  npA->FlagsT |= ATBF_BIOSDEFAULTS;
  sprntf (npA->PCIDeviceMsg, JMMsgtxt, MEMBER(npA).Device & 0xFFF);
  return (TRUE);
}
Example #5
0
Word MINHITSET(Word A, Word B)
{
      Word L,As,C,Cp,p,Ap,T,s;

Step1: /* Quick decisions. */
      if (A == NIL) return (NIL);
      if ((B == 0) || (FIRST(A) == NIL)) return (MC_FAIL);

Step2: /* Initialize loop. */
      L = FIRST(A);
      As = RED(A);
      C = MC_FAIL; 

Step3: /* Loop over the elements of L, looking for a min. hit set of A. */
      while ( (L != NIL) && (B != 0) ) {
	ADV(L,&p,&L);

Step4: /* Eliminate from A all sets hit by p, call this Ap. */
	Ap = NIL; T = As;
	while ( T != NIL) {
	  ADV(T,&s,&T);
	  if (! MEMBER(p,s)) {
	    Ap = COMP(s,Ap); } }
	Ap = INV(Ap);

Step5: /* Recurse: Look for a cover of Ap of at most B-1 columns. */
         Cp = MINHITSET(Ap,B-1);
         if ( Cp != MC_FAIL ) {
           C = COMP(p,Cp);
           B = LENGTH(Cp); } }

Return: /* Loop complete.  Return. */
      return (C);
}
Example #6
0
static void 
__cint_ast_dump_Function(cint_ast_t* ast, int indent)
{
    MEMBER((indent, "NAME = '%s'", ast->utype.function.name)); 
    
    START("PARAMS"); 
    cint_ast_dump(ast->utype.function.parameters, indent+4); 
    END(); 
}
Example #7
0
 void serialize(Archive& ar) {
   ar & MEMBER(intern_);
   if (ar.is_read) {
     int num_topics, ngram_order;
     ar & num_topics & ngram_order;
     const_cast<int&>(num_topics_) = num_topics;
     const_cast<int&>(ngram_order_) = ngram_order;      
   } else {
     ar & const_cast<int&>(num_topics_);
     ar & const_cast<int&>(ngram_order_);
   }
 }
Example #8
0
static void 
__cint_ast_dump_While(cint_ast_t* ast, int indent)
{
    MEMBER((indent, "ORDER = %d", ast->utype._while.order)); 

    START("CONDITION"); 
    cint_ast_dump(ast->utype._while.condition, indent+4); 
    END(); 

    START("STATEMENTS"); 
    cint_ast_dump(ast->utype._while.statements, indent+4); 
    END(); 
}
Example #9
0
  void serialize(Ar& ar) {
    ar & MEMBER(lof_table_) & MEMBER(lof_table_diff_);
    ar & MEMBER(neighbor_num_) & MEMBER(reverse_nn_num_);

    // TODO(kashihara): Make it more efficient
    if (ar.is_read) {
      std::string name;
      ar & name;
      nn_engine_->clear();

      std::string impl;
      ar & impl;
      std::istringstream iss(impl);
      nn_engine_->load(iss);
    } else {
      std::string name = nn_engine_->type();
      ar & name;

      std::ostringstream oss;
      nn_engine_->save(oss);
      std::string str = oss.str();
      ar & str;
    }
  }
Example #10
0
BOOL NEAR AcceptCMD (NPA npA)
{
  UCHAR  enable;
  USHORT CmdReg;

  sprntf (npA->PCIDeviceMsg, CMD64xMsgtxt, MEMBER(npA).Device);

  if (MEMBER(npA).Device < 0x643) {
    if (MEMBER(npA).Revision == 0)
      return (FALSE);
    PciInfo->Level = CMD;
    npA->Cap = 0;
  } else if (MEMBER(npA).Device < 0x648) {
    PciInfo->Level = CMDB;
    if (MEMBER(npA).Revision < 3) {
      PciInfo->Level = CMDA;
      npA->Cap &= ~CHIPCAP_ULTRAATA;
    }
  } else if (MEMBER(npA).Device == 0x648) {
    PciInfo->Level = CMDC;
    npA->Cap |= CHIPCAP_ATA66;
  } else if (MEMBER(npA).Device == 0x649) {
    PciInfo->Level = CMDD;
    npA->Cap |= CHIPCAP_ATA66 | CHIPCAP_ATA100;
  }

  if (npA->FlagsI.b.native)
    if (PciInfo->Level < CMDB)
      return (FALSE);
    else
      METHOD(npA).CheckIRQ = CMDCheckIRQ;

  if (PciInfo->Level <= CMDB)
    METHOD(npA).PCIFunc_InitComplete = GenericInitComplete;

  enable = GetRegB (PCIAddr, PCI_CMD_IDEENABLE);
  if (PciInfo->Level < CMDB)
    enable |= 1 << 2;
  if (PciInfo->Level < CMDA)
    enable |= 1 << 3;
  if (!(enable & (0x04 << npA->IDEChannel)) && !(npA->FlagsT & ATBF_BAY))
    return (FALSE);

  if (npA->Cap & CHIPCAP_ATA66) {
    /* determine the presence of a 80wire cable as per defined procedure */

    enable = GetRegB (PCIAddr, PCI_CMD_IDECSR);
    if (enable & (1 << npA->IDEChannel)) npA->Cap |= CHANCAP_CABLE80;
  }
  return (TRUE);
}
Example #11
0
static void 
__cint_ast_dump_Operator(cint_ast_t* ast, int indent)
{
    MEMBER((indent, "OP = '%s'", cint_operator_name(ast->utype.operator.op))); 
    
    START("LEFT"); 
    cint_ast_dump(ast->utype.operator.left, indent+4); 
    END(); 

    START("RIGHT"); 
    cint_ast_dump(ast->utype.operator.right, indent+4); 
    END(); 

    START("EXTRA"); 
    cint_ast_dump(ast->utype.operator.extra, indent+4); 
    END(); 
}
Example #12
0
namespace codegen {

DEFINE_TYPE(Sorter, "peloton::util::Sorter", MEMBER(buffer_start),
            MEMBER(buffer_pos), MEMBER(buffer_end), MEMBER(num_tuples),
            MEMBER(tuple_size), MEMBER(comp_fn));

DEFINE_METHOD(peloton::codegen::util, Sorter, Init);
DEFINE_METHOD(peloton::codegen::util, Sorter, StoreInputTuple);
DEFINE_METHOD(peloton::codegen::util, Sorter, Sort);
DEFINE_METHOD(peloton::codegen::util, Sorter, Clear);
DEFINE_METHOD(peloton::codegen::util, Sorter, Destroy);

}  // namespace codegen
Example #13
0
void QepcadCls::SEPPIVNONPIV(Word Q_k, Word k, Word *PP_, Word *NP_)
{
      Word C,NP,PP,L,l;

Step1: /* No pivot at this level. */
      if ((!ISLIST(GVPIVOT)) || (LENGTH(GVPIVOT) < k) || 
	  ((C = LELTI(GVPIVOT,k)) == NIL)) {
	PP = Q_k; NP = NIL; goto Return; }

Step2: /* There is a pivot at this level. */
	  NP = NIL; PP = NIL; L = Q_k;
	  while (L != NIL) {
	    ADV(L,&l,&L);
	    if ( !MEMBER(LELTI(l,PO_LABEL),C) )
	      NP = COMP(l,NP);
	    else
	      PP = COMP(l,PP); }

Return:/* Return. */
	  *PP_ = PP;
	  *NP_ = NP;
	  return;
}
Example #14
0
BOOL NEAR AcceptITE (NPA npA)
{
  USHORT Config;

  npA->Cap |= CHIPCAP_ATA66 | CHIPCAP_ATA100 | CHIPCAP_ATA133;

  sprntf (npA->PCIDeviceMsg, ITEMsgtxt, MEMBER(npA).Device);

  if (GetRegB (Addr, ITE_MODECTRL) & 1) {
    // switch to bypass mode

    if (PciInfo->Level == ITEA)
      SetRegB (Addr, 0x5E, 0x01);      // reset local CPU

    // set to bypass mode

    SetRegB (Addr, ITE_MODECTRL, 0x80);
    SetRegB (Addr, ITE_MODECTRL, 0x00);

    DevHelp_ProcBlock ((ULONG)(PVOID)&AcceptITE, 50, 0);

    // set default PIO timing register of both channels

    SetRegB (Addr, ITE_PIOTIM + 0, 0xA3);
    SetRegB (Addr, ITE_PIOTIM + 4, 0xA3);

    SetRegD (Addr, 0x4C, 0x02040204);
    SetRegB (Addr, 0x42, 0x36);
  }

  Config = GetRegW (Addr, ITE_CONFIG);
  SetRegW (Addr, ITE_CONFIG, Config | 0xA000);

  if (!(Config & (npA->IDEChannel ? 8 : 4))) npA->Cap |= CHANCAP_CABLE80;
  return (TRUE);
}
Example #15
0
 void serialize(Ar& ar) {
   ar & MEMBER(property) & MEMBER(in_edges) & MEMBER(out_edges);
 }
Example #16
0
 void serialize(Ar& ar) {
   ar & MEMBER(score) & MEMBER(out_degree_num);
 }
Example #17
0
 void serialize(Ar& ar) {
   ar & MEMBER(landmark) & MEMBER(from_root) & MEMBER(to_root);
 }
Example #18
0
 void serialize(Ar& ar) {
   ar & MEMBER(edge_query) & MEMBER(node_query);
 }
Example #19
0
    return (PyObject*) wrap_patch(patch);
}

static void
Patch_dealloc(Patch *self)
{
    Py_CLEAR(self->hunks);
    free(self->old_id);
    free(self->new_id);
    /* We do not have to free old_file_path and new_file_path, they will
     * be freed by git_diff_list_free in Diff_dealloc */
    PyObject_Del(self);
}

PyMemberDef Patch_members[] = {
    MEMBER(Patch, old_file_path, T_STRING, "old file path"),
    MEMBER(Patch, new_file_path, T_STRING, "new file path"),
    MEMBER(Patch, old_id, T_STRING, "old oid"),
    MEMBER(Patch, new_id, T_STRING, "new oid"),
    MEMBER(Patch, status, T_CHAR, "status"),
    MEMBER(Patch, similarity, T_INT, "similarity"),
    MEMBER(Patch, hunks, T_OBJECT, "hunks"),
    MEMBER(Patch, additions, T_INT, "additions"),
    MEMBER(Patch, deletions, T_INT, "deletions"),
    {NULL}
};

PyDoc_STRVAR(Patch_is_binary__doc__, "True if binary data, False if not.");

PyObject *
Patch_is_binary__get__(Patch *self)
Example #20
0
/// output MessagePack object to stream in text format
void log_text(FILE *stream, msgpack_object *msg) {
	// helper macro to access a specific array element
	#define MEMBER(n)	msg->via.array.ptr[n]

	//msgpack_object_print(stream, *msg); // (print msgpack array, DEBUG only)

	// process ID
	if (MEMBER(3).type != MSGPACK_OBJECT_NIL)
		fprintf(stream, "PID 0x%X ", (unsigned int)MEMBER(3).via.u64);

	// indentation (DEBUG only)
	//fprintf(stream, "@%u ", (unsigned int)MEMBER(1).via.u64);
	// serial (DEBUG only)
	//fprintf(stream, "#%u ", (uint32_t)MEMBER(7).via.u64);

	// log level
	LOG_LEVEL level = MEMBER(0).via.u64;
	putc('[', stream);
	fputs(log_level_string(level), stream);
	fputs("] ", stream);

	double timestamp = MEMBER(2).via.f64;
	if (timestamp > 0) { // log timestamp (UTC seconds since the Epoch)
		char time_str[16];
		format_timestamp(time_str, sizeof(time_str), "%H:%M:%S.qqq ", timestamp, true);
		fputs(time_str, stream);
	}

	// message origin (e.g. module)
	if (msgpack_object_str_fwrite(MEMBER(4).via.str, stream))
		fputs(": ", stream);

	switch (level) {
	case LOG_LEVEL_SEPARATOR: // no message text, no attachment
		fputs("----------------------------------------", stream);
		break;

	case LOG_LEVEL_CHECKPOINT:
		fputs("Check point '", stream);
		msgpack_object_str_fwrite(MEMBER(5).via.str, stream); // msg = ID/name
		fputs("' #", stream);
		msgpack_object_print(stream, MEMBER(6)); // attachment = pass count
		break;

	case LOG_LEVEL_SCRATCHPAD:
		msgpack_object_str_fwrite(MEMBER(5).via.str, stream); // msg = key
		fputs(" <- ", stream);
		msgpack_object_str_fwrite(MEMBER(6).via.str, stream); // attachment = value
		break;

	default:
		msgpack_object_str_fwrite(MEMBER(5).via.str, stream); // the actual message
		// optional attachment (arbitrary MessagePack object)
		if (MEMBER(6).type != MSGPACK_OBJECT_NIL) {
			fputs("\n\t", stream); // new line and TAB
			msgpack_object_print(stream, MEMBER(6));
		}
	}

	putc('\n', stream);
	fflush(stream);
}
 void serialize(Archive &ar){
   ar & MEMBER(pattern) & MEMBER(counter) & MEMBER(SI_prefix) & MEMBER(optional_power_of_ten) & MEMBER(ordinary) & MEMBER(option);
 }
Example #22
0
void checker_function(void)
{
	DEFS(TMAX_TPRI);
	DEFS(TMIN_TPRI);

	DEFS(TMAX_MPRI);
	DEFS(TMIN_MPRI);

	DEFS(TMAX_RELTIM);

	MEMBER(queue,next);
	MEMBER(queue,prev);


		/* task */

	OBJECT(task_5,LOGTASK);
	OBJECT(task_4,MAIN_TASK);
	OBJECT(task_1,TASK1);
	OBJECT(task_2,TASK2);
	OBJECT(task_3,TASK3);
	EVAR(ID,_kernel_tmax_tskid);
	EVAR(TINIB,_kernel_tinib_table);
	MEMBER(task_initialization_block,tskatr);
	MEMBER(task_initialization_block,exinf);
	MEMBER(task_initialization_block,task);
	MEMBER(task_initialization_block,ipriority);
	MEMBER(task_initialization_block,stksz);
	MEMBER(task_initialization_block,stk);
	MEMBER(task_initialization_block,texatr);
	MEMBER(task_initialization_block,texrtn);


		/* semaphore */

	OBJECT(semaphore_1,SERIAL_RCV_SEM1);
	OBJECT(semaphore_2,SERIAL_SND_SEM1);
	EVAR(ID,_kernel_tmax_semid);
	EVAR(SEMINIB,_kernel_seminib_table);
	MEMBER(semaphore_initialization_block,sematr);
	MEMBER(semaphore_initialization_block,isemcnt);
	MEMBER(semaphore_initialization_block,maxsem);


		/* eventflag */

	EVAR(ID,_kernel_tmax_flgid);
	EVAR(FLGINIB,_kernel_flginib_table);
	MEMBER(eventflag_initialization_block,flgatr);
	MEMBER(eventflag_initialization_block,iflgptn);


		/* dataqueue */

	EVAR(ID,_kernel_tmax_dtqid);
	EVAR(DTQINIB,_kernel_dtqinib_table);
	MEMBER(dataqueue_initialization_block,dtqatr);
	MEMBER(dataqueue_initialization_block,dtqcnt);
	MEMBER(dataqueue_initialization_block,dtq);


		/* mailbox */

	EVAR(ID,_kernel_tmax_mbxid);
	EVAR(MBXINIB,_kernel_mbxinib_table);
	MEMBER(mailbox_initialization_block,mbxatr);
	MEMBER(mailbox_initialization_block,maxmpri);


		/* mempfix */

	EVAR(ID,_kernel_tmax_mpfid);
	EVAR(MPFINIB,_kernel_mpfinib_table);
	MEMBER(fixed_memorypool_initialization_block,mpfatr);
	MEMBER(fixed_memorypool_initialization_block,blksz);
	MEMBER(fixed_memorypool_initialization_block,mpf);
	MEMBER(fixed_memorypool_initialization_block,limit);


		/* cyclic */

	OBJECT(cyclic_1,CYCHDR1);
	EVAR(ID,_kernel_tmax_cycid);
	EVAR(CYCINIB,_kernel_cycinib_table);
	MEMBER(cyclic_handler_initialization_block,cycatr);
	MEMBER(cyclic_handler_initialization_block,exinf);
	MEMBER(cyclic_handler_initialization_block,cychdr);
	MEMBER(cyclic_handler_initialization_block,cyctim);
	MEMBER(cyclic_handler_initialization_block,cycphs);


		/* interrupt */

	OBJECT(interrupt_0,0);
	OBJECT(interrupt_1,1);
	EVAR(ID,_kernel_tnum_inhno);
	EVAR(INHINIB,_kernel_inhinib_table);
	MEMBER(interrupt_handler_initialization_block,inhno);
	MEMBER(interrupt_handler_initialization_block,inhatr);
	MEMBER(interrupt_handler_initialization_block,inthdr);


		/* exception */

	EVAR(ID,_kernel_tnum_excno);
	EVAR(EXCINIB,_kernel_excinib_table);
	MEMBER(cpu_exception_handler_initialization_block,excno);
	MEMBER(cpu_exception_handler_initialization_block,excatr);
	MEMBER(cpu_exception_handler_initialization_block,exchdr);

}
Example #23
0
 void serialize(Ar& ar) {
   ar & MEMBER(hash_num);
 }
 void serialize(Ar& ar) {
   ar & MEMBER(tbl_)
     & MEMBER(class2id_)
     & MEMBER(tbl_diff_);
 }
Example #25
0
 void serialize(Archiver &ar) {
   ar & MEMBER(success) & MEMBER(retval) & MEMBER(error);
 }
Example #26
0
 void serialize(Ar& ar) {
   ar & MEMBER(p) & MEMBER(src) & MEMBER(tgt);
 }
Example #27
0
 void serialize(Ar& ar) {
   ar & MEMBER(bitvals_) & MEMBER(bitvals_diff_);
 }
Example #28
0
Note_dealloc(Note *self)
{
    Py_CLEAR(self->repo);
    free(self->annotated_id);
    git_note_free(self->note);
    PyObject_Del(self);
}


PyMethodDef Note_methods[] = {
    METHOD(Note, remove, METH_VARARGS),
    {NULL}
};

PyMemberDef Note_members[] = {
    MEMBER(Note, annotated_id, T_STRING, "id of the annotated object."),
    {NULL}
};

PyGetSetDef Note_getseters[] = {
    GETTER(Note, message),
    GETTER(Note, oid),
    {NULL}
};

PyDoc_STRVAR(Note__doc__, "Note object.");

PyTypeObject NoteType = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "_pygit2.Note",                            /* tp_name           */
    sizeof(Note),                              /* tp_basicsize      */
Example #29
0
    return 0;
}


static void
RefLogEntry_dealloc(RefLogEntry *self)
{
    free(self->oid_old);
    free(self->oid_new);
    free(self->message);
    git_signature_free(self->signature);
    PyObject_Del(self);
}

PyMemberDef RefLogEntry_members[] = {
    MEMBER(RefLogEntry, oid_new, T_STRING, "New oid."),
    MEMBER(RefLogEntry, oid_old, T_STRING, "Old oid."),
    MEMBER(RefLogEntry, message, T_STRING, "Message."),
    {NULL}
};

PyGetSetDef RefLogEntry_getseters[] = {
    GETTER(RefLogEntry, committer),
    {NULL}
};


PyDoc_STRVAR(RefLogEntry__doc__, "Reference log object.");

PyTypeObject RefLogEntryType = {
    PyVarObject_HEAD_INIT(NULL, 0)
Example #30
0
    }

    return (PyObject *) py_line;
}

static void
DiffFile_dealloc(DiffFile *self)
{
    Py_CLEAR(self->id);
    if (self->path)
        free(self->path);
    PyObject_Del(self);
}

PyMemberDef DiffFile_members[] = {
    MEMBER(DiffFile, id, T_OBJECT, "Oid of the item."),
    MEMBER(DiffFile, path, T_STRING, "Path to the entry."),
    MEMBER(DiffFile, size, T_LONG, "Size of the entry."),
    MEMBER(DiffFile, flags, T_UINT, "Combination of GIT_DIFF_FLAG_* flags."),
    MEMBER(DiffFile, mode, T_USHORT, "Mode of the entry."),
    {NULL}
};


PyDoc_STRVAR(DiffFile__doc__, "DiffFile object.");

PyTypeObject DiffFileType = {
    PyVarObject_HEAD_INIT(NULL, 0)
    "_pygit2.DiffFile",                        /* tp_name           */
    sizeof(DiffFile),                          /* tp_basicsize      */
    0,                                         /* tp_itemsize       */