functionSource stringlengths 20 97.4k | CWE-119 bool 2
classes | CWE-120 bool 2
classes | CWE-469 bool 2
classes | CWE-476 bool 2
classes | CWE-other bool 2
classes | combine int64 0 1 |
|---|---|---|---|---|---|---|
enchant_dict_add (EnchantDict * dict, const char *const word,
ssize_t len)
{
EnchantSession * session;
g_return_if_fail (dict);
g_return_if_fail (word);
if (len < 0)
len = strlen (word);
g_return_if_fail (len);
g_return_if_fail (g_utf8_validate(word, len, NULL));
session = ((EnchantDictPrivateData*)dic... | false | false | false | false | false | 0 |
JumpTo(double campos[3], double focpos[3])
{
if (this->CurrentRenderer == NULL)
{
return;
}
vtkCamera* cam = this->CurrentRenderer->GetActiveCamera();
cam->SetPosition(campos);
cam->SetFocalPoint(focpos);
FinishCamera(cam);
this->Interactor->Render();
} | false | false | false | false | false | 0 |
gnumeric_lazy_list_new (GnumericLazyListValueGetFunc get_value,
gpointer user_data,
gint n_rows,
gint n_columns,
...)
{
GnumericLazyList *retval;
va_list args;
gint i;
g_return_val_if_fail (n_rows >= 0, NULL);
g_return_val_if_fail (n_columns >= 0, NULL);
retval = GNUMERIC_LAZY_LIST (g_object_new (gn... | false | false | false | false | false | 0 |
adapter_create(DBusConnection *conn, int id)
{
char path[MAX_PATH_LENGTH];
struct btd_adapter *adapter;
const char *base_path = manager_get_base_path();
if (!connection)
connection = conn;
adapter = g_try_new0(struct btd_adapter, 1);
if (!adapter) {
error("adapter_create: failed to alloc memory for hci%d", ... | false | false | false | false | false | 0 |
seg2rect (void)
{
long width = env.layer2width (seg.LAYER);
long spacing = env.layer2spacing (seg.LAYER);
long expand;
// Special case of "point like" segments.
if ((seg.X1 == seg.X2) && (seg.Y1 == seg.Y2)) {
rect.x1 = seg.X1;
rect.y1 = seg.Y1;
rect.x2 = seg.X2;
rect.y2 = seg.Y2;
... | false | false | false | false | false | 0 |
QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest)
{
if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11)
{
Creature* pSlim = GetClosestCreatureWithEntry(pCreature, NPC_TAPOKE_SLIM_JAHN, 25.0f);
if (!pSlim)
{
return false;
}
i... | false | false | false | false | false | 0 |
split_string (split_rec *rec,
const char *in,
char c,
bfd_boolean elide_whitespace)
{
int cnt = 0;
int i;
const char *p = in;
while (p != NULL && *p != '\0')
{
cnt++;
p = strchr (p, c);
if (p)
p++;
}
rec->count = cnt;
rec->vec = NULL;
if (rec->count == 0)
... | false | true | true | false | false | 1 |
_outList(StringInfo str, List *node)
{
ListCell *lc;
appendStringInfoChar(str, '(');
if (IsA(node, IntList))
appendStringInfoChar(str, 'i');
else if (IsA(node, OidList))
appendStringInfoChar(str, 'o');
foreach(lc, node)
{
/*
* For the sake of backward compatibility, we emit a slightly
* different... | false | false | false | false | false | 0 |
ReceiveData(SSL* ssl, byte* output, int sz)
{
int size;
CYASSL_ENTER("ReceiveData()");
if (ssl->error == WANT_READ)
ssl->error = 0;
if (ssl->options.handShakeState != HANDSHAKE_DONE) {
int err;
CYASSL_MSG("Handshake not complete, trying to finish");
if ( (err = CyaSSL_... | false | false | false | false | false | 0 |
H5T_vlen_disk_setnull(H5F_t *f, hid_t dxpl_id, void *_vl, void *_bg)
{
uint8_t *vl = (uint8_t *)_vl; /*Pointer to the user's hvl_t information*/
uint8_t *bg = (uint8_t *)_bg; /*Pointer to the old data hvl_t */
uint32_t seq_len = 0; /* Sequence length */
herr_t ret_value = SUCCEED; /* ... | false | false | false | false | false | 0 |
_modbus_tcp_connect(modbus_t *ctx)
{
int rc;
/* Specialized version of sockaddr for Internet socket address (same size) */
struct sockaddr_in addr;
modbus_tcp_t *ctx_tcp = ctx->backend_data;
int flags = SOCK_STREAM;
#ifdef OS_WIN32
if (_modbus_tcp_init_win32() == -1) {
return -1;
}
... | false | false | false | false | false | 0 |
__find_in_sessionid_hashtbl(struct nfs4_sessionid *sessionid, struct net *net)
{
struct nfsd4_session *elem;
int idx;
struct nfsd_net *nn = net_generic(net, nfsd_net_id);
lockdep_assert_held(&nn->client_lock);
dump_sessionid(__func__, sessionid);
idx = hash_sessionid(sessionid);
/* Search in the appropriate li... | false | false | false | false | false | 0 |
writeDataBlobs(FILE *out)
{
fprintf(out, "qt_resource_data = %s\"", mPrefix);
QStack<RCCFileInfo*> pending;
if (!root)
return false;
pending.push(root);
qint64 offset = 0;
while(!pending.isEmpty()) {
RCCFileInfo *file = pending.pop();
for(QHash<QString, RCCFileInfo*>::i... | false | false | false | false | false | 0 |
brcmf_sdio_assert_info(struct seq_file *seq, struct brcmf_sdio *bus,
struct sdpcm_shared *sh)
{
int error = 0;
char file[80] = "?";
char expr[80] = "<???>";
if ((sh->flags & SDPCM_SHARED_ASSERT_BUILT) == 0) {
brcmf_dbg(INFO, "firmware not built with -assert\n");
return 0;
} else if ((sh->flags & SDPCM_S... | false | false | false | false | false | 0 |
mdb_idl_append_one( ID *ids, ID id )
{
if (MDB_IDL_IS_RANGE( ids )) {
/* if already in range, treat as a dup */
if (id >= MDB_IDL_RANGE_FIRST(ids) && id <= MDB_IDL_RANGE_LAST(ids))
return -1;
if (id < MDB_IDL_RANGE_FIRST(ids))
ids[1] = id;
else if (id > MDB_IDL_RANGE_LAST(ids))
ids[2] = id;
return 0... | false | false | false | false | false | 0 |
mpi_sche_write_send_data_transfer_function_for_nt_set(fsbe_context *cx, Module_table *module, List *nt_set_list)
{
int i;
int j;
Nt_set *nt_set;
Nt_elem *nt_elem;
for( i = 0; i < list_length(nt_set_list); i++){
nt_set = (Nt_set *)list_nth_data(nt_set_list, i);
fsbe_printf(cx, "static void\n");
... | false | false | false | false | false | 0 |
iterate_over_dir(char * dirname) {
GDir * dir = g_dir_open(dirname, 0, NULL);
if (!dir) {
free(dirname);
return;
}
const char * file;
while ((file = g_dir_read_name(dir))) {
char * filepath = g_build_filename(dirname, file, NULL);
if (g_file_test(filepath, G_FILE_TEST_IS_DIR) &&
dirname_filter(file))... | false | false | false | false | false | 0 |
_ff_read_next_command(fast_forward_song_iterator_t *self,
byte *buf, int *result)
{
int rv;
if (self->delta <= 0)
return SI_MORPH; /* Did our duty */
while (1) {
rv = self->delegate->next(self->delegate, buf, result);
if (rv > 0) {
/* Subtract from the delta we want to wait */
self->delta -= r... | false | true | false | false | false | 1 |
initLeaf(uint32_t *primNums, int np,
MemoryArena &arena) {
flags = 3;
nPrims |= (np << 2);
// Store primitive ids for leaf node
if (np == 0)
onePrimitive = 0;
else if (np == 1)
onePrimitive = primNums[0];
else {
primitives = arena.Alloc<uint32_t... | false | false | false | false | false | 0 |
init_clsock(struct t_clsock *client_sock)
{
if (client_sock != NULL)
{
client_sock->socket = -1;
client_sock->ip.ip_str = NULL;
client_sock->ip.s_addr = 0;
client_sock->prev = NULL;
client_sock->next = NULL;
}
} | false | false | false | false | false | 0 |
find_nonnullable_rels_walker(Node *node, bool top_level)
{
Relids result = NULL;
if (node == NULL)
return NULL;
if (IsA(node, Var))
{
Var *var = (Var *) node;
if (var->varlevelsup == 0)
result = bms_make_singleton(var->varno);
}
else if (IsA(node, List))
{
ListCell *l;
foreach(l, (List *) ... | false | false | false | false | false | 0 |
splashOutBlendScreen(SplashColorPtr src, SplashColorPtr dest,
SplashColorPtr blend, SplashColorMode cm) {
int i;
#ifdef SPLASH_CMYK
if (cm == splashModeCMYK8) {
SplashColor rgbSrc;
SplashColor rgbDest;
SplashColor rgbBlend;
cmykToRGB(src, rgbSrc);
cmykToRGB(dest, rgbDest);
for (i = 0; ... | false | false | false | false | false | 0 |
xform_tf_syst_enable(struct st_t *nstp)
{
register int32 ai;
struct tskcall_t *tkcp;
struct tfrec_t *tfrp;
struct expr_t *argxp;
struct tfarg_t *tfap;
tkcp = &(nstp->st.stkc);
/* DBG remove --- */
if (tkcp->tkcaux.trec == NULL) __misc_terr(__FILE__, __LINE__);
/* --- */
/* tsk call record contains tfrec for ... | false | false | false | false | false | 0 |
object_mention(const object_type *o_ptr)
{
char o_name[80];
/* Describe */
object_desc(o_name, sizeof(o_name), o_ptr, ODESC_BASE | ODESC_SPOIL);
/* Provide a silly message */
if (artifact_p(o_ptr))
msg_format("Artifact (%s)", o_name);
else if (ego_item_p(o_ptr))
msg_format("Ego-item (%s)", o_name);
else
... | false | false | false | false | false | 0 |
blitdofast_desc_b1 (uaecptr pta, uaecptr ptb, uaecptr ptc, uaecptr ptd, struct bltinfo *b)
{
uae_u32 totald = 0;
int i,j;
uae_u32 preva = 0;
uae_u32 prevb = 0, srcb = b->bltbhold;
uae_u32 srcc = b->bltcdat;
uae_u32 dstd = 0;
uaecptr dstp = 0;
for (j = b->vblitsize; j--; ) {
for (i = 0; i < b->hblitsize; i++) {
uae_u... | false | false | false | false | false | 0 |
shift(int dx, int dy, int dz)
{
int x, y, z, x1=0, x2=GRID_SX-1, y1=0, y2=GRID_SY-1, z1=0, z2=GRID_SZ-1;
unsigned char temp[GRID_SX][GRID_SY][GRID_SZ];
memset(temp, 0, sizeof(temp));
if (dx > 0) x2 -= dx;
if (dx < 0) x1 -= dx;
if (dy > 0) y2 -= dy;
if (dy < 0) y1 -= dy;
if (dz > 0) z2 -= dz;
if (dz < ... | false | false | false | false | false | 0 |
post_load_init(VMG_ vm_obj_id_t self)
{
vm_obj_id_t comp;
/*
* Rebuild the hash table with the comparator, if we have one. When
* we load, reset, or restore, we build a tentative hash table with no
* comparator (i.e., the default exact literal comparator), because we
* ... | false | false | false | false | false | 0 |
load_all()
{
int fd;
fd = open("/dev/mxpcispi", O_RDONLY);
if(fd > 0)
{
printf("open successfully\n");
bzero(keys,sizeof(KEYINFO)*MAX_KEY_SIZE);
FlashUserInfo userinfo;
userinfo.addr = SPI_KEY_START;
userinfo.len = sizeof(HEADER_INFO);
userinfo.buf = (ui... | false | false | false | false | true | 1 |
gen_split_1520 (rtx curr_insn ATTRIBUTE_UNUSED, rtx *operands)
{
rtx operand0;
rtx operand1;
rtx operand2;
rtx operand3;
rtx operand4;
rtx _val = 0;
start_sequence ();
#line 1905 "../../src/gcc/config/rs6000/rs6000.md"
{
HOST_WIDE_INT val = INTVAL (operands[2]);
HOST_WIDE_INT low = ((val & 0xffff) ^ 0... | false | false | false | false | false | 0 |
my_getc (void)
{
static int shown;
int c;
for (;;)
{
if ((c = getc (stdin)) == EOF)
return EOF;
if (!(c & 0x80))
return c;
if (!shown)
{
shown = 1;
fputs ("note: Non ASCII characters are ignored\n", stderr);
}
}
} | false | false | false | false | false | 0 |
get_ff_hwaddr(struct xmit_frame *pxmitframe)
{
u32 addr = 0;
struct pkt_attrib *pattrib = &pxmitframe->attrib;
struct _adapter *padapter = pxmitframe->padapter;
struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
if (pxmitframe->frame_tag == TXAGG_FRAMETAG) {
addr = RTL8712_DMA_H2CCMD;
} else if (pxmitframe->fra... | false | false | false | false | false | 0 |
invalidate_local_connection (const char *dbus_id,
GError **error)
{
ThreadLocalConnections *local;
_g_daemon_vfs_invalidate_dbus_id (dbus_id);
local = g_private_get (&local_connections);
if (local)
g_hash_table_remove (local->connections, dbus_id);
g_set_error_literal (error,
G_VFS... | false | false | false | false | false | 0 |
linkylinky(int image, MMIOT *f)
{
int start = mmiottell(f);
Cstring name;
Footnote key, *ref;
int status = 0;
CREATE(name);
memset(&key, 0, sizeof key);
if ( linkylabel(f, &name) ) {
if ( peek(f,1) == '(' ) {
pull(f);
if ( linkyurl(f, image, &key) )
status = linkyformat(f, ... | false | false | false | false | false | 0 |
alphabet (int set, int index)
{
if (h_version > V1 && set == 2 && index == 1)
return 0x0D; /* always newline */
if (h_alphabet != 0) { /* game uses its own alphabet */
zbyte c;
zword addr = h_alphabet + 26 * set + index;
LOW_BYTE (addr, c)
return translate_from_zscii (c);
} else /* game uses de... | false | false | false | false | false | 0 |
execv ( const char *command, char * const argv[] ) {
struct command *cmd;
int argc;
/* Count number of arguments */
for ( argc = 0 ; argv[argc] ; argc++ ) {}
/* Sanity checks */
if ( ! command ) {
DBG ( "No command\n" );
return -EINVAL;
}
if ( ! argc ) {
DBG ( "%s: empty argument list\n", command );
r... | true | true | false | false | true | 1 |
is_set_address(unsigned char *setup_packet)
{
if (((setup_packet[0] & USB_TYPE_MASK) == USB_TYPE_STANDARD) &&
setup_packet[1] == USB_REQ_SET_ADDRESS)
return 1;
else
return 0;
} | false | false | false | false | false | 0 |
T1BlockGetType (T1Block* block) {
if ((block->data[1] & 0x80) == T1_BLOCK_I)
return T1_BLOCK_I;
return (block->data[1] & 0xC0);
} | false | false | false | false | false | 0 |
constantWrapper(Node *n) {
String *name = Getattr(n, "name");
String *iname = Getattr(n, "sym:name");
SwigType *type = Getattr(n, "type");
String *rawval = Getattr(n, "rawval");
String *value = rawval ? rawval : Getattr(n, "value");
String *tm;
if (!addSymbol(iname, n))
return SWIG_ER... | false | false | false | false | false | 0 |
tp_base_call_channel_dispose (GObject *object)
{
TpBaseCallChannel *self = TP_BASE_CALL_CHANNEL (object);
tp_clear_pointer (&self->priv->contents, content_list_destroy);
tp_clear_pointer (&self->priv->call_members, g_hash_table_unref);
if (G_OBJECT_CLASS (tp_base_call_channel_parent_class)->dispose)
G_OBJ... | false | false | false | false | false | 0 |
BusyWait (DWORD msec)
{
switch (DisplayStatus)
{
case DISPLAY_ERROR_TRAP:
case DISPLAY_COMM_PROBLEM:
case DISPLAY_PRINTER_NOT_SUPPORTED:
case DISPLAY_OUT_OF_PAPER:
case DISPLAY_PHOTOTRAY_MISMATCH:
case DISPLAY_TOP_COVER_OPEN:
case DISPLAY_NO_COLOR_PEN:
case DISPLAY_... | false | false | false | false | false | 0 |
ensure_buffer(char **buffer, int *buflen, int len)
{
if (len > *buflen) {
if (*buffer)
myfree(*buffer, M_STRING);
*buflen = len;
*buffer = mymalloc(len, M_STRING);
}
} | false | false | false | false | false | 0 |
sanityCheck(const MSTableColumnGroup &group_) const
{
MSBoolean sanity=MSTrue;
MSTable *t=(MSTable *)this;
MSWidgetVector vector=t->children();
MSTableSanityCheck check(vector,sanity);
group_.allNodesDo(check);
return sanity;
} | false | false | false | false | false | 0 |
processingInstruction (const char * target, const char * data)
{
if (m_bStopped) return;
if (m_pExpertListener)
{
if (m_chardata_length) flush_all ();
m_pExpertListener->ProcessingInstruction (target, data);
}
} | false | false | false | false | false | 0 |
cmd_thread(char *tag, int usinguid)
{
static struct buf arg;
int c;
int charset = 0;
int alg;
struct searchargs *searchargs;
clock_t start = clock();
char mytime[100];
int n;
if (backend_current) {
/* remote mailbox */
const char *cmd = usinguid ? "UID Thread" : "Thread";
prot_p... | true | true | true | false | false | 1 |
real_aligned_malloc (size_t size, size_t align)
{
void *p0, *p;
if (NOT_POWER_OF_TWO(align)) {
errno = EINVAL;
return NULL;
}
if (align < sizeof(void *)) {
align = sizeof(void *);
}
/* including the extra sizeof(void*) is overkill on a 32-bit
machine, since malloc is already 8-byte ... | false | false | false | false | false | 0 |
vectorFromTextFile( std::vector<double> &vec, const std::string &fileName, bool byRows )
{
FILE *f = os::fopen( fileName.c_str(), "r" );
if (!f) return false;
double number = 0;
while ( !feof(f) )
{
size_t readed = fscanf( f, byRows ? "%lf" : "%lf\n", &number );
if ( (!byRows) || (readed == 1) )
vec.push_... | false | false | false | false | true | 1 |
sais_int_bwt(const int *T, int *U, int *A, int n, int k) {
int i, pidx;
if((T == NULL) || (U == NULL) || (A == NULL) || (n < 0) || (k <= 0)) { return -1; }
if(n <= 1) { if(n == 1) { U[0] = T[0]; } return n; }
pidx = sais_main(T, A, 0, n, k, sizeof(int), 1);
if(pidx < 0) { return pidx; }
U[0] = T[n - 1];
f... | false | false | false | false | false | 0 |
e_gadcon_client_add_location_menu(E_Gadcon_Client *gcc, E_Menu *menu)
{
E_Menu *mn;
E_Menu_Item *mi;
E_OBJECT_CHECK(gcc);
E_OBJECT_TYPE_CHECK(gcc, E_GADCON_CLIENT_TYPE);
if (gcc->gadcon->location)
{
mn = e_menu_new();
mi = e_menu_item_new(menu);
e_menu_item_label_set(mi, _(... | false | false | false | false | false | 0 |
capwrite_dump(int capturefile,
GNetBuf *frame_buf,
int len,
struct sockaddr_ll *from,
struct timeval *curr_time)
{
struct pcaprec_hdr rec_hdr;
struct sll_header psd_hdr;
rec_hdr.ts_sec = curr_time->tv_sec;
rec_hdr.ts_usec = curr_time->tv_usec;
rec_hdr.orig_len = len + sizeof(psd_hdr);
rec_hdr.... | false | false | false | false | false | 0 |
move_down_clicked_callback (GtkWidget *button, gpointer user_data)
{
NemoColumnChooser *chooser;
GtkTreeIter iter;
GtkTreeSelection *selection;
chooser = NEMO_COLUMN_CHOOSER (user_data);
selection = gtk_tree_view_get_selection (chooser->details->view);
if (gtk_tree_selection_get_selected (selection, NULL, &i... | false | false | false | false | false | 0 |
UpdateRollLabel (void)
{
static GString *str = NULL;
if (!str)
str = g_string_sized_new (22);
g_string_printf (str, "<b>%s %d/3</b>", _("Roll"), NumberOfRolls);
gtk_label_set_label (GTK_LABEL (rollLabel), str->str);
update_score_tooltips ();
update_roll_button_sensitivity ();
update_undo_sensitivit... | false | false | false | false | false | 0 |
cert_DestroyGeneralNames(CERTGeneralName *name)
{
CERTGeneralName *first;
CERTGeneralName *next = NULL;
first = name;
do {
next = CERT_GetNextGeneralName(name);
PORT_Free(name);
name = next;
} while (name != first);
return SECSuccess;
} | false | false | false | false | false | 0 |
qat_uclo_wr_sram_by_words(struct icp_qat_fw_loader_handle *handle,
unsigned int addr, unsigned int *val,
unsigned int num_in_bytes)
{
unsigned int outval;
unsigned char *ptr = (unsigned char *)val;
while (num_in_bytes) {
memcpy(&outval, ptr, 4);
SRAM_WRITE(handle, addr, outval);
num_in_byt... | false | false | false | false | false | 0 |
__emit_lopc_memindex(struct buffer *buf,
int rex_w,
unsigned char *lopc,
size_t lopc_size,
unsigned char shift,
enum machine_reg index_reg,
enum machine_reg base_reg,
unsigned char reg_opcode)
{
int needs_disp;
unsigned char rex_pfx = 0, mod_rm, sib;
unsigned char __index_reg = x86... | false | false | false | false | false | 0 |
brasero_audio_disc_get_boundaries (BraseroDisc *disc,
gint64 *start,
gint64 *end)
{
BraseroTrack *track;
GtkTreeModel *model;
BraseroAudioDisc *audio;
audio = BRASERO_AUDIO_DISC (disc);
if (!audio->priv->selected_path)
return FALSE;
/* we are asked for just one uri so return the first one */
mo... | false | false | false | false | false | 0 |
read_header(IrmoPacket *packet)
{
char *sig;
unsigned int ver;
DEBUGMSG(("Read header\n"));
sig = irmo_packet_readstring(packet);
if (sig == NULL || strcmp(sig, HEADER_SIGNATURE) != 0) {
irmo_error_report("irmo_interface_load",
... | false | false | false | false | false | 0 |
init(void)
{
char *slurm_host=NULL;
uint16_t port=0;
struct sockaddr_in address;
int flags;
struct hostent *h;
if (mca_ras_slurm_component.dyn_alloc_enabled) {
if (NULL == mca_ras_slurm_component.config_file) {
orte_show_help("help-ras-slurm.txt", "dyn-alloc-no-config", true... | false | false | false | false | false | 0 |
daemon_become_user(uid_t uid, gid_t gid, char *user)
{
gid_t gids[10];
int g = 0;
if (setgroups(0, NULL) == -1 || (g = getgroups(0, NULL)) != 0)
{
/* FreeBSD always returns the primary group */
if (g != 1 || getgroups(10, gids) != 1 || gids[0] != getgid())
return -1;
}
if (setgid(gid) == -1 || getgid() ... | false | false | false | false | false | 0 |
ldif_read_rename_body(FILE *s,
GString *tmp1, GString *tmp2,
char *olddn,
int *deleteoldrdn)
{
char *newrdn;
char *dn;
int i;
if (ldif_read_line(s, tmp1, tmp2) == -1) return 0;
if (strcmp(tmp1->str, "newrdn")) {
fputs("Error: Expected 'newrdn'.\n", stderr);
return 0;
}
i = tmp2->len;... | false | false | false | false | false | 0 |
gdm_address_is_loopback (GdmAddress *address)
{
g_return_val_if_fail (address != NULL, FALSE);
g_return_val_if_fail (address->ss != NULL, FALSE);
switch (address->ss->ss_family){
#ifdef AF_INET6
case AF_INET6:
return IN6_IS_ADDR_LOOPBACK (&((struct sockaddr_in6 *)addres... | false | false | false | false | false | 0 |
i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
struct i40e_pf *pf = vsi->back;
struct i40e_mac_filter *f;
struct i40e_vf *vf;
int ret = 0;
/* validate the request */
if (vf_id >= pf->num_alloc_vfs) {
dev_... | false | false | false | false | false | 0 |
set_zone_directory(char *path)
{
zone_files_directory = malloc(strlen(path)+1);
if ( zone_files_directory != NULL )
{
strcpy(zone_files_directory,path);
}
} | false | true | false | false | false | 1 |
gtk_source_completion_words_buffer_dispose (GObject *object)
{
GtkSourceCompletionWordsBuffer *buffer =
GTK_SOURCE_COMPLETION_WORDS_BUFFER (object);
if (buffer->priv->words != NULL)
{
remove_all_words (buffer);
g_hash_table_destroy (buffer->priv->words);
buffer->priv->words = NULL;
}
if (buffer->priv->s... | false | false | false | false | false | 0 |
qh_memfree(void *object, int size) {
void **freelistp;
if (!object)
return;
if (size <= qhmem.LASTsize) {
qhmem .freeshort++;
freelistp= qhmem.freelists + qhmem.indextable[size];
*((void **)object)= *freelistp;
*freelistp= object;
}else {
qhmem .freelong++;
qhmem .totlong -= size;
... | false | false | false | false | true | 1 |
mix_to_16(int length, INT16 *dest_left, INT16 *dest_right)
{
INT32 *mixer_left = mixer_buffer_left;
INT32 *mixer_right = mixer_buffer_right;
int i, clippers = 0;
for (i = 0; i < length; i++)
{
INT32 sample_left = *mixer_left++;
INT32 sample_right = *mixer_right++;
if (sample_left < -32768) { sam... | false | false | false | false | false | 0 |
netsnmp_ds_set_string(int storeid, int which, const char *value)
{
if (storeid < 0 || storeid >= NETSNMP_DS_MAX_IDS ||
which < 0 || which >= NETSNMP_DS_MAX_SUBIDS) {
return SNMPERR_GENERR;
}
DEBUGMSGTL(("netsnmp_ds_set_string", "Setting %s:%d = \"%s\"\n",
stores[storeid], whic... | false | false | false | false | false | 0 |
solve_equations()
{
::status.lud.start();
_sim->_lu.lu_decomp(_sim->_aa, bool(OPT::lubypass && _sim->is_inc_mode()));
::status.lud.stop();
::status.back.start();
_sim->_lu.fbsub(_sim->_v0, _sim->_i, _sim->_v0);
::status.back.stop();
if (_sim->_nstat) {
// mixed mode
for (int ii = _sim->_lu.siz... | false | false | false | false | false | 0 |
evrpc_request_done(struct evrpc_req_generic* rpc_state)
{
struct evhttp_request *req = rpc_state->http_req;
struct evrpc *rpc = rpc_state->rpc;
struct evbuffer* data = NULL;
if (rpc->reply_complete(rpc_state->reply) == -1) {
/* the reply was not completely filled in. error out */
goto error;
}
if ((data = ... | false | false | false | false | false | 0 |
validate_uri (NautilusConnectServerDialog *dialog,
const char *uri,
GError **error)
{
gboolean valid = FALSE;
char *scheme;
scheme = g_uri_parse_scheme (uri);
if (scheme != NULL) {
valid = is_scheme_supported (dialog, scheme);
if (! valid) {
g_set_error_lit... | false | false | false | false | false | 0 |
L245()
{ object *old_base=vs_base;
fixnum x;
x=
XReadBitmapFile(
object_to_fixnum(vs_base[0]),
object_to_fixnum(vs_base[1]),
vs_base[2],
object_to_fixnum(vs_base[3]),
object_to_fixnum(vs_base[4]),
object_to_fixnum(vs_base[5]),
object_to_fixnum(vs_base[6]),
object_to_fixnum(vs_base[7]));
vs_top=(vs_base=old_... | false | false | false | false | false | 0 |
find_all_matches(HashTable *ht, const char *str, uint length,
uint *res_length)
{
Bucket *b;
b = completion_hash_find(ht,str,length);
if (!b) {
*res_length = 0;
return (Bucket*) 0;
} else {
*res_length = length;
return b;
}
} | false | false | false | false | false | 0 |
prev_win() {
client *c;
if(current != NULL && head != NULL) {
if(current->prev == NULL)
for(c=head;c->next;c=c->next);
else
c = current->prev;
current = c;
update_current();
}
} | false | false | false | false | false | 0 |
vocab_get_any_group_word(int group, word_t **words, int words_nr)
{
int i;
if (group == VOCAB_MAGIC_NUMBER_GROUP)
return "{number}";
for (i = 0; i < words_nr; i++)
if (words[i]->group == group)
return words[i]->word;
return "{invalid}";
} | false | false | false | false | false | 0 |
fm_nav_history_get_cur(FmNavHistory* nh)
{
return nh->cur ? (FmNavHistoryItem*)nh->cur->data : NULL;
} | false | false | false | false | false | 0 |
imapx_search_free (CamelFolder *folder,
GPtrArray *uids)
{
CamelIMAPXFolder *imapx_folder;
imapx_folder = CAMEL_IMAPX_FOLDER (folder);
g_return_if_fail (imapx_folder->search);
g_mutex_lock (&imapx_folder->search_lock);
camel_folder_search_free_result (imapx_folder->search, uids);
g_mutex_u... | false | false | false | false | false | 0 |
_main_img_preloaded_cb(void *data,
Evas *e __UNUSED__,
Evas_Object *o __UNUSED__,
void *event_info __UNUSED__)
{
Evas_Object *obj = data;
Elm_Phocam_Grid *g;
ELM_PHOTOCAM_DATA_GET(data, sd);
evas_object_show(sd->img);
sd->main_load_pe... | false | false | false | false | false | 0 |
onStreamingError( int error,
const QString& reason )
{
// This slot receives errors from not just the HttpInput, but also the
// ACThread and the output.
RadioError err = static_cast<RadioError>( error );
// These are the errors from the HttpInput on which we want to... | false | false | false | false | false | 0 |
hmac_md5_init(HMAC_MD5_CTX *hmac,
const unsigned char *key,
int key_len)
{
unsigned char k_ipad[65]; /* inner padding -
* key XORd with ipad
*/
unsigned char k_opad[65]; /* outer padding -
* key XORd with opad
*/
unsigned char tk[16];
int i;
/* if key is longer than 64 bytes re... | true | true | false | false | false | 1 |
GDALCloneTPSTransformer( void *hTransformArg )
{
VALIDATE_POINTER1( hTransformArg, "GDALCloneTPSTransformer", NULL );
TPSTransformInfo *psInfo =
(TPSTransformInfo *) hTransformArg;
/* We can just use a ref count, since using the source transformation */
/* is thread-safe */
CPLAtomicInc(&... | false | false | false | false | false | 0 |
hdpvr_free_queue(struct list_head *q)
{
struct list_head *tmp;
struct list_head *p;
struct hdpvr_buffer *buf;
struct urb *urb;
for (p = q->next; p != q;) {
buf = list_entry(p, struct hdpvr_buffer, buff_list);
urb = buf->urb;
usb_free_coherent(urb->dev, urb->transfer_buffer_length,
urb->transfer_buffe... | false | false | false | false | false | 0 |
op2string(int op)
{
LDAPDebug( LDAP_DEBUG_TRACE, "=> op2string\n", 0, 0, 0 );
LDAPDebug( LDAP_DEBUG_TRACE, "<= op2string\n", 0, 0, 0 );
switch (op) {
case SLAPI_OPERATION_ADD:
return "add";
case SLAPI_OPERATION_MODIFY:
return "modify";
case SLAPI_OPERATION_DELETE:
return "delete";
case SLAPI_OPERATION_MODR... | false | false | false | false | false | 0 |
try_chg_tononesc(void)
{
register char *chp;
register int32 len, ctval;
char s1[IDLEN];
chp = __token;
/* move past escape */
chp++;
for (len = 0; *chp != '\0'; chp++)
{
if ((ctval = __pv_ctab[*chp & 0x7f]) != 0)
{
if (ctval == 1 || ctval == 3)
{
/* if next is end of ID \0, then fo... | true | true | false | false | false | 1 |
lk_playlist_create(char * name)
{
playlist * pl;
uint32_t head;
pl=malloc(sizeof(playlist));
if(pl){
pl->name=strdup(name);
pl->playlist=malloc(4);
head=lk_htorl(767);
memcpy(pl->playlist, &head, 4);
pl->length=4;
pl->fid=0;
}
return pl;
} | false | false | false | false | false | 0 |
s5k5baf_load_setfile(struct s5k5baf *state)
{
struct i2c_client *c = v4l2_get_subdevdata(&state->sd);
const struct firmware *fw;
int ret;
ret = request_firmware(&fw, S5K5BAF_FW_FILENAME, &c->dev);
if (ret < 0) {
dev_warn(&c->dev, "firmware file (%s) not loaded\n",
S5K5BAF_FW_FILENAME);
return ret;
}
re... | false | false | false | false | false | 0 |
XLogNeedsFlush(XLogRecPtr record)
{
/* XLOG doesn't need flushing during recovery */
if (RecoveryInProgress())
return false;
/* Quick exit if already known flushed */
if (XLByteLE(record, LogwrtResult.Flush))
return false;
/* read LogwrtResult and update local state */
{
/* use volatile pointer to prevent... | false | false | false | false | false | 0 |
L17__STRINGIFY__tohtml()
{register object *base=vs_base;
register object *sup=base+VM17; VC17
vs_check;
{register object V74;
V74=(base[0]);
vs_top=sup;
goto TTL;
TTL:;
if(!(type_of((V74))==t_string)){
goto T836;}
base[1]= (V74);
vs_top=(vs_base=base+1)+1;
return;
goto T836;
T836:;
if(!(type_of((V74))==t_s... | false | false | false | false | false | 0 |
dcc_unthrottle (struct DCC *dcc)
{
/* don't unthrottle here, but delegate to funcs */
if (dcc->type == TYPE_RECV)
dcc_read (NULL, 0, dcc);
else
dcc_send_data (NULL, 0, dcc);
} | false | false | false | false | false | 0 |
init(gint *argc, gchar ***argv)
{
g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL);
bs_program_parse_args(argc, argv);
if (!bs_program_no_daemon())
bs_daemon_daemonize();
gtk_init(argc, argv);
bs_session_init(bs_program_name(), bs_program_client_id());
bs_configuration_init();
bs_setting... | false | false | false | false | false | 0 |
get_child_count(gContainer *ct)
{
int i;
int n = 0;
for (i = 0; i < ct->childCount(); i++)
{
if (ct->child(i)->hFree)
n++;
}
return n;
} | false | false | false | false | false | 0 |
limit_sysconf(int limit)
{
long value;
if ((value = sysconf(g.conf[limit].name)) == -1)
return g.conf[limit].value;
return value;
} | false | false | false | false | false | 0 |
SMIME_crlf_copy(BIO *in, BIO *out, int flags)
{
BIO *bf;
char eol;
int len;
char linebuf[MAX_SMLEN];
/* Buffer output so we don't write one line at a time. This is
* useful when streaming as we don't end up with one OCTET STRING
* per line.
*/
bf = BIO_new(BIO_f_buffer());
if (!bf)
return 0;
out = BIO_p... | true | true | false | false | false | 1 |
fill_input_buf(RECSTREAM *rstrm)
{
register caddr_t where;
u_int i;
register int len;
where = rstrm->in_base;
i = (u_int)((u_long)rstrm->in_boundry % BYTES_PER_XDR_UNIT);
where += i;
len = rstrm->in_size - i;
if ((len = (*(rstrm->readit))(rstrm->tcp_handle, where, len)) == -1)
return (FALSE);
rstrm->in_fing... | false | false | false | false | false | 0 |
xgbe_alloc_pages(struct xgbe_prv_data *pdata,
struct xgbe_page_alloc *pa, gfp_t gfp, int order)
{
struct page *pages = NULL;
dma_addr_t pages_dma;
int ret;
/* Try to obtain pages, decreasing order if necessary */
gfp |= __GFP_COLD | __GFP_COMP | __GFP_NOWARN;
while (order >= 0) {
pages = alloc_pages(gfp... | false | false | false | false | false | 0 |
pysqlite_adapt(pysqlite_Cursor *self, PyObject *args)
{
PyObject *obj, *alt = NULL;
PyObject *proto = (PyObject*)&pysqlite_PrepareProtocolType;
if (!PyArg_ParseTuple(args, "O|OO", &obj, &proto, &alt)) return NULL;
return pysqlite_microprotocols_adapt(obj, proto, alt);
} | false | false | false | false | false | 0 |
gnc_date_cell_set_value_secs (DateCell *cell, time64 secs)
{
PopBox *box = cell->cell.gui_private;
char buff[DATE_BUF];
gnc_localtime_r (&secs, &(box->date));
qof_print_date_dmy_buff (buff, MAX_DATE_LENGTH,
box->date.tm_mday,
box->date.tm_mon +... | false | false | false | false | false | 0 |
ois_decode_submit_sm_result(int *code, const char *str)
{
int buflen;
char raw[BUFLEN];
int len;
SAY(3, "ois_decode_submit_sm_result");
buflen = strlen(str) - 1;
if (buflen < 7 || str[0] != 's' || str[1] != 0x50 || str[buflen] != EOL) {
goto error;
}
len = ois_convert_from_ia5(raw, &... | false | false | false | false | false | 0 |
change_control_char(c, flag)
int c, flag;
{
c &= 0377;
if (flag)
chardef[c] |= IS_CONTROL_CHAR;
else
chardef[c] &= ~IS_CONTROL_CHAR;
} | false | false | false | false | false | 0 |
pcap_list_tstamp_types(pcap_t *p, int **tstamp_typesp)
{
if (p->tstamp_type_count == 0) {
/*
* We don't support multiple time stamp types.
*/
*tstamp_typesp = NULL;
} else {
*tstamp_typesp = (int*)calloc(sizeof(**tstamp_typesp),
p->tstamp_type_count);
if (*tstamp_typesp == NULL) {
(void)snprint... | false | false | false | false | false | 0 |
gretl_loop_append_line (ExecState *s, DATASET *dset)
{
LOOPSET *loop = currloop;
LOOPSET *newloop = currloop;
int err = 0;
gretl_error_clear();
#if LOOP_DEBUG > 1
fprintf(stderr, "gretl_loop_append_line: currloop = %p, line = '%s'\n",
(void *) loop, s->line);
#endif
if (!ok_in_loop(s->c... | false | false | false | false | false | 0 |
ublkdel(BW *bw)
{
if (markv(1)) {
if (square)
if (bw->o.overtype) {
long ocol = markk->xcol;
pclrrect(markb, markk->line - markb->line + 1, markk->xcol, ptabrect(markb, markk->line - markb->line + 1, markk->xcol));
pcol(markk, ocol);
markk->xcol = ocol;
} else
pdelrect(markb, markk->line -... | false | false | false | false | false | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.