hexsha
stringlengths
40
40
size
int64
5
1.05M
ext
stringclasses
588 values
lang
stringclasses
305 values
max_stars_repo_path
stringlengths
3
363
max_stars_repo_name
stringlengths
5
118
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
10
max_stars_count
float64
1
191k
max_stars_repo_stars_event_min_datetime
stringdate
2015-01-01 00:00:35
2022-03-31 23:43:49
max_stars_repo_stars_event_max_datetime
stringdate
2015-01-01 12:37:38
2022-03-31 23:59:52
max_issues_repo_path
stringlengths
3
363
max_issues_repo_name
stringlengths
5
118
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
10
max_issues_count
float64
1
134k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
3
363
max_forks_repo_name
stringlengths
5
135
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
10
max_forks_count
float64
1
105k
max_forks_repo_forks_event_min_datetime
stringdate
2015-01-01 00:01:02
2022-03-31 23:27:27
max_forks_repo_forks_event_max_datetime
stringdate
2015-01-03 08:55:07
2022-03-31 23:59:24
content
stringlengths
5
1.05M
avg_line_length
float64
1.13
1.04M
max_line_length
int64
1
1.05M
alphanum_fraction
float64
0
1
6a8fabf619c6e8dc5fcfb1eddf05e42b2801068f
2,078
h
C
ClientDemo/DlgPosFilterEffect.h
xiaocaovc/hkvs
569c57b03adf5723ccc1df0de6c96858062d23e1
[ "MIT" ]
2
2017-09-05T07:01:13.000Z
2019-07-16T17:18:28.000Z
ClientDemo/DlgPosFilterEffect.h
xiaocaovc/hkvs
569c57b03adf5723ccc1df0de6c96858062d23e1
[ "MIT" ]
null
null
null
ClientDemo/DlgPosFilterEffect.h
xiaocaovc/hkvs
569c57b03adf5723ccc1df0de6c96858062d23e1
[ "MIT" ]
3
2019-08-26T02:28:54.000Z
2020-11-04T04:29:19.000Z
#if !defined(AFX_DLGPOSFILTEREFFECT_H__6E68E89D_3BFA_4F50_9795_47A321151021__INCLUDED_) #define AFX_DLGPOSFILTEREFFECT_H__6E68E89D_3BFA_4F50_9795_47A321151021__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // DlgPosFilterEffect.h : header file // ///////////////////////////////////////////////////////////////////////////// // CDlgPosFilterEffect dialog #define MSG_PULL_TEST_EFFECT_RECEIVEDATA_SHOW WM_USER + 1007 class CDlgPosFilterEffect : public CDialog { // Construction public: CDlgPosFilterEffect(CWnd* pParent = NULL); // standard constructor // Dialog Data //{{AFX_DATA(CDlgPosFilterEffect) enum { IDD = IDD_DLG_POS_FILTER_EFFECT }; short m_wPort; CString m_csRecvData; CString m_csFilterData; //}}AFX_DATA // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDlgPosFilterEffect) protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support //}}AFX_VIRTUAL // Implementation protected: // Generated message map functions //{{AFX_MSG(CDlgPosFilterEffect) afx_msg void OnBtnStartRecvdata(); afx_msg void OnClose(); //}}AFX_MSG DECLARE_MESSAGE_MAP() LRESULT OnChangeEffectDataShow(WPARAM wParam, LPARAM lParam); public: void StartNetNakedDataListen(); void StopNetNakedDataListen(); CString GenericIgnoreStringInfo(CString strData); CString GenericEndStringInfo(CString strData); CString GenericNewLineInfo(CString strData); bool ParseHexString(char *strHex, int &nLen); char ConvertHexToChar(char *strHex, int nLen); int GetHexNumber(int n); public: // critical section CRITICAL_SECTION m_stDataCritiacl; NET_DVR_POS_FILTER_CFG m_struFilterCfg; NET_DVR_NAKED_DATA_PARAM m_struNakedDataParam; LONG m_lUserId; LONG m_lStartListenHandle; DWORD m_dwTheFilterNum; // the num of select BOOL m_bStartListen; int m_iDevIndex; }; //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DLGPOSFILTEREFFECT_H__6E68E89D_3BFA_4F50_9795_47A321151021__INCLUDED_)
26.987013
97
0.771415
6a0949b293eeb8ca13df0efd1c8e3a9124b0e821
1,176
h
C
tc/size_linear.h
badearobert/range
ddec92e44df8a8f9f021a03d3f92ec4b091f19de
[ "BSL-1.0" ]
null
null
null
tc/size_linear.h
badearobert/range
ddec92e44df8a8f9f021a03d3f92ec4b091f19de
[ "BSL-1.0" ]
null
null
null
tc/size_linear.h
badearobert/range
ddec92e44df8a8f9f021a03d3f92ec4b091f19de
[ "BSL-1.0" ]
null
null
null
// think-cell public library // // Copyright (C) 2016-2019 think-cell Software GmbH // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt #pragma once #include "range_defines.h" #include "size.h" #include "for_each.h" namespace tc { template<typename Rng, std::enable_if_t<!tc::has_size<Rng const>::value && tc::is_range_with_iterators<Rng const>::value>* =nullptr> auto size_linear_raw(Rng const& rng) noexcept return_decltype( boost::distance(rng) ) template<typename Rng, std::enable_if_t<!tc::has_size<Rng const>::value && !tc::is_range_with_iterators<Rng const>::value>* =nullptr> std::size_t size_linear_raw(Rng const& rng) noexcept { std::size_t sz=0; tc::for_each(rng, [&sz](auto&&...) noexcept {++sz;}); return sz; } template<typename Rng, std::enable_if_t<tc::has_size<Rng const>::value>* =nullptr> constexpr auto size_linear_raw(Rng const& rng) noexcept return_decltype( tc::size_raw(rng) ) template<typename T> constexpr auto size_linear(T&& t) noexcept return_decltype( make_size_proxy(tc::size_linear_raw(std::forward<T>(t))) ) }
30.153846
134
0.731293
acb68c69836389832475c474a506a548d2ac9903
1,054
h
C
linux/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
WUSTL-CSPL/RT-TEE
aafb3e9ff6c6e744c6bce1e42bcb198e1063efcc
[ "MIT" ]
3
2020-11-06T05:17:03.000Z
2020-11-06T07:32:34.000Z
linux/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
WUSTL-CSPL/RT-TEE
aafb3e9ff6c6e744c6bce1e42bcb198e1063efcc
[ "MIT" ]
null
null
null
linux/drivers/gpu/drm/etnaviv/etnaviv_cmdbuf.h
WUSTL-CSPL/RT-TEE
aafb3e9ff6c6e744c6bce1e42bcb198e1063efcc
[ "MIT" ]
1
2020-11-06T07:32:55.000Z
2020-11-06T07:32:55.000Z
/* SPDX-License-Identifier: GPL-2.0 */ /* * Copyright (C) 2017 Etnaviv Project */ #ifndef __ETNAVIV_CMDBUF_H__ #define __ETNAVIV_CMDBUF_H__ #include <linux/types.h> struct etnaviv_gpu; struct etnaviv_cmdbuf_suballoc; struct etnaviv_perfmon_request; struct etnaviv_cmdbuf { /* suballocator this cmdbuf is allocated from */ struct etnaviv_cmdbuf_suballoc *suballoc; /* user context key, must be unique between all active users */ struct etnaviv_file_private *ctx; /* cmdbuf properties */ int suballoc_offset; void *vaddr; u32 size; u32 user_size; }; struct etnaviv_cmdbuf_suballoc * etnaviv_cmdbuf_suballoc_new(struct etnaviv_gpu * gpu); void etnaviv_cmdbuf_suballoc_destroy(struct etnaviv_cmdbuf_suballoc *suballoc); int etnaviv_cmdbuf_init(struct etnaviv_cmdbuf_suballoc *suballoc, struct etnaviv_cmdbuf *cmdbuf, u32 size); void etnaviv_cmdbuf_free(struct etnaviv_cmdbuf *cmdbuf); u32 etnaviv_cmdbuf_get_va(struct etnaviv_cmdbuf *buf); dma_addr_t etnaviv_cmdbuf_get_pa(struct etnaviv_cmdbuf *buf); #endif /* __ETNAVIV_CMDBUF_H__ */
26.35
79
0.802657
acc172099ed867c892db093c7cb189a3ca03ca96
23,201
c
C
lib/ipmi_sunoem.c
ystk/debian-ipmitool
013077feb9a87c44a94301d6da9c3661132d8537
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
null
null
null
lib/ipmi_sunoem.c
ystk/debian-ipmitool
013077feb9a87c44a94301d6da9c3661132d8537
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
null
null
null
lib/ipmi_sunoem.c
ystk/debian-ipmitool
013077feb9a87c44a94301d6da9c3661132d8537
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
null
null
null
/* * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistribution of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistribution in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of Sun Microsystems, Inc. or the names of * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * This software is provided "AS IS," without a warranty of any kind. * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. * SUN MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE * FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING * OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL * SUN OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, * OR FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR * PUNITIVE DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF * LIABILITY, ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, * EVEN IF SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. */ #include <stdlib.h> #include <stdio.h> #include <string.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <arpa/inet.h> #include <errno.h> #include <unistd.h> #include <signal.h> #include <ctype.h> #include <ipmitool/ipmi.h> #include <ipmitool/ipmi_intf.h> #include <ipmitool/helper.h> #include <ipmitool/log.h> #include <ipmitool/ipmi_sel.h> #include <ipmitool/ipmi_sdr.h> #include <ipmitool/ipmi_strings.h> #include <ipmitool/ipmi_channel.h> #include <ipmitool/ipmi_sunoem.h> #include <ipmitool/ipmi_raw.h> static const struct valstr sunoem_led_type_vals[] = { { 0, "OK2RM" }, { 1, "SERVICE" }, { 2, "ACT" }, { 3, "LOCATE" }, { 0xFF, NULL }, }; static const struct valstr sunoem_led_mode_vals[] = { { 0, "OFF" }, { 1, "ON" }, { 2, "STANDBY" }, { 3, "SLOW" }, { 4, "FAST" }, { 0xFF, NULL }, }; static const struct valstr sunoem_led_mode_optvals[] = { { 0, "STEADY_OFF" }, { 1, "STEADY_ON" }, { 2, "STANDBY_BLINK" }, { 3, "SLOW_BLINK" }, { 4, "FAST_BLINK" }, { 0xFF, NULL }, }; int is_sbcmd = 0; static void ipmi_sunoem_usage(void) { lprintf(LOG_NOTICE, "usage: sunoem <command> [option...]"); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " fan speed <0-100>"); lprintf(LOG_NOTICE, " Set system fan speed (PWM duty cycle)"); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " sshkey set <userid> <id_rsa.pub>"); lprintf(LOG_NOTICE, " Set ssh key for a userid into authorized_keys,"); lprintf(LOG_NOTICE, " view users with 'user list' command."); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " sshkey del <userid>"); lprintf(LOG_NOTICE, " Delete ssh key for userid from authorized_keys,"); lprintf(LOG_NOTICE, " view users with 'user list' command."); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " led get <sensorid> [ledtype]"); lprintf(LOG_NOTICE, " Read status of LED found in Generic Device Locator."); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " led set <sensorid> <ledmode> [ledtype]"); lprintf(LOG_NOTICE, " Set mode of LED found in Generic Device Locator."); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " sbled get <sensorid> [ledtype]"); lprintf(LOG_NOTICE, " Read status of LED found in Generic Device Locator"); lprintf(LOG_NOTICE, " for Sun Blade Modular Systems."); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " sbled set <sensorid> <ledmode> [ledtype]"); lprintf(LOG_NOTICE, " Set mode of LED found in Generic Device Locator"); lprintf(LOG_NOTICE, " for Sun Blade Modular Systems."); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " Use 'sdr list generic' command to get list of Generic"); lprintf(LOG_NOTICE, " Devices that are controllable LEDs."); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " Required SIS LED Mode:"); lprintf(LOG_NOTICE, " OFF Off"); lprintf(LOG_NOTICE, " ON Steady On"); lprintf(LOG_NOTICE, " STANDBY 100ms on 2900ms off blink rate"); lprintf(LOG_NOTICE, " SLOW 1HZ blink rate"); lprintf(LOG_NOTICE, " FAST 4HZ blink rate"); lprintf(LOG_NOTICE, ""); lprintf(LOG_NOTICE, " Optional SIS LED Type:"); lprintf(LOG_NOTICE, " OK2RM OK to Remove"); lprintf(LOG_NOTICE, " SERVICE Service Required"); lprintf(LOG_NOTICE, " ACT Activity"); lprintf(LOG_NOTICE, " LOCATE Locate"); lprintf(LOG_NOTICE, ""); } /* * IPMI Request Data: 1 byte * * [byte 0] FanSpeed Fan speed as percentage */ static int ipmi_sunoem_fan_speed(struct ipmi_intf * intf, uint8_t speed) { struct ipmi_rs * rsp; struct ipmi_rq req; /* * sunoem fan speed <percent> */ if (speed > 100) { lprintf(LOG_NOTICE, "Invalid fan speed: %d", speed); return -1; } req.msg.netfn = IPMI_NETFN_SUNOEM; req.msg.cmd = IPMI_SUNOEM_SET_FAN_SPEED; req.msg.data = &speed; req.msg.data_len = 1; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { lprintf(LOG_ERR, "Sun OEM Set Fan Speed command failed"); return -1; } else if (rsp->ccode > 0) { lprintf(LOG_ERR, "Sun OEM Set Fan Speed command failed: %s", val2str(rsp->ccode, completion_code_vals)); return -1; } printf("Set Fan speed to %d%%\n", speed); return 0; } static void __sdr_list_empty(struct sdr_record_list * head) { struct sdr_record_list * e, * f; for (e = head; e != NULL; e = f) { f = e->next; free(e); } head = NULL; } static void led_print(const char * name, uint8_t state) { if (csv_output) printf("%s,%s\n", name, val2str(state, sunoem_led_mode_vals)); else printf("%-16s | %s\n", name, val2str(state, sunoem_led_mode_vals)); } struct ipmi_rs * sunoem_led_get(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype) { struct ipmi_rs * rsp; struct ipmi_rq req; uint8_t rqdata[7]; int rqdata_len = 5; if (dev == NULL) return NULL; rqdata[0] = dev->dev_slave_addr; if (ledtype == 0xFF) rqdata[1] = dev->oem; else rqdata[1] = ledtype; rqdata[2] = dev->dev_access_addr; rqdata[3] = dev->oem; if (is_sbcmd) { rqdata[4] = dev->entity.id; rqdata[5] = dev->entity.instance; rqdata[6] = 0; rqdata_len = 7; } else { rqdata[4] = 0; } req.msg.netfn = IPMI_NETFN_SUNOEM; req.msg.cmd = IPMI_SUNOEM_LED_GET; req.msg.lun = dev->lun; req.msg.data = rqdata; req.msg.data_len = rqdata_len; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { lprintf(LOG_ERR, "Sun OEM Get LED command failed"); return NULL; } else if (rsp->ccode > 0) { lprintf(LOG_ERR, "Sun OEM Get LED command failed: %s", val2str(rsp->ccode, completion_code_vals)); return NULL; } return rsp; } struct ipmi_rs * sunoem_led_set(struct ipmi_intf * intf, struct sdr_record_generic_locator * dev, int ledtype, int ledmode) { struct ipmi_rs * rsp; struct ipmi_rq req; uint8_t rqdata[9]; int rqdata_len = 7; if (dev == NULL) return NULL; rqdata[0] = dev->dev_slave_addr; if (ledtype == 0xFF) rqdata[1] = dev->oem; else rqdata[1] = ledtype; rqdata[2] = dev->dev_access_addr; rqdata[3] = dev->oem; rqdata[4] = ledmode; if (is_sbcmd) { rqdata[5] = dev->entity.id; rqdata[6] = dev->entity.instance; rqdata[7] = 0; rqdata[8] = 0; rqdata_len = 9; } else { rqdata[5] = 0; rqdata[6] = 0; } req.msg.netfn = IPMI_NETFN_SUNOEM; req.msg.cmd = IPMI_SUNOEM_LED_SET; req.msg.lun = dev->lun; req.msg.data = rqdata; req.msg.data_len = rqdata_len; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { lprintf(LOG_ERR, "Sun OEM Set LED command failed"); return NULL; } else if (rsp->ccode > 0) { lprintf(LOG_ERR, "Sun OEM Set LED command failed: %s", val2str(rsp->ccode, completion_code_vals)); return NULL; } return rsp; } static void sunoem_led_get_byentity(struct ipmi_intf * intf, uint8_t entity_id, uint8_t entity_inst, int ledtype) { struct ipmi_rs * rsp; struct sdr_record_list *elist, *e; struct entity_id entity; if (entity_id == 0) return; /* lookup sdrs with this entity */ memset(&entity, 0, sizeof(struct entity_id)); entity.id = entity_id; entity.instance = entity_inst; elist = ipmi_sdr_find_sdr_byentity(intf, &entity); /* for each generic sensor set its led state */ for (e = elist; e != NULL; e = e->next) { if (e->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) continue; rsp = sunoem_led_get(intf, e->record.genloc, ledtype); if (rsp && rsp->data_len == 1) { led_print((const char *)e->record.genloc->id_string, rsp->data[0]); } } __sdr_list_empty(elist); } static void sunoem_led_set_byentity(struct ipmi_intf * intf, uint8_t entity_id, uint8_t entity_inst, int ledtype, int ledmode) { struct ipmi_rs * rsp; struct sdr_record_list *elist, *e; struct entity_id entity; if (entity_id == 0) return; /* lookup sdrs with this entity */ memset(&entity, 0, sizeof(struct entity_id)); entity.id = entity_id; entity.instance = entity_inst; elist = ipmi_sdr_find_sdr_byentity(intf, &entity); /* for each generic sensor set its led state */ for (e = elist; e != NULL; e = e->next) { if (e->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) continue; rsp = sunoem_led_set(intf, e->record.genloc, ledtype, ledmode); if (rsp && rsp->data_len == 0) { led_print((const char *)e->record.genloc->id_string, ledmode); } } __sdr_list_empty(elist); } /* * IPMI Request Data: 5 bytes * * [byte 0] devAddr Value from the "Device Slave Address" field in * LED's Generic Device Locator record in the SDR * [byte 1] led LED Type: OK2RM, ACT, LOCATE, SERVICE * [byte 2] ctrlrAddr Controller address; value from the "Device * Access Address" field, 0x20 if the LED is local * [byte 3] hwInfo The OEM field from the SDR record * [byte 4] force 1 = directly access the device * 0 = go thru its controller * Ignored if LED is local * * The format below is for Sun Blade Modular systems only * [byte 4] entityID The entityID field from the SDR record * [byte 5] entityIns The entityIns field from the SDR record * [byte 6] force 1 = directly access the device * 0 = go thru its controller * Ignored if LED is local */ static int ipmi_sunoem_led_get(struct ipmi_intf * intf, int argc, char ** argv) { struct ipmi_rs * rsp; struct sdr_record_list *sdr; struct sdr_record_list *alist, *a; struct sdr_record_entity_assoc *assoc; int ledtype = 0xFF; int i; /* * sunoem led/sbled get <id> [type] */ if (argc < 1 || strncmp(argv[0], "help", 4) == 0) { ipmi_sunoem_usage(); return 0; } if (argc > 1) { ledtype = str2val(argv[1], sunoem_led_type_vals); if (ledtype == 0xFF) lprintf(LOG_ERR, "Unknow ledtype, will use data from the SDR oem field"); } if (strncasecmp(argv[0], "all", 3) == 0) { /* do all generic sensors */ alist = ipmi_sdr_find_sdr_bytype(intf, SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR); for (a = alist; a != NULL; a = a->next) { if (a->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) continue; if (a->record.genloc->entity.logical) continue; rsp = sunoem_led_get(intf, a->record.genloc, ledtype); if (rsp && rsp->data_len == 1) { led_print((const char *)a->record.genloc->id_string, rsp->data[0]); } } __sdr_list_empty(alist); return 0; } /* look up generic device locator record in SDR */ sdr = ipmi_sdr_find_sdr_byid(intf, argv[0]); if (sdr == NULL) { lprintf(LOG_ERR, "No Sensor Data Record found for %s", argv[0]); return -1; } if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) { lprintf(LOG_ERR, "Invalid SDR type %d", sdr->type); return -1; } if (!sdr->record.genloc->entity.logical) { /* * handle physical entity */ rsp = sunoem_led_get(intf, sdr->record.genloc, ledtype); if (rsp && rsp->data_len == 1) { led_print((const char *)sdr->record.genloc->id_string, rsp->data[0]); } return 0; } /* * handle logical entity for LED grouping */ lprintf(LOG_INFO, "LED %s is logical device", argv[0]); /* get entity assoc records */ alist = ipmi_sdr_find_sdr_bytype(intf, SDR_RECORD_TYPE_ENTITY_ASSOC); for (a = alist; a != NULL; a = a->next) { if (a->type != SDR_RECORD_TYPE_ENTITY_ASSOC) continue; assoc = a->record.entassoc; if (assoc == NULL) continue; /* check that the entity id/instance matches our generic record */ if (assoc->entity.id != sdr->record.genloc->entity.id || assoc->entity.instance != sdr->record.genloc->entity.instance) continue; if (assoc->flags.isrange) { /* * handle ranged entity associations * * the test for non-zero entity id is handled in * sunoem_led_get_byentity() */ /* first range set - id 1 and 2 must be equal */ if (assoc->entity_id_1 == assoc->entity_id_2) for (i = assoc->entity_inst_1; i <= assoc->entity_inst_2; i++) sunoem_led_get_byentity(intf, assoc->entity_id_1, i, ledtype); /* second range set - id 3 and 4 must be equal */ if (assoc->entity_id_3 == assoc->entity_id_4) for (i = assoc->entity_inst_3; i <= assoc->entity_inst_4; i++) sunoem_led_get_byentity(intf, assoc->entity_id_3, i, ledtype); } else { /* * handle entity list */ sunoem_led_get_byentity(intf, assoc->entity_id_1, assoc->entity_inst_1, ledtype); sunoem_led_get_byentity(intf, assoc->entity_id_2, assoc->entity_inst_2, ledtype); sunoem_led_get_byentity(intf, assoc->entity_id_3, assoc->entity_inst_3, ledtype); sunoem_led_get_byentity(intf, assoc->entity_id_4, assoc->entity_inst_4, ledtype); } } __sdr_list_empty(alist); return 0; } /* * IPMI Request Data: 7 bytes * * [byte 0] devAddr Value from the "Device Slave Address" field in * LED's Generic Device Locator record in the SDR * [byte 1] led LED Type: OK2RM, ACT, LOCATE, SERVICE * [byte 2] ctrlrAddr Controller address; value from the "Device * Access Address" field, 0x20 if the LED is local * [byte 3] hwInfo The OEM field from the SDR record * [byte 4] mode LED Mode: OFF, ON, STANDBY, SLOW, FAST * [byte 5] force TRUE - directly access the device * FALSE - go thru its controller * Ignored if LED is local * [byte 6] role Used by BMC for authorization purposes * * The format below is for Sun Blade Modular systems only * [byte 5] entityID The entityID field from the SDR record * [byte 6] entityIns The entityIns field from the SDR record * [byte 7] force TRUE - directly access the device * FALSE - go thru its controller * Ignored if LED is local * [byte 8] role Used by BMC for authorization purposes * * * IPMI Response Data: 1 byte * * [byte 0] mode LED Mode: OFF, ON, STANDBY, SLOW, FAST */ static int ipmi_sunoem_led_set(struct ipmi_intf * intf, int argc, char ** argv) { struct ipmi_rs * rsp; struct sdr_record_list *sdr; struct sdr_record_list *alist, *a; struct sdr_record_entity_assoc *assoc; int ledmode; int ledtype = 0xFF; int i; /* * sunoem led/sbled set <id> <mode> [type] */ if (argc < 2 || strncmp(argv[0], "help", 4) == 0) { ipmi_sunoem_usage(); return 0; } ledmode = str2val(argv[1], sunoem_led_mode_vals); if (ledmode == 0xFF) { ledmode = str2val(argv[1], sunoem_led_mode_optvals); if (ledmode == 0xFF) { lprintf(LOG_NOTICE, "Invalid LED Mode: %s", argv[1]); return -1; } } if (argc > 3) { ledtype = str2val(argv[2], sunoem_led_type_vals); if (ledtype == 0xFF) lprintf(LOG_ERR, "Unknow ledtype, will use data from the SDR oem field"); } if (strncasecmp(argv[0], "all", 3) == 0) { /* do all generic sensors */ alist = ipmi_sdr_find_sdr_bytype(intf, SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR); for (a = alist; a != NULL; a = a->next) { if (a->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) continue; if (a->record.genloc->entity.logical) continue; rsp = sunoem_led_set(intf, a->record.genloc, ledtype, ledmode); if (rsp && rsp->ccode == 0) { led_print((const char *)a->record.genloc->id_string, ledmode); } } __sdr_list_empty(alist); return 0; } /* look up generic device locator records in SDR */ sdr = ipmi_sdr_find_sdr_byid(intf, argv[0]); if (sdr == NULL) { lprintf(LOG_ERR, "No Sensor Data Record found for %s", argv[0]); return -1; } if (sdr->type != SDR_RECORD_TYPE_GENERIC_DEVICE_LOCATOR) { lprintf(LOG_ERR, "Invalid SDR type %d", sdr->type); return -1; } if (!sdr->record.genloc->entity.logical) { /* * handle physical entity */ rsp = sunoem_led_set(intf, sdr->record.genloc, ledtype, ledmode); if (rsp && rsp->ccode == 0) { led_print(argv[0], ledmode); } return 0; } /* * handle logical entity for LED grouping */ lprintf(LOG_INFO, "LED %s is logical device", argv[0]); /* get entity assoc records */ alist = ipmi_sdr_find_sdr_bytype(intf, SDR_RECORD_TYPE_ENTITY_ASSOC); for (a = alist; a != NULL; a = a->next) { if (a->type != SDR_RECORD_TYPE_ENTITY_ASSOC) continue; assoc = a->record.entassoc; if (assoc == NULL) continue; /* check that the entity id/instance matches our generic record */ if (assoc->entity.id != sdr->record.genloc->entity.id || assoc->entity.instance != sdr->record.genloc->entity.instance) continue; if (assoc->flags.isrange) { /* * handle ranged entity associations * * the test for non-zero entity id is handled in * sunoem_led_get_byentity() */ /* first range set - id 1 and 2 must be equal */ if (assoc->entity_id_1 == assoc->entity_id_2) for (i = assoc->entity_inst_1; i <= assoc->entity_inst_2; i++) sunoem_led_set_byentity(intf, assoc->entity_id_1, i, ledtype, ledmode); /* second range set - id 3 and 4 must be equal */ if (assoc->entity_id_3 == assoc->entity_id_4) for (i = assoc->entity_inst_3; i <= assoc->entity_inst_4; i++) sunoem_led_set_byentity(intf, assoc->entity_id_3, i, ledtype, ledmode); } else { /* * handle entity list */ sunoem_led_set_byentity(intf, assoc->entity_id_1, assoc->entity_inst_1, ledtype, ledmode); sunoem_led_set_byentity(intf, assoc->entity_id_2, assoc->entity_inst_2, ledtype, ledmode); sunoem_led_set_byentity(intf, assoc->entity_id_3, assoc->entity_inst_3, ledtype, ledmode); sunoem_led_set_byentity(intf, assoc->entity_id_4, assoc->entity_inst_4, ledtype, ledmode); } } __sdr_list_empty(alist); return 0; } static int ipmi_sunoem_sshkey_del(struct ipmi_intf * intf, uint8_t uid) { struct ipmi_rs * rsp; struct ipmi_rq req; memset(&req, 0, sizeof(struct ipmi_rq)); req.msg.netfn = IPMI_NETFN_SUNOEM; req.msg.cmd = IPMI_SUNOEM_DEL_SSH_KEY; req.msg.data = &uid; req.msg.data_len = 1; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { lprintf(LOG_ERR, "Unable to delete ssh key for UID %d", uid); return -1; } else if (rsp->ccode > 0) { lprintf(LOG_ERR, "Unable to delete ssh key for UID %d: %s", uid, val2str(rsp->ccode, completion_code_vals)); return -1; } printf("Deleted SSH key for user id %d\n", uid); return 0; } #define SSHKEY_BLOCK_SIZE 64 static int ipmi_sunoem_sshkey_set(struct ipmi_intf * intf, uint8_t uid, char * ifile) { struct ipmi_rs * rsp; struct ipmi_rq req; FILE * fp; int count; uint16_t i_size, r, size; uint8_t wbuf[SSHKEY_BLOCK_SIZE + 3]; if (ifile == NULL) { lprintf(LOG_ERR, "Invalid or misisng input filename"); return -1; } fp = ipmi_open_file_read(ifile); if (fp == NULL) { lprintf(LOG_ERR, "Unable to open file %s for reading", ifile); return -1; } printf("Setting SSH key for user id %d...", uid); memset(&req, 0, sizeof(struct ipmi_rq)); req.msg.netfn = IPMI_NETFN_SUNOEM; req.msg.cmd = IPMI_SUNOEM_SET_SSH_KEY; req.msg.data = wbuf; fseek(fp, 0, SEEK_END); size = ftell(fp); fseek(fp, 0, SEEK_SET); for (r = 0; r < size; r += i_size) { i_size = size - r; if (i_size > SSHKEY_BLOCK_SIZE) i_size = SSHKEY_BLOCK_SIZE; memset(wbuf, 0, SSHKEY_BLOCK_SIZE); fseek(fp, r, SEEK_SET); count = fread(wbuf+3, 1, i_size, fp); if (count != i_size) { lprintf(LOG_ERR, "Unable to read %d bytes from file %s", i_size, ifile); fclose(fp); return -1; } printf("."); fflush(stdout); wbuf[0] = uid; if ((r + SSHKEY_BLOCK_SIZE) >= size) wbuf[1] = 0xff; else wbuf[1] = (uint8_t)(r / SSHKEY_BLOCK_SIZE); wbuf[2] = i_size; req.msg.data_len = i_size + 3; rsp = intf->sendrecv(intf, &req); if (rsp == NULL) { lprintf(LOG_ERR, "Unable to set ssh key for UID %d", uid); break; } } printf("done\n"); fclose(fp); return 0; } int ipmi_sunoem_main(struct ipmi_intf * intf, int argc, char ** argv) { int rc = 0; if (argc == 0 || strncmp(argv[0], "help", 4) == 0) { ipmi_sunoem_usage(); return 0; } if (strncmp(argv[0], "fan", 3) == 0) { uint8_t pct; if (argc < 2) { ipmi_sunoem_usage(); return -1; } else if (strncmp(argv[1], "speed", 5) == 0) { if (argc < 3) { ipmi_sunoem_usage(); return -1; } pct = (uint8_t)strtol(argv[2], NULL, 0); rc = ipmi_sunoem_fan_speed(intf, pct); } else { ipmi_sunoem_usage(); return -1; } } if ((strncmp(argv[0], "led", 3) == 0) || (strncmp(argv[0], "sbled", 5) == 0)) { if (argc < 2) { ipmi_sunoem_usage(); return -1; } if (strncmp(argv[0], "sbled", 5) == 0) { is_sbcmd = 1; } if (strncmp(argv[1], "get", 3) == 0) { if (argc < 3) { char * arg[] = { "all" }; rc = ipmi_sunoem_led_get(intf, 1, arg); } else { rc = ipmi_sunoem_led_get(intf, argc-2, &(argv[2])); } } else if (strncmp(argv[1], "set", 3) == 0) { if (argc < 4) { ipmi_sunoem_usage(); return -1; } rc = ipmi_sunoem_led_set(intf, argc-2, &(argv[2])); } else { ipmi_sunoem_usage(); return -1; } } if (strncmp(argv[0], "sshkey", 6) == 0) { if (argc < 2) { ipmi_sunoem_usage(); return -1; } else if (strncmp(argv[1], "del", 3) == 0) { uint8_t uid; if (argc < 3) { ipmi_sunoem_usage(); return -1; } uid = (uint8_t)strtoul(argv[2], NULL, 0); rc = ipmi_sunoem_sshkey_del(intf, uid); } else if (strncmp(argv[1], "set", 3) == 0) { uint8_t uid; if (argc < 4) { ipmi_sunoem_usage(); return -1; } uid = (uint8_t)strtoul(argv[2], NULL, 0); rc = ipmi_sunoem_sshkey_set(intf, uid, argv[3]); } } return rc; }
27.295294
84
0.650274
6bb26ac15d9accd4ee940e8b551c4583c8d63677
1,135
c
C
src/murmur_hash.c
ysmgigi/dbss
c6c00c4990a00514e158d1b10bc5cf38743fd2cc
[ "Apache-2.0" ]
null
null
null
src/murmur_hash.c
ysmgigi/dbss
c6c00c4990a00514e158d1b10bc5cf38743fd2cc
[ "Apache-2.0" ]
null
null
null
src/murmur_hash.c
ysmgigi/dbss
c6c00c4990a00514e158d1b10bc5cf38743fd2cc
[ "Apache-2.0" ]
null
null
null
#include "murmur_hash.h" #define ROT32(x, y) ((x << y) | (x >> (32 - y))) // avoid effort uint32_t murmur3_32(const char *key, uint32_t len, uint32_t seed) { static const uint32_t c1 = 0xcc9e2d51; static const uint32_t c2 = 0x1b873593; static const uint32_t r1 = 15; static const uint32_t r2 = 13; static const uint32_t m = 5; static const uint32_t n = 0xe6546b64; uint32_t hash = seed; const int nblocks = len / 4; const uint32_t *blocks = (const uint32_t *) key; int i; uint32_t k; for (i = 0; i < nblocks; i++) { k = blocks[i]; k *= c1; k = ROT32(k, r1); k *= c2; hash ^= k; hash = ROT32(hash, r2) * m + n; } const uint8_t *tail = (const uint8_t *) (key + nblocks * 4); uint32_t k1 = 0; switch (len & 3) { case 3: k1 ^= tail[2] << 16; case 2: k1 ^= tail[1] << 8; case 1: k1 ^= tail[0]; k1 *= c1; k1 = ROT32(k1, r1); k1 *= c2; hash ^= k1; } hash ^= len; hash ^= (hash >> 16); hash *= 0x85ebca6b; hash ^= (hash >> 13); hash *= 0xc2b2ae35; hash ^= (hash >> 16); return hash; } uint32_t murmur(const char *key, uint32_t len) { return murmur3_32(key, len, 0xbc9f1d34); }
18.916667
67
0.591189
360f4a39da9613ffc096be7f602f77fcb815c802
1,471
h
C
include/socket.h
WLBF/rift
e4d4503a3e1fab24e3b148768b92d7ea0721fa24
[ "MIT" ]
null
null
null
include/socket.h
WLBF/rift
e4d4503a3e1fab24e3b148768b92d7ea0721fa24
[ "MIT" ]
null
null
null
include/socket.h
WLBF/rift
e4d4503a3e1fab24e3b148768b92d7ea0721fa24
[ "MIT" ]
null
null
null
// // Created by wlbf on 9/10/21. // #ifndef RIFT_SOCKET_H #define RIFT_SOCKET_H #include <memory> namespace rift { class InetAddress; /// /// Wrapper of socket file descriptor. /// /// It closes the sockfd when desctructs. /// It's thread safe, all operations are delagated to OS. class Socket { public: explicit Socket(int sock_fd) : sock_fd_(sock_fd) {} Socket(const Socket &) = delete; Socket &operator=(const Socket &) = delete; ~Socket(); [[nodiscard]] int Fd() const { return sock_fd_; } /// abort if address in use void BindAddress(const InetAddress &local_addr) const; /// abort if address in use void Listen() const; /// On success, returns a non-negative integer that is /// a descriptor for the accepted socket, which has been /// set to non-blocking and close-on-exec. *peeraddr is assigned. /// On error, -1 is returned, and *peeraddr is untouched. int Accept(InetAddress *peer_addr) const; /// /// Enable/disable SO_REUSEADDR /// void SetReuseAddr(bool on) const; void ShutdownWrite() const; /// /// Enable/disable TCP_NODELAY (disable/enable Nagle's algorithm). /// void SetTcpNoDelay(bool on) const; private: const int sock_fd_; }; using SocketPtr = std::shared_ptr<Socket>; } #endif //RIFT_SOCKET_H
23.349206
74
0.600952
d9e363ab44118c9c84168fb0dd85dd24d39e9ffa
354
h
C
common/udp_server.h
Favorsiki/ChatRoom
db368335674cf4b031148be8a45666674f2f641c
[ "MIT" ]
null
null
null
common/udp_server.h
Favorsiki/ChatRoom
db368335674cf4b031148be8a45666674f2f641c
[ "MIT" ]
null
null
null
common/udp_server.h
Favorsiki/ChatRoom
db368335674cf4b031148be8a45666674f2f641c
[ "MIT" ]
1
2020-07-11T07:18:45.000Z
2020-07-11T07:18:45.000Z
/************************************************************************* > File Name: udp_server.h > Author: suyelu > Mail: suyelu@126.com > Created Time: Thu 09 Jul 2020 11:15:45 AM CST ************************************************************************/ #ifndef _UDP_SERVER_H #define _UDP_SERVER_H int socket_create_udp(int port); #endif
29.5
74
0.426554
3da699e6c27dbe99f65e968e35bb22dd02f9a991
4,462
h
C
DataFormats/TauReco/src/classes_1.h
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
1
2020-08-12T08:37:04.000Z
2020-08-12T08:37:04.000Z
DataFormats/TauReco/src/classes_1.h
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
null
null
null
DataFormats/TauReco/src/classes_1.h
nistefan/cmssw
ea13af97f7f2117a4f590a5e654e06ecd9825a5b
[ "Apache-2.0" ]
null
null
null
#include "DataFormats/Common/interface/Wrapper.h" #include "DataFormats/Common/interface/AssociationVector.h" #include "DataFormats/TauReco/interface/BaseTauTagInfo.h" #include "DataFormats/TauReco/interface/CaloTauTagInfo.h" #include "DataFormats/TauReco/interface/PFTauTagInfo.h" #include "DataFormats/TauReco/interface/BaseTau.h" #include "DataFormats/TauReco/interface/CaloTau.h" #include "DataFormats/TauReco/interface/PFTau.h" #include "DataFormats/TauReco/interface/PFTauDecayMode.h" #include "DataFormats/TauReco/interface/RecoTauPiZero.h" #include "DataFormats/TauReco/interface/RecoTauPiZeroFwd.h" #include "DataFormats/TauReco/interface/CaloTauDiscriminatorByIsolation.h" #include "DataFormats/TauReco/interface/CaloTauDiscriminator.h" #include "DataFormats/TauReco/interface/CaloTauDiscriminatorAgainstElectron.h" #include "DataFormats/TauReco/interface/PFTauDiscriminatorByIsolation.h" #include "DataFormats/TauReco/interface/PFTauDiscriminator.h" #include "DataFormats/Common/interface/AssociationMap.h" #include "DataFormats/Common/interface/Association.h" #include "DataFormats/Common/interface/Ptr.h" #include "DataFormats/Common/interface/PtrVector.h" #include "DataFormats/TauReco/interface/JetPiZeroAssociation.h" #include "DataFormats/TauReco/interface/PFTauDecayModeAssociation.h" #include "DataFormats/TauReco/interface/L2TauInfoAssociation.h" #include "DataFormats/TauReco/interface/HLTTau.h" #include "DataFormats/Common/interface/FwdPtr.h" #include "DataFormats/Common/interface/RefToPtr.h" #include "DataFormats/TauReco/interface/PFRecoTauChargedHadron.h" #include "DataFormats/TauReco/interface/PFRecoTauChargedHadronFwd.h" #include "DataFormats/TauReco/interface/PFJetChargedHadronAssociation.h" #include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterAssociation.h" #include "DataFormats/TauReco/interface/PFTauTransverseImpactParameterFwd.h" #include "DataFormats/TauReco/interface/PFTau3ProngSummaryFwd.h" #include "DataFormats/TauReco/interface/PFTau3ProngSummaryAssociation.h" #include <vector> #include <map> #include "TLorentzVector.h" namespace DataFormats_TauReco { struct dictionary1 { reco::L2TauIsolationInfo l2iI; reco::L2TauInfoAssociation l2ts; edm::Wrapper<reco::L2TauInfoAssociation> wl2ts; std::vector<reco::BaseTauTagInfo> btti_v; edm::Wrapper<std::vector<reco::BaseTauTagInfo> > btti_w; edm::Ref<std::vector<reco::BaseTauTagInfo> > btti_r; edm::RefProd<std::vector<reco::BaseTauTagInfo> > btti_rp; edm::RefVector<std::vector<reco::BaseTauTagInfo> > btti_rv; std::vector<reco::CaloTauTagInfo> calotti_v; edm::Wrapper<std::vector<reco::CaloTauTagInfo> > calotti_w; edm::Ref<std::vector<reco::CaloTauTagInfo> > calotti_r; edm::RefProd<std::vector<reco::CaloTauTagInfo> > calotti_rp; edm::RefVector<std::vector<reco::CaloTauTagInfo> > calotti_rv; std::vector<reco::PFTauTagInfo> pftti_v; edm::Wrapper<std::vector<reco::PFTauTagInfo> > pftti_w; edm::Ref<std::vector<reco::PFTauTagInfo> > pftti_r; edm::RefProd<std::vector<reco::PFTauTagInfo> > pftti_rp; edm::RefVector<std::vector<reco::PFTauTagInfo> > pftti_rv; std::vector<reco::BaseTau> bt_v; edm::Wrapper<std::vector<reco::BaseTau> > bt_w; edm::Ref<std::vector<reco::BaseTau> > bt_r; edm::RefProd<std::vector<reco::BaseTau> > bt_rp; edm::RefVector<std::vector<reco::BaseTau> > bt_rv; edm::reftobase::Holder<reco::Candidate,reco::BaseTauRef> bt_rb; std::vector<reco::CaloTau> calot_v; edm::Wrapper<std::vector<reco::CaloTau> > calot_w; edm::Ref<std::vector<reco::CaloTau> > calot_r; edm::RefProd<std::vector<reco::CaloTau> > calot_rp; edm::RefVector<std::vector<reco::CaloTau> > calot_rv; edm::reftobase::Holder<reco::BaseTau,reco::CaloTauRef> calot_rb; edm::RefToBaseVector<reco::CaloTau> calot_rftbv; edm::Wrapper<edm::RefToBaseVector<reco::CaloTau> > calot_rftbv_w; }; }
53.759036
84
0.686688
8db6fcb8a9a4e1b0901f1f8bd86b95a618034e67
2,104
h
C
src/tritonsort/core/WorkQueue.h
anku94/themis_tritonsort
68fd3e2f1c0b2947e187151a2e9717f6b9b0ed0d
[ "BSD-3-Clause" ]
11
2015-12-14T05:35:17.000Z
2021-11-08T22:02:32.000Z
src/tritonsort/core/WorkQueue.h
anku94/themis_tritonsort
68fd3e2f1c0b2947e187151a2e9717f6b9b0ed0d
[ "BSD-3-Clause" ]
null
null
null
src/tritonsort/core/WorkQueue.h
anku94/themis_tritonsort
68fd3e2f1c0b2947e187151a2e9717f6b9b0ed0d
[ "BSD-3-Clause" ]
8
2015-12-22T19:31:16.000Z
2020-12-15T12:09:00.000Z
#ifndef TRITONSORT_WORK_QUEUE_H #define TRITONSORT_WORK_QUEUE_H #include <list> #include <stdint.h> class Resource; /** Exports a queue abstraction but allows large amounts of work to be moved between queues in constant time. \warning All work units are Resource*'s, so the user must dynamic cast to ensure type safety. \warning Not thread safe! */ class WorkQueue { public: /// Constructor WorkQueue(); /// Push a work unit onto the queue /** If the work unit being pushed is NULL, this is interpreted as a signal that the queue will never receive additional work \param workUnit a pointer to the work unit to push */ void push(Resource* workUnit); /// Remove the first work unit from the queue void pop(); /// Get the first work unit from the queue /** \return the first work unit currently in the queue */ Resource* front() const; /// Get the last work unit in the queue /** \return the last work unit currently in the queue */ Resource* back() const; /// Get the size of the work queue /** \return the size of the work queue */ uint64_t size() const; /// Get the total size of the work queue's work units in bytes uint64_t totalWorkSizeInBytes() const; /// Is the work queue empty? /** \return true if the work queue is empty, false otherwise */ bool empty() const; /// Will this work queue receive more work? /** \return true if someone tried to enqueue NULL to this work queue in the past, indicating that we will never see any more work, and false otherwise */ bool willNotReceiveMoreWork() const; /// Move all the work from this queue onto another queue /** Append the contents of this queue onto the provided queue. At the end of the operation, the size of this queue will be zero. \param destQueue the queue to which to move this queue's work */ void moveWorkToQueue(WorkQueue& destQueue); private: std::list<Resource*> work; bool noMoreWork; uint64_t _size; uint64_t totalBytes; }; #endif // TRITONSORT_WORK_QUEUE_H
24.465116
79
0.689163
ce750a99eea96bb968bea7b2f4414dac752a7922
704
h
C
openeuler-kernel/arch/sparc/mm/mm_32.h
Ddnirvana/test-CI
dd7a0a71281075e8ab300bddbab4a9fa039958f0
[ "MulanPSL-1.0" ]
31
2021-04-27T08:50:40.000Z
2022-03-01T02:26:21.000Z
openeuler-kernel/arch/sparc/mm/mm_32.h
Ddnirvana/test-CI
dd7a0a71281075e8ab300bddbab4a9fa039958f0
[ "MulanPSL-1.0" ]
13
2021-07-10T04:36:17.000Z
2022-03-03T10:50:05.000Z
openeuler-kernel/arch/sparc/mm/mm_32.h
Ddnirvana/test-CI
dd7a0a71281075e8ab300bddbab4a9fa039958f0
[ "MulanPSL-1.0" ]
12
2021-04-06T02:23:10.000Z
2022-02-28T11:43:19.000Z
/* SPDX-License-Identifier: GPL-2.0 */ /* fault_32.c - visible as they are called from assembler */ asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc, unsigned long address); asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, unsigned long address); void window_overflow_fault(void); void window_underflow_fault(unsigned long sp); void window_ret_fault(struct pt_regs *regs); /* srmmu.c */ extern char *srmmu_name; extern int viking_mxcc_present; extern int flush_page_for_dma_global; extern void (*poke_srmmu)(void); void __init srmmu_paging_init(void); /* iommu.c */ void ld_mmu_iommu(void);
30.608696
79
0.71875
c02fdbdedc685e8e7baf68e3dcd028e0bb8eb243
1,258
h
C
runtime/macos/OSXPrivateSDK-master/PrivateSDK10.10.sparse.sdk/usr/local/include/security_cdsa_utils/cuFileIo.h
cz-it/step_in_runtime
3f7ad51cfb75a801f0ac05e3cb9846115736660a
[ "MIT" ]
34
2015-02-04T18:03:14.000Z
2020-11-10T06:45:28.000Z
runtime/macos/OSXPrivateSDK-master/PrivateSDK10.10.sparse.sdk/usr/local/include/security_cdsa_utils/cuFileIo.h
cz-it/step_in_runtime
3f7ad51cfb75a801f0ac05e3cb9846115736660a
[ "MIT" ]
5
2015-06-30T21:17:00.000Z
2016-06-14T22:31:51.000Z
runtime/macos/OSXPrivateSDK-master/PrivateSDK10.10.sparse.sdk/usr/local/include/security_cdsa_utils/cuFileIo.h
cz-it/step_in_runtime
3f7ad51cfb75a801f0ac05e3cb9846115736660a
[ "MIT" ]
15
2015-10-29T14:21:58.000Z
2022-01-19T07:33:14.000Z
/* * Copyright (c) 2001-2003,2011,2014 Apple Inc. All Rights Reserved. * * The contents of this file constitute Original Code as defined in and are * subject to the Apple Public Source License Version 1.2 (the 'License'). * You may not use this file except in compliance with the License. Please * obtain a copy of the License at http://www.apple.com/publicsource and * read it before using this file. * * This Original Code and all software distributed under the License are * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. * Please see the License for the specific language governing rights and * limitations under the License. */ /* File: cuFileIo.h Description: simple file read/write utilities */ #ifdef __cplusplus extern "C" { #endif int readFile( const char *fileName, unsigned char **bytes, // mallocd and returned unsigned *numBytes); // returned int writeFile( const char *fileName, const unsigned char *bytes, unsigned numBytes); #ifdef __cplusplus } #endif
29.952381
75
0.737679
35caf4ab5582c626405fcf9aaf373b3cc7a022aa
2,341
h
C
src/SVExportDialog/forms/export_dialog_impl.h
Tyill/SVisual
7d755e7ecee0a329a992c3a031709123ec4f4b78
[ "MIT" ]
27
2017-10-08T05:56:11.000Z
2022-02-22T08:08:47.000Z
src/SVExportDialog/forms/export_dialog_impl.h
Tyill/SVisual
7d755e7ecee0a329a992c3a031709123ec4f4b78
[ "MIT" ]
20
2018-06-05T15:46:16.000Z
2022-01-11T13:45:54.000Z
src/SVExportDialog/forms/export_dialog_impl.h
Tyill/SVisual
7d755e7ecee0a329a992c3a031709123ec4f4b78
[ "MIT" ]
10
2018-10-23T18:48:59.000Z
2021-09-18T08:10:18.000Z
// // SVisual Project // Copyright (C) 2018 by Contributors <https://github.com/Tyill/SVisual> // // This code is licensed under the MIT License. // // 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 without limitation the rights // to use, copy, modify, merge, publish, 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.IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 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. // #pragma once #include "GeneratedFiles/ui_export_dialog.h" #include "SVConfig/config_data.h" #include "SVExportDialog/export_dialog.h" class ExportDialog : public QDialog { Q_OBJECT public: SV_Exp::pf_getCopySignalRef pfGetCopySignalRef = nullptr; SV_Exp::pf_getCopyModuleRef pfGetCopyModuleRef = nullptr; SV_Exp::pf_getSignalData pfGetSignalData = nullptr; SV_Exp::pf_loadSignalData pfLoadSignalData = nullptr; SV_Exp::pf_setTimeInterval pfSetTimeInterval = nullptr; SV_Exp::pf_getTimeInterval pfGetTimeInterval = nullptr; ExportDialog(QWidget *parent, SV_Exp::Config); ~ExportDialog(); private: Ui::ExportDialog ui; QString selModule_, selSignal_, selDirMem_; private: void showEvent(QShowEvent * event); SV_Exp::Config cng; QSet<QString> expSignals_; void updateTableSignal(); void updateTableExport(); #ifdef USE_QtXlsxWriter void exportToXLSX(QString fileName); #endif void exportToTXT(QString fileName); void exportToJSON(QString fileName); private slots: void selModule(QListWidgetItem* item); void addSignalOnExport(); void delSignalFromExport(); };
32.068493
80
0.768475
98351fad37ee8006eb7867fe257f9e79df5c9323
651
h
C
Source/PanelInspector.h
WickedNekomata/NekoEngine
5d10b7e4895e463d7a816ea7a6a8eb9dc91174cd
[ "MIT" ]
13
2018-11-26T12:39:30.000Z
2022-03-21T21:23:22.000Z
Source/PanelInspector.h
WickedNekomata/NekoEngine
5d10b7e4895e463d7a816ea7a6a8eb9dc91174cd
[ "MIT" ]
1
2022-03-21T22:05:10.000Z
2022-03-21T22:05:10.000Z
Source/PanelInspector.h
WickedNekomata/NekoEngine
5d10b7e4895e463d7a816ea7a6a8eb9dc91174cd
[ "MIT" ]
10
2018-10-27T01:58:26.000Z
2021-03-26T09:28:02.000Z
#ifndef __PANEL_INSPECTOR_H__ #define __PANEL_INSPECTOR_H__ #include "GameMode.h" #ifndef GAMEMODE #include "Panel.h" class Component; class PanelInspector : public Panel { public: PanelInspector(char* name); ~PanelInspector(); bool Draw(); private: void ShowGameObjectInspector() const; void DragnDropSeparatorTarget(Component* target) const; void ShowMeshResourceInspector() const; void ShowTextureResourceInspector() const; void ShowMeshImportSettingsInspector() const; void ShowTextureImportSettingsInspector() const; void ShowShaderObjectInspector() const; void ShowShaderProgramInspector() const; }; #endif #endif // GAME
17.594595
56
0.791091
ed82a4a6a6fc400d527c4ff15d029b8b3dc8a755
97,384
h
C
weights_h/722_dscnn_with_20_labels/with_quant.h
Lebhoryi/ML-KWS-for-MCU
47316dafb1cfbb8ead3e049cc846bdb45f3e7995
[ "Apache-2.0" ]
1
2021-11-15T20:34:14.000Z
2021-11-15T20:34:14.000Z
weights_h/722_dscnn_with_20_labels/with_quant.h
Lebhoryi/ML-KWS-for-MCU
47316dafb1cfbb8ead3e049cc846bdb45f3e7995
[ "Apache-2.0" ]
null
null
null
weights_h/722_dscnn_with_20_labels/with_quant.h
Lebhoryi/ML-KWS-for-MCU
47316dafb1cfbb8ead3e049cc846bdb45f3e7995
[ "Apache-2.0" ]
null
null
null
#define DS-CNN_conv_1_weights_0 {-9, -3, -4, -6, -5, 1, 1, -2, 1, 3, 6, 6, 9, -7, 15, 16, 1, -8, -7, -1, -8, -17, -23, -22, -1, 16, -4, -14, 14, 13, 20, 5, 15, 17, 16, 11, 10, 3, -5, 16, -4, 6, -13, 6, 2, 9, -21, 13, -2, 6, -15, 16, 0, -1, -10, 12, 2, 1, -9, 9, 1, 4, -4, -3, -2, 5, 4, -5, -2, -7, 0, -3, 6, -6, -1, 0, 13, 6, 0, 2, 0, -7, -2, 0, -1, -8, -4, 2, -4, -6, -3, 2, -9, -3, 2, -1, -9, -1, 0, 3, -5, 0, 4, 7, 5, 10, 9, 6, 7, 8, 7, 0, 7, 13, 5, -4, 4, 7, 0, -4, -60, 4, 29, 19, -37, -11, 30, 38, -25, -3, 28, 31, -9, 9, 29, 16, 0, 36, 1, -3, 21, 2, -21, -21, 23, -21, -21, -25, 34, -1, -21, -15, 33, 4, -18, -7, 21, -10, -7, -14, -6, 5, 2, -23, -6, 11, -1, -20, -3, 10, -2, -8, 0, 7, -4, -5, 2, 1, -7, 1, -1, -1, 1, 4, 1, 0, 6, 12, 5, -3, 12, 11, -3, -9, 15, 11, -9, -7, 11, 4, -3, 21, 7, 8, -1, 8, 11, 10, 3, 2, 10, 15, -4, -4, 4, 7, -6, 1, 4, 5, -3, 5, 2, 3, 0, -3, -2, -7, 0, 2, -5, -1, -3, -3, 2, 5, -4, -11, 3, 9, -4, 30, 0, -11, 4, 5, 13, -4, 7, 6, 8, -5, 4, -9, 6, -10, -1, -4, -4, -2, -4, -4, 2, 0, -1, 0, 9, -2, -6, -1, 5, 0, 1, 2, -4, 1, 9, -6, 1, -1, 8, 20, 13, 12, 6, 16, 11, 20, -4, 3, 21, 32, -17, -4, 16, 48, -23, -6, 15, 32, -10, -10, 26, 24, -7, -1, -1, -17, 16, 6, -23, -64, 24, -14, -43, -67, 9, -9, -37, -34, -2, 14, 0, -6, -2, 11, 4, -3, 1, 4, 4, 1, 3, -5, 2, 0, 0, -1, -2, -1, -3, -1, -2, -2, -4, 0, 0, -2, -1, 0, 1, 1, 2, 0, 3, 4, 1, 0, 2, 6, -8, -10, 6, -2, 4, -10, 3, -17, 4, 5, -9, -25, 10, 6, -20, -19, 6, 12, -22, 4, -6, -7, -11, 15, -8, -26, 2, 28, -6, -14, 17, 22, 1, 6, 11, 4, 16, 21, 11, 6, 7, 9, 6, -7, 3, 4, -7, -4, 9, -8, -18, 7, 2, -19, -15, 12, 0, -9, -9, 4, -4, -4, -4, -1, 6, -1, -3, -6, 8, 2, -4, -17, 16, 1, 0, -22, 18, 13, -6, -7, 4, 7, 2, -8, -3, 13, -9, -9, -6, 9, -8, -9, -10, -9, -8, -10, -7, -12, -6, -7, -2, -13, 5, 4, 3, -8, 1, 8, -1, -2, 5, 3, 0, 3, 7, 3, 1, -2, -4, 3, 7, 2, 7, 9, 4, -2, -8, 3, -3, 2, -21, 12, -5, -1, 17, 19, -28, 12, 35, 19, -35, 15, 17, -12, 1, 11, -16, -35, 30, -5, -19, -23, 21, -10, -16, -6, 7, -6, 0, 4, 18, 5, -16, -37, 28, -7, 1, -47, 49, 19, 23, -25, 48, 18, 21, -4, 39, -20, 11, -8, 26, -21, 16, 8, 20, -3, -1, -5, 7, 4, -4, 4, -11, -10, -12, 13, -18, 17, -18, 2, 5, -10, -8, 3, -3, -2, -10, 5, -3, 1, -7, 4, -7, 1, 0, 8, -5, -7, 1, 2, -11, -16, -5, -6, -9, -9, -12, -5, 2, -4, -6, -9, 11, 12, 1, -27, 12, 21, 12, -24, -2, -7, 1, 1, 4, -1, 2, -4, 9, 6, 6, -12, 3, 14, 8, -18, -12, 15, 7, -10, -9, 6, 8, 1, 1, -5, 3, 2, 6, -6, 1, -6, 1, -4, 5, -5, -4, -1, 2, -4, -5, 15, -1, -4, -10, 7, -4, -2, -11, 3, 1, -4, -4, 6, 7, -8, -2, 4, 4, -9, 0, -1, 0, -1, 9, -10, 2, 4, 9, -16, 3, 5, 12, -11, -10, 15, 7, -1, -8, 13, 20, -6, -20, -9, 14, -8, -25, -16, 20, -15, -20, -21, 2, -4, 2, -10, -5, -8, 18, 9, -15, 5, 9, 15, -17, 11, 9, 14, -6, 1, 10, 17, -10, 12, 6, 5, -8, 11, 3, -8, -3, 25, 2, -7, -9, 19, 0, -8, -2, 8, 10, 0, 2, -11, 11, 7, 6, -9, 9, 9, 3, -14, 7, 3, -8, -6, -2, 0, -1, -2, -2, 3, -1, 1, 3, 18, -8, -3, -11, 13, -6, -18, -6, -10, -6, -11, -1, -13, -8, -12, 12, -8, -11, -1, 8, -6, -15, 3, -3, -14, -6, 10, -8, -5, 0, 2, -7, -5, -1, 7, -4, -7, 7, 5, -7, 9, 17, 7, -6, 11, 5, -18, -1, -2, 5, -15, 2, -7, 11, -4, -2, -7, 11, -2, 4, 2, 9, -2, -5, 1, 1, 13, -13, -1, -11, 13, -6, -2, -10, 4, 2, -4, -15, 2, 2, -10, -7, 6, -1, -6, -13, 15, 9, 18, -11, 2, 18, 5, 0, -5, 10, 1, 1, -1, -4, 9, -7, -10, -2, 8, -5, -22, -7, 9, -2, -13, -7, -1, 13, -3, -4, -7, 4, 10, -17, -27, -6, 19, -23, -29, -6, 13, 27, -30, -23, 1, 32, -18, -29, -22, 32, 11, -21, -13, 16, 27, 11, -8, -13, 21, 31, -8, -34, 19, 24, -2, -46, 2, 13, 26, -35, -12, 1, 11, -5, -19, -4, 0, 16, -5, -13, 12, 0, 2, -8, 10, 1, 7, -3, 4, -4, 2, 4, 5, -7, -2, 5, 9, -9, -3, -1, 1, 0, -11, 0, -6, 11, -5, 0, -13, 18, -2, 5, -11, 13, 1, 8, -4, 6, -4, -1, 5, 3, 8, -5, 7, -2, 15, -5, -1, -4, 7, 5, -3, -2, 1, 8, -9, -2, -4, 9, -7, -1, -10, 8, -8, -4, -11, 6, -1, -3, -7, 3, -1, 0, -2, -1, -3, -3, 2, 9, 19, 1, -9, 0, 15, 13, 3, -9, 2, 8, 6, -7, -5, 9, 3, -3, -5, 11, 8, -2, -8, 8, 15, -3, -11, -2, 10, -5, -6, -4, 2, -1, -6, -5, 6, 9, -2, -9, 5, -7, -12, 9, -4, -1, -11, 1, -2, 8, -21, -20, 0, 7, 0, -34, -5, 3, 12, -17, -5, -1, 17, 14, -8, -8, 7, 30, 6, -7, -1, 19, 7, 2, 4, -2, 17, 2, 8, -5, 7, -14, -4, -15, 2, -20, -7, -17, -3, -21, -7, -14, -8, -15, -8, -1, -17, -7, -4, 0, -8, 3, -10, 9, 7, 11, 2, 20, 18, 10, 5, 13, 9, 14, 19, 7, 5, 11, 13, 9, -3, 4, -6, 2, 2, 5, -5, 1, 4, 2, -4, 5, 12, 0, 0, 3, 11, -5, -1, -6, 13, -2, -6, -10, 10, 1, -1, -12, 6, 1, 6, 6, -9, 6, 13, 18, -21, 1, 18, 10, -25, -24, 5, -7, -12, -21, 4, 2, -30, -10, -2, 10, -37, -1, -1, 20, -2, 7, -14, 30, 17, 7, -22, 14, 23, 2, -13, -20, -10, -1, 29, -17, -12, -18, 11, 0, -16, -34, -6, 26, -17, 0, -5, 7, 0, 2, -1, 4, -1, 3, 6, -3, 0, 2, 9, -2, -1, -2, 9, -2, 0, -4, 5, 0, 2, -4, 4, 1, 3, -3, 1, 4, 1, 3, -3, 5, -2, 3, -7, 0, -2, -2, 0, -4, -25, -10, -2, 10, -22, -5, -5, 6, -20, -4, -7, -3, -2, -9, -5, 6, 12, -18, -3, 23, 14, -7, 26, 26, 6, -1, 23, 9, 4, 12, -2, -6, 23, 3, -8, -11, 29, 5, -13, 3, -5, 2, -5, 2, -3, 3, 12, 2, 5, -3, 21, 7, 1, -5, 13, 9, 3, -2, 1, 9, 2, -2, -1, 0, -6, 2, -5, -1, -7, -2, -4, -1, 0, 0, -3, -5, 0, 1, 15, 12, 27, -4, 19, 14, 24, 1, 7, 16, 8, -2, -5, 6, 6, -6, -4, 3, 8, 3, -20, -7, -3, 4, -14, -13, -4, 3, 0, -7, -18, 0, -2, -22, -20, 4, 1, -15, -10, -22, 3, 6, 28, -1, 0, 2, 29, 4, 10, -5, 26, 7, 16, -11, 19, 8, 15, -22, 13, 17, -8, -14, 1, 23, -17, -9, -2, 1, -3, -13, 19, 10, -10, -1, 29, 6, -1, 0, 14, -1, -4, 2, -6, 0, -5, 3, -8, 8, -13, -1, -9, 6, -7, -6, -7, 6, -6, -11, -13, 1, 4, -22, -11, -6, 2, -19, -12, -11, 4, -4, 6, -5, -1, 10, 9, -4, 10, 10, 8, 11, 13, 12, 3, -2, 13, 12, -7, -8, 10, 5, -9, 2, 5, -2, -7, 5, -6, 7, -8, -6, -6, 9, 7, -3, -10, 2, 18, 1, -8, -8, 11, -6, -6, -22, 8, -21, -5, -17, 4, 26, -9, -22, -5, 25, 5, -5, 11, -11, -7, 15, 13, -16, 12, 0, -7, 7, 11, -3, 2, -11, 2, -10, -8, -8, -27, -8, -7, 10, -12, -1, -7, -12, -4, 1, -5, -9, 9, 7, 2, -7, -9, 17, -5, -15, 4, 8, -7, -1, -10, -15, -25, 24, -24, -27, -27, 31, 5, -28, -27, 21, 6, -11, -23, 18, 16, 7, -48, -7, 18, 3, -39, -5, -1, 19, -14, -13, -14, 29, -12, 3, 18, -5, -6, 4, 7, -1, -10, 5, 9, -1, -7, -3, -1, -11, -13, -7, -15, -6, -10, -3, -23, 2, 14, 15, -8, 8, 26, 16, -9, 15, 23, -3, -1, 5, 16, -9, 15, 11, -5, -13, -1, 7, 2, 1, 6, -13, -25, 9, 18, -22, -29, 6, 5, -1, -5, 8, 4, 18, 22, -19, -5, 18, 19, 0, 10, 4, -26, 28, -8, -30, -38, 26, -13, -35, -17, -13, -16, -8, 13, 3, -7, -11, -13, -1, -1, 1, -18, 2, 12, 5, -12, 0, 17, 5, -13, 2, 17, 0, 2, 3, 7, 5, 19, 6, -12, 12, 22, 1, -10, 1, 16, -4, -8, -10, 8, -13, -9, -16, 6, -8, 1, 0, -3, -4, -2, -5, -2, -2, 5, -5, -4, -1, 12, 0, -10, -3, 13, 2, -18, -1, 2, 3, -17, -1, 1, -3, -6, 4, 0, -3, -5, 9, -3, -7, 2, 14, -13, -4, 4, 14, -1, 3, -22, 11, -2, -1, -24, 10, -6, -4, -15, 8, -5, -13, -8, 0, -8, -5, 2, -3, -10, -2, 5, -8, -9, -2, 10, -13, -4, 3, 15, -7, 19, 7, 36, -11, 23, -1, 25, -6, 14, 16, 21, -9, 1, 25, 22, -2, -7, 5, 16, 4, -21, -10, 16, 6, -16, -25, -2, 12, -10, -29, -11, 5, 11, -19, -29, 4, -2, -11, -26, 5, 7, 2, -13, 0, 12, 10, 4, -7, 12, 11, -24, -4, 3, 10, -23, -7, 7, 10, -19, -3, 3, 3, -17, -4, 8, -5, -7, 5, 4, -8, -6, 7, -2, -7, 4, 5, -5, 0, 7, 1, -11, 6, 12, -2, -6, 1, 14, -3, -1, 3, 10, 2, -4, 2, 11, -1, 0, 4, -2, 1, -9, 6, -12, 1, -6, -8, -20, 4, 2, -14, -6, 6, 19, 3, -2, 5, 16, 11, -3, 4, 0, 3, -24, 0, 0, -3, -22, -1, -10, -6, 23, -7, -9, -10, 29, -3, -2, 1, 23, 6, 5, 4, 16, 1, 14, 1, 6, -6, 18, 0, -11, -3, 15, 5, -39, 2, 3, 0, -37, 3, -11, 2, -18, 5, -12, 5, 1, 19, -2, 15, 49, -25, -28, 14, 1, -50, -10, 5, -58, -52, 13, 7, -36, 10, -11, -3, 10, 39, 30, 7, 33, -17, 18, 31, 27, -3, -32, -13, -8, 17, -2, -9, -44, 12, 18, 1, -9, -10, 12, -6, 7, 0, 13, -6, 9, 5, -5, -4, 6, 2, -1, -7, 0, -3, 2, -11, 1, 3, -6, -5, -1, 3, -13, 2, -5, 5, -5, -1, 0, 2, -7, 7, -10, 2, -5, 11, -25, -7, -2, -9, -4, 4, -14, -6, -7, -4, -14, 7, 0, -14, -4, 2, 11, -15, 0, 4, 14, -5, 14, 0, 28, 4, 8, -1, 21, 2, 10, -10, 4, 9, 4, -7, 0, 18, 6, -7, -1, 26, -12, -12, -1, 32, -13, -2, 2, 25, -11, 17, -2, 29, 5, 7, 3, 11, 5, 5, 7, -12, 7, -1, 6, -25, 3, -10, 4, -27, -3, -4, 5, -27, 13, 3, -12, -18, 13, 2, -10, 1, 11, -9, -3, -12, 13, -2, -3, -23, 9, 0, -6, -18, 6, -7, -4, -3, -2, -13, -8, 11, -15, -11, 8, 12, -15, -1, 12, 9, -13, 11, 3, 19, -1, -1, 15, 20, 5, -8, 25, 0, 3, 2, 8, -2, -7, 11, 13, 3, -3, 6, 13, 0, 3, -8, 6, -7, 20, -11, -15, -13, 19, 0, -16, -7, 5, 6, -7, 6, -11, 12, -4, 15, -12, 17, -2, 9, 0, 16, -6, 4, 15, -1, -18, -3, 20, 7, -21, -4, 12, 14, -9, -9, -5, 14, 1, -12, -10, 11, 12, -3, -5, -2, 15, 12, -10, -19, 20, 10, 0, -22, 12, 11, -6, -24, 2, 2, -5, -21, -3, 7, -2, 10, 4, 4, -4, 7, -3, 0, 6, 11, -7, -12, 15, 6, -15, -14, 15, 5, -7, -16, 2, 6, 2, -9, -2, 7, 5, 11, -6, 1, 11, 21, -3, -16, 12, 6, -5, -25, 11, 8, -4, 2, 8, 6, 10, 7, 11, -13, 17, 9, 4, -18, 17, 2, 0, -3, 2, -7, 2, 13, -9, -4, 2, 11, -18, -5, -8, 12, -12, -14, -14, -4, 5, -4, -12, 3, 6, 10, -10, 9, 8, 21, -4, 18, -1, 22, 23, 20, -5, 35, 19, 17, 9, 26, -6, 8, 29, 4, -22, 13, -1, -2, -16, 2, -10, -23, 5, -12, -14, -34, 16, -28, -9, -49, 16, -25, 1, -30, 12, 0, 27, -17, 3, 16, 9, -6, 17, 11, 1, -6, 32, 6, -4, 8, 29, -6, -11, 11, 5, 1, -18, 5, -13, -6, -14, 14, -11, -8, -5, 14, -15, -7, -1, 1, -21, -2, 12, -17, -15, -1, -10, 9, 12, -2, -7, 8, 11, -2, -5, 4, -1, -7, 0, -2, -10, 2, 7, -5, -10, 4, 2, -12, -4, 6, 3, -6, -8, 4, 3, -1, -10, 1, 11, 8, -3, -3, 11, 9, 4, 1, 6, 9, 14, 2, 9, -2, 14, 1, 6, -10, 1, -2, 9, -7, -10, -1, 6, -6, -12, -3, 0, -14, -3, 4, -3, -7, -1, 5, -2, -4, -9, 3, -15, 11, -22, -7, -15, 13, -16, -6, 3, -8, 7, -10, 2, -4, 0, -10, 1, 16, 12, 8, 9, 18, 23, 28, 15, 11, 9, 19, 14, -2, -12, 0, -6, -14, -13, -13, -10, -15, -6, 1, -7, -8, -15, 6, -6, 9, -13, 5, 0, -5, 9, 6, -3, -11, 5, 8, -4, -12, 8, 3, 8, -22, 7, 5, -5, -17, -7, 2, -6, -8, -8, 1, 0, 0, 1, -5, -4, 8, 4, -5, -7, 12, 4, -2, -1, 9, 0, 14, -10, -22, -3, 12, -3, -10, 2, 14, -6, -2, -10, 16, -2, 3, -1, 16, 0, -14, -1, 4, 0, -24, -8, -11, -3, -15, 2, -2, 9, 25, -7, -11, 15, 37, -16, -14, 11, 28, -10} #define DS-CNN_conv_1_biases_0 {49, 34, 54, 8, 20, 66, 14, 1, 25, -12, 3, -12, 48, 3, 24, 25, 24, 11, 20, 12, 22, 9, 2, 27, -9, -7, 35, 13, 16, 3, 31, 8, 22, 5, 29, 15, 22, -15, -5, 14, 28, 6, 29, 6, 27, 6, 26, 20, 8, -7, 18, 3, 23, 28, 32, 27, 31, 38, 25, 17, 18, 27, -15, 28} #define DS-CNN_conv_ds_1_dw_conv_depthwise_weights_0 {-30, 3, 12, 19, 57, 43, -10, -3, 105, 11, -10, 19, 27, -3, -31, 15, -10, -11, 8, -16, -18, -14, -9, -7, 2, -29, -24, -27, -18, 14, -1, -12, -39, -3, -7, -19, -20, -12, -12, 2, 17, -29, 30, -24, 9, 52, -20, 23, 6, -23, 1, -28, 16, -33, 1, 55, 39, -26, -3, -9, -36, -59, -15, 12, 46, 43, -11, -13, 38, -25, 67, -32, 65, -5, 14, 7, -51, -13, -10, -11, 13, 14, 26, -15, -24, -11, 7, -21, -16, -15, 17, 24, 28, -10, -31, -27, -49, -11, -39, -2, 11, -24, 6, -26, 22, 26, 27, -4, 6, 11, -12, 14, 2, -16, 15, 9, 26, 52, -3, -28, 17, -1, 24, -24, 2, -2, -56, -38, -2, 39, 2, -24, -53, -19, 21, -2, -61, 10, 31, 21, 32, 0, 36, 69, 13, 43, -6, 30, -17, -14, 8, -13, -19, -9, -13, -8, 7, -9, -7, -2, -37, 9, 2, 33, -17, 31, -22, 0, -36, -8, 17, 34, -4, 76, 2, -11, 6, -32, 2, -37, -9, 37, -16, -43, -61, 32, -37, -12, 0, 63, 54, 51, -30, -1, 10, 32, -21, 24, -36, -1, -46, 29, 21, 22, -30, 15, -11, 57, -24, -17, -8, 9, 18, 23, 17, 19, 12, -2, 11, -13, -37, -32, -53, 19, -32, 18, 32, -14, -22, 23, 10, 15, 11, -20, 9, 29, -17, 8, -22, 50, -26, 15, -2, 0, -8, -4, 27, -25, 23, 12, 19, -4, 5, 56, -34, 34, -59, 18, -1, 36, -3, -29, 12, -7, -36, -12, 15, -27, 26, 10, -7, -30, -7, -11, -17, -15, -28, -4, -32, -20, -12, -13, -6, 3, 6, 26, -33, 35, 29, 4, 0, 8, 0, 16, -5, 17, -43, 24, 20, 26, 12, -3, -22, 12, 23, -8, 35, 7, 19, 0, -26, 9, -21, 3, 14, 30, -7, 18, 27, 36, 10, 58, -40, 4, -12, -5, -11, 37, -75, 35, -3, -45, -13, -38, 14, -12, 55, 12, -23, 8, 48, -2, 34, 14, -3, -26, -15, -20, -12, -9, 24, 9, -98, 8, -16, 0, -17, -42, -21, 0, 0, 17, -50, 5, 27, -40, -4, 6, 19, -19, 11, -38, -18, -19, 13, -62, -26, 4, -7, -1, -14, -5, -11, -1, 54, 11, 40, 4, -33, -6, -6, -24, -58, -25, 10, -12, -4, 11, 21, -22, -4, -18, 45, 29, -19, 17, 7, 15, -6, 3, 42, 24, 67, 21, -17, -56, 51, 20, 8, 18, 9, 16, -26, 13, -44, 19, -27, -10, -19, 1, 67, 17, 23, 23, -25, -18, -6, -36, -8, -33, -16, 35, -14, 19, -33, 9, 40, -22, 21, -45, -2, -40, 11, 13, -44, 5, -53, -7, -34, 19, 41, -11, 5, 29, -15, -16, 4, -1, 5, -1, -3, -11, -4, 5, -7, 6, -19, -20, 26, 34, -16, -22, -3, -32, -29, -1, 8, 10, 24, 2, -12, 13, -6, -27, -16, -19, -22, 36, -40, -28, -22, -41, -7, 42, 20, 20, -3, 67, 17, 13, 30, 1, -28, 25, -40, 27, 17, 1, -12, -16, 43, 22, -26, -34, -8, -4, 2, -93, 26, -2, -7, 8, 8, -36, 30, 8, -5, -20, 78, -11, -18, 12, 108, -5, -37, 8, 23, 15, -3, 28, -37, -22, 36, -4, -88, -32, 26, 2, -33, 17, 21, 32, 4, -26, -20, -15, 41, 25, 61, -27, 15, 8, 11, -19, 33, -45} #define DS-CNN_conv_ds_1_dw_conv_biases_0 {9, -75, 36, -12, -4, 14, 2, 28, 38, 7, -11, -4, -22, 6, -5, -5, -11, 22, -7, -10, 37, 17, -1, 35, 10, 35, -45, 19, -3, -2, 13, -2, 68, -8, 1, 9, 43, -3, 33, 2, 2, -2, 25, -4, -9, -11, 30, -31, -17, -1, 2, 40, 2, 24, -11, 25, -25, -35, -5, -23, 26, -29, 1, -11} #define DS-CNN_conv_ds_1_pw_conv_weights_0 {32, -11, -60, 37, 9, 31, 18, 20, 33, -17, 19, 21, 52, -7, -42, -21, -30, 71, -25, 4, -66, -33, 4, 25, -11, -53, 46, -75, -6, -16, -30, -7, 2, 18, -17, 24, -62, 6, 12, 15, -13, 20, -17, 21, -8, -14, 25, 35, 24, -57, 31, -18, 8, -9, 33, 6, -22, -2, 32, -42, -11, 32, 48, 59, 19, 3, -14, 6, -13, 30, -21, -8, -22, -15, 5, -18, 5, -16, -14, 3, 27, -3, -3, -28, -10, -5, -14, 43, 14, -9, -32, -19, -5, 16, -10, -11, -9, -13, -8, 13, -3, -21, 15, -20, 6, -28, -10, 18, -3, 33, -42, -4, -23, 1, -7, 19, 20, -16, 21, 18, -4, -14, 18, -4, 7, 19, 5, -10, 17, 6, 14, -42, 6, 16, 9, 20, -66, -23, -27, 24, -18, 32, -1, -23, 5, -57, 3, -13, 1, 22, 32, -17, 11, -4, 34, -50, -20, 29, 30, -11, -35, 7, -12, -18, -35, 28, 25, 29, 17, -8, 40, -13, 8, -49, 47, -35, -10, 10, -21, -7, -11, 23, 12, -22, 8, 0, 2, 29, 6, -18, -19, 9, -12, -3, -16, 4, -22, -5, 9, -10, 13, -26, -4, -28, 11, -22, 42, -35, 9, -3, 0, 6, -17, 8, -1, -29, 1, -23, -18, 18, -1, -13, 2, -9, 14, 9, -14, -4, 3, -30, 16, -16, -18, -15, -24, 11, 24, -41, -22, -3, 15, -2, 7, -10, 11, 15, -1, 8, -15, 22, 3, -3, 1, 3, 5, 0, -32, 6, -5, -39, 44, -8, 52, 20, -9, -12, -19, 18, 16, -34, 16, 26, -17, -7, 6, -27, 27, -7, 3, -49, -31, -23, -13, 22, -17, -30, 7, -21, -25, 5, -1, -2, -24, 7, -2, -52, -19, 1, -5, -6, 23, 1, -6, -7, -6, -1, -12, -46, -38, 10, 35, 1, -31, 2, 25, 10, -7, 21, 29, -6, -65, 18, -87, 18, 30, 35, -18, -38, 31, 19, 13, 37, -17, 24, 38, -12, -11, -22, 14, 9, 12, -19, -44, -35, 31, 29, 50, 6, -20, -25, 26, 35, 22, 11, 1, 10, 6, 22, -20, -16, 8, 16, 3, 17, -50, 6, -44, 6, 7, -50, 8, 58, -55, -9, 16, 0, 4, 12, 10, -21, -13, 0, -13, 6, 7, -10, -27, 1, 41, 16, -13, -7, 25, -21, -8, -13, -30, -12, 20, 63, -73, -1, 22, -10, -12, -12, -2, 61, -26, -5, 30, -10, -22, 26, 21, 18, -12, 25, 19, 18, -6, -5, 8, -37, -42, -16, -4, -18, 15, 22, 29, 30, -9, -39, -8, 8, -10, -24, -20, 40, -3, -3, -22, 33, 17, -37, -1, 9, -52, -4, 27, 1, -30, 6, 56, -30, 58, 32, 13, -33, 21, 5, -13, -53, 22, 33, 30, -32, -49, -12, 5, 15, 4, -27, -16, 11, 37, -75, -87, 12, -17, -20, 37, 12, -51, 32, -27, -61, 47, 14, 44, 38, -56, -53, 25, -26, -9, -15, 30, 13, 16, 1, 30, -1, 8, 26, 10, -31, 21, -22, -5, -35, -6, -28, 36, 0, -5, -29, 15, 11, 33, -35, 36, 17, 19, 2, -1, 32, -42, 18, 8, -35, -39, 21, -1, -22, -3, -2, 33, -37, 93, 19, 21, 6, -43, 1, 13, -13, -19, -36, 11, -36, -13, 26, 15, -55, 54, -27, 50, -42, -46, -4, 2, 6, 28, 36, 39, -18, -30, -18, -50, -12, 18, 34, 25, 0, -41, 16, -5, 15, -40, -1, 6, -54, 15, -45, -17, 5, 47, -23, -31, 44, -83, -25, -7, -22, 11, 5, 20, 43, 9, -56, -25, -36, -17, 21, -23, 29, -9, 30, 18, -68, 6, 3, 8, -24, -3, -4, -28, -22, -4, 26, 35, 6, 29, -1, -1, 13, 8, -27, -1, 24, 14, -43, 10, 1, -12, -2, -70, -9, -27, 12, -40, 1, 37, 5, 61, -3, 35, -12, -35, 15, 2, 20, -19, 36, 26, -1, 16, 8, 20, 7, -5, -41, 13, -3, 32, 31, -17, 24, -14, 36, 12, 18, 5, 0, -7, 28, -6, 16, -44, -30, 7, -3, -44, 8, -24, -6, -14, -10, 2, 10, 33, 7, 26, 2, 25, 28, -13, 14, -33, -34, -18, 31, -43, -10, -30, -8, 7, -2, -7, 30, -46, -4, 8, -20, -16, 4, 21, -11, 13, -8, -4, -6, -16, -28, 35, -44, -12, -14, 19, 17, 8, -20, -12, 12, 21, -38, 17, 42, -7, -30, -2, -23, 6, -6, 13, 2, -13, -6, -20, 42, -29, 9, 37, 5, -28, 31, 12, 12, 19, 13, -21, 14, 32, 21, -8, 10, -9, -1, 23, 23, -2, -17, 10, 49, 13, 16, -27, 11, -1, 5, -24, 22, 3, -17, 23, 2, 17, 33, 12, -8, -9, 0, 9, 13, 9, 9, -7, 2, 49, 22, -12, -19, 29, -10, -5, 26, -24, 8, -8, -25, 19, 10, 3, -19, 10, -3, 15, 28, 29, -4, 26, 5, -3, -30, 24, 50, -31, 1, -31, -13, 2, 7, -1, -4, 20, -21, 26, 24, 3, -12, 3, -24, -3, -14, -3, 2, -38, 19, -7, 13, 2, 7, -2, -17, 12, -8, 12, -5, 7, -6, 3, -21, 6, -25, -39, -12, -43, -7, 29, -16, -12, 21, 17, -3, -19, -27, 20, 4, -18, -28, -25, -6, 5, 1, -7, 3, -6, -7, 8, -8, -2, -9, 13, 26, 40, -5, 2, 1, -31, 10, -20, -10, 34, 28, -14, 20, 14, -2, 20, 4, -38, 1, -25, 14, 69, -13, 15, 56, 14, 15, -41, 4, 22, 11, -26, 19, -13, -53, -17, -6, -47, 20, 22, 6, 41, -15, -12, 6, -49, -16, 33, -5, -12, 14, -36, -8, 18, 6, 3, -47, -8, 28, -18, -68, -8, -17, 31, -2, 35, 19, -1, -47, -31, 42, 36, 7, -34, 15, -22, 4, 12, 7, -34, 3, -17, 9, 1, -7, 27, -15, 8, -40, -7, -44, 9, 3, 20, -21, -14, -24, -3, -35, -29, 29, -60, -32, -25, 4, 16, 49, 12, -21, -32, 32, -9, -10, 20, -1, 29, 54, -36, -27, 22, 19, 9, -7, 34, -56, 31, -20, 16, -7, 8, -7, 7, -1, -24, -55, -27, 41, 15, -38, -21, -3, 8, -10, -11, 15, 32, 13, -32, 11, 4, 43, 0, -4, 18, 12, 16, -2, 2, 11, 20, -19, 13, 26, -38, 18, 34, -28, -23, -6, 25, 22, -30, -7, 13, -25, 2, -17, -5, -42, 2, 6, -20, 44, 16, 26, -12, 20, 27, 14, -20, -25, -25, 11, -9, 6, 1, 19, 8, -6, 4, 3, 20, -20, 12, -17, -8, 5, 10, 4, 18, -8, -34, -10, -25, -11, 26, -28, -16, -22, 8, -1, 0, -10, -13, -4, 15, 2, 4, 1, -8, -39, 7, -26, 16, 9, -6, 5, -12, -2, 6, -20, -9, -43, 4, -3, -4, 9, 17, 3, -2, 3, 0, 24, 10, -10, -7, -16, -11, 23, -37, -8, 35, 44, -19, -29, -9, -8, -14, -6, -7, 26, 0, -9, 23, 24, 35, -19, -12, 30, 22, 12, -14, -3, 28, -25, -32, -1, -12, 49, -35, -1, 11, 23, -45, -3, -10, 22, -34, -29, 44, 57, 2, 17, -32, 12, 8, -24, -24, -41, -62, -24, -35, 14, 8, -14, -8, -5, 21, -34, 14, 27, 23, 9, -46, -33, 3, -41, 33, 5, 21, -8, -14, -19, -9, -32, 55, -26, 29, 18, 70, -43, 0, -42, 18, -54, 17, -25, -23, -21, -4, 1, 9, 13, 13, -17, 11, -21, -11, 20, 31, 31, 21, 11, 21, 30, -18, 13, -2, -4, -22, 7, 9, -42, -2, 13, 9, -7, 21, -8, -24, -19, 7, 24, -20, -6, 23, -13, -51, -17, 0, -7, -30, 4, 1, 0, -28, -9, 0, 0, 16, -14, -14, -13, 15, 1, -40, -47, 8, 14, 0, 18, 9, 1, 5, -26, 17, -15, 21, -26, 11, -19, -15, 44, 6, 5, 34, -55, -22, 16, 21, 8, -22, -30, 9, -14, -14, -22, 16, 3, -13, -5, 22, -26, -25, 33, -24, -38, -16, 34, -21, 6, 36, -74, 21, 43, -10, 32, 42, 13, -45, -14, -27, 1, -21, 33, -33, -61, 27, 23, 34, -49, -7, -15, 38, -2, 50, 20, -16, -45, -15, -45, -43, -9, 28, 10, -24, 37, -31, -12, 3, -12, -15, -52, 53, -16, -19, -16, -7, 32, -40, -11, 32, 16, 16, -15, -7, 3, -6, 16, 11, 36, 4, 3, -5, 3, -30, 9, 10, -21, -6, 69, -26, -18, 7, -41, 1, -4, 3, -26, 44, -5, -9, 27, -3, -3, 20, -72, 37, -3, 3, 51, -41, -11, 54, 51, -3, 37, 6, 23, 38, 21, -27, 2, 49, -24, 11, -30, -22, 10, -6, -19, 1, -37, 35, -7, 25, -7, 28, -12, 1, -39, -22, 36, -37, 38, 4, 12, -25, 1, -3, -4, -11, 5, -8, 13, -11, -15, -13, -16, -9, -7, -17, -21, -23, -14, -4, -18, 21, -48, 18, -17, -45, 28, 31, 8, -20, -19, -8, 9, 18, 8, -18, 8, -15, 0, -5, -13, -3, -2, 0, 14, 10, -3, -19, 27, -21, -14, 13, 12, 24, -12, -20, 3, 22, -3, -3, 32, -9, 10, -22, -19, 1, -1, 9, -31, 41, -3, -23, 9, -3, 14, -16, 3, -2, -18, -8, -12, -4, 1, -34, 19, 0, -11, 4, -23, -27, 30, 9, 9, -32, -12, 25, -18, -23, -11, 12, 21, -34, -11, 4, -10, -3, 31, -12, 20, 6, -3, -16, -43, -22, -14, 27, -10, -24, 40, 0, -12, 23, 6, -29, 3, 21, 0, -3, -1, -21, -13, 2, 0, -21, 6, 8, 2, 3, -16, -14, -9, 27, -6, -13, -9, 31, -16, -19, -2, -12, -47, -5, -9, -26, 6, -3, 17, 30, -19, 24, 29, -8, -15, 23, 4, -2, -4, -5, -24, 13, -32, 29, -14, -2, -17, -16, -1, -10, -22, -13, -7, -2, 6, 22, 14, 8, 6, -3, 22, -19, 22, -32, -16, -15, 23, -37, 14, 4, 35, 44, 37, -9, -4, -3, -68, -14, 3, 21, 19, -2, 27, -3, 27, -44, -21, -3, -42, -6, -33, 7, -5, -47, 15, 19, 26, -37, 6, 14, -25, -13, -23, 5, 17, -5, 30, 15, 19, -5, 24, 12, 20, 26, 1, -17, -13, 3, 15, 2, 2, 2, -17, 27, -45, -10, -13, 13, 14, 43, 5, 20, 34, -8, -3, -1, 5, -24, 2, -3, 16, -37, 22, 33, 9, 43, -19, -27, -14, -10, -21, -28, -16, 12, 61, 22, -51, -4, 31, -39, -33, 36, -12, -3, 49, -2, 7, 3, 37, 17, 3, -17, 10, -20, -1, 15, -2, -21, -30, -1, -42, -46, -41, -18, -31, -22, 23, -17, -9, -11, 15, -15, 24, 14, 15, -49, -11, -20, -15, 4, 72, 31, -25, -13, 33, 0, -8, -23, -18, 10, 29, 36, -3, -26, -18, 9, 20, 12, -8, 5, 10, -45, -1, 7, -10, -8, 0, -1, -45, 34, 45, 14, -30, -10, -35, -9, 56, -23, 45, 9, 7, 37, -30, 34, -4, 13, -41, -32, -24, -6, 18, -44, 25, 21, 27, -19, -29, 4, -5, -14, 8, -42, 36, 10, -27, 49, -3, -13, 2, -3, 18, 23, -12, -65, 27, -26, -42, -16, -17, -19, 17, 8, -70, -17, 56, 43, 20, -29, 45, -25, 5, 41, -38, 27, -21, -28, 39, 0, 6, 65, 10, -7, -16, -4, -40, -20, -5, -15, -1, 3, 55, -35, 27, 29, 2, -5, -9, -30, -16, 36, -7, -8, 22, -5, -1, 12, -30, 6, 6, -22, -40, 4, 0, 18, 22, -13, -27, 3, 10, -25, -30, 54, -3, -4, -41, -19, 40, 42, 21, -28, 15, 2, 28, 41, -22, 29, -15, 31, 7, 30, 3, 15, 24, 20, -16, 1, -8, -29, 5, -12, -19, 45, -11, -5, 22, 14, -39, -15, -10, -18, 8, -4, 17, 5, -17, 49, 5, 48, -41, 6, 13, 71, 3, -18, 19, -20, -55, -17, 11, 4, 19, -59, -29, 34, -10, 12, -72, 34, 17, 34, -83, -10, 8, 6, 36, -6, 45, -13, 14, 10, 34, 0, -22, 29, -6, 6, 22, 13, -37, -38, 13, 3, 7, 13, 26, -49, -52, 12, -20, -27, -24, 24, -13, -20, -55, 18, -34, 26, -14, -24, 21, 5, -1, 14, 2, -3, 21, 18, 48, 7, 12, 23, -17, -56, -16, 5, 17, 19, 19, -74, 9, 15, -20, 24, -19, 24, -17, -23, -4, 4, 39, -37, 5, -10, 15, -43, 23, -12, -33, -3, 21, 42, 43, 4, 13, 44, -50, 9, -25, 10, -15, 11, 3, -18, 9, -8, 19, -23, -30, 15, -32, -9, -13, 29, 62, -46, 4, 19, -16, 34, -9, 12, 12, -1, -45, -24, -29, 34, 7, 37, -25, 9, 20, -14, 20, 43, -10, -10, -2, 10, -10, -5, -29, 34, -6, -21, 30, 61, 21, 6, 2, 33, -54, -14, -23, -35, -17, 57, 18, -30, 6, 0, -32, -16, 7, 18, 16, 10, 24, -29, 28, 14, -35, -12, 0, 36, -10, -14, 30, 40, -28, -24, 30, 11, -20, 29, 10, 8, 39, -11, -18, -28, 16, 50, 37, 10, -25, -50, -3, 36, -58, 1, -39, -9, -64, 91, -16, -27, -20, -28, -34, -26, -30, 26, -56, 5, 41, 1, -22, 7, -54, -18, -8, -3, 19, -35, 36, 46, -7, 79, 38, 35, 10, -13, 3, -37, -2, -32, -32, -5, 6, 21, 16, 1, 13, -45, 43, -34, 15, -49, -9, -23, 38, -28, -14, -11, -20, -38, 60, 28, 10, -27, 6, -15, 15, 39, 17, 25, 8, -20, 33, -35, 31, -27, -9, 2, 29, 4, 6, -46, 36, 22, -38, -12, -13, 35, 7, 42, -13, -6, 15, -29, -24, -3, -26, -12, 1, -17, 43, 29, 42, -10, -25, 12, 7, -44, 9, -13, 32, -42, 27, -59, 15, -44, -1, 20, -26, 14, 2, -2, -2, 15, 0, 17, 11, -62, -37, -2, -10, 8, 5, -17, -28, 23, -23, -19, 18, 4, -15, 5, -8, -12, -17, -3, -33, 19, 20, 16, 6, 10, 9, 0, 45, -14, -23, 7, -25, -19, 20, 2, 43, -7, 13, 23, 4, 22, -8, 15, 17, 21, 2, 15, -23, 20, -23, 1, 14, -16, 17, -15, -17, -1, -40, 26, 7, -28, -21, -9, -46, -6, -3, -18, 0, -3, -21, -3, 23, 23, 44, -6, -42, -1, -54, 16, -27, -15, 18, 32, 16, 13, 16, 7, 11, -5, -40, 31, -11, 10, -28, 11, -45, 26, 29, -23, -3, 8, -16, -14, -61, -14, 12, 2, -31, -25, 7, -7, 15, -19, 14, 11, 0, 6, -23, -23, -27, -20, -3, -12, -7, -25, 28, 34, 12, 23, 29, -44, 20, -29, 4, -42, 15, -11, 14, 0, -17, -18, -22, 2, 8, 13, 23, 0, 9, -15, -32, -29, -27, 6, 18, -19, -14, 5, 8, 40, 35, -20, 33, 2, -32, 11, -4, -25, 1, 11, 9, 12, 17, -7, -32, 19, 6, 36, 3, -13, -34, -5, -6, -35, -33, 5, 19, -24, 7, 9, 23, -3, 9, -8, 10, 19, 18, -26, -4, -12, -49, -3, -26, -58, 19, -12, 0, 22, 38, -14, -15, -24, 29, -14, -12, 5, 16, 30, 38, 19, 3, 7, 8, -16, -6, -6, -40, -3, 16, -66, 27, -24, -23, -19, 12, -25, -13, -19, 19, 23, 5, -3, 11, -6, 6, -22, 7, 1, -24, 8, -2, -11, -4, -78, -54, 23, 10, -75, -1, -36, -21, -20, 18, -21, 36, 38, -26, -3, 26, 36, -7, -7, 31, 12, 19, 12, 25, -12, -17, 23, 15, -16, -32, 32, -86, -23, 13, 47, 12, 16, 30, 6, 39, -34, -9, 19, -44, 48, -11, 20, 3, 27, -6, -21, -13, -9, 9, -40, -43, -14, 5, -17, -36, -7, -35, 33, -19, -11, -44, 21, 11, -27, 35, 1, -18, -25, -49, -18, -19, 8, -54, -9, -19, -8, 48, 31, 32, 28, -21, -24, -14, -25, 51, 26, -37, 34, -21, 48, 16, -7, -26, 46, 9, 27, -7, -55, 10, 1, -36, 18, -59, -38, 40, -25, 10, 39, -18, 18, 29, -11, 22, 3, 21, 1, 20, -18, 27, -1, 9, 21, 19, 26, -36, -4, 45, 2, -10, -32, -44, -31, 70, -33, -9, 40, 27, -36, 28, -55, -2, -5, 6, -25, 31, 61, 42, 20, 27, -6, 25, 22, -18, -25, 7, -12, -31, -20, -5, 4, 29, 21, -9, 37, -12, -18, -12, -40, -15, 9, -12, 8, -27, 38, -5, -13, -6, -11, -5, -15, -4, -7, -1, 29, -32, -32, -12, 23, -20, -34, -10, 13, -18, -2, 1, -27, 24, 0, 12, 32, -19, -12, -3, -14, -3, -20, 10, 2, 7, 10, 8, 7, 6, 5, -12, -19, -33, 20, -2, 14, -3, -10, -10, 2, 2, -18, -13, -7, 25, -34, -19, -14, 8, -1, 4, 12, 41, 50, 6, 15, -5, -19, 15, -57, 20, 13, 21, 44, 35, -63, 40, 30, 11, 0, 5, 23, 3, -4, -5, -2, 18, -61, -8, -3, -73, -12, -35, 23, 12, -10, -25, 21, 12, -15, 0, -3, 51, -34, 33, -24, 31, 19, -35, -30, -27, -21, 8, -31, 18, 7, -65, 2, 22, 90, 29, -16, -6, -63, -46, 72, -21, 19, -7, 26, -9, 3, 19, -42, 4, -50, 36, -39, -8, 14, 15, 6, 3, -30, 6, 62, -3, -12, 10, -10, -22, 6, -7, 36, 34, 5, 14, -56, 6, 12, -42, -14, 45, -13, -28, 0, -12, -13, 25, -9, -5, -5, 30, 25, -9, -37, 46, 16, -17, 2, -36, -18, -4, 15, 24, 28, 35, -40, -3, 9, 14, -43, 6, 1, -31, 10, -9, -3, 37, 0, 17, 28, 10, 21, 22, -3, 28, 37, 22, 5, 3, 19, -59, -40, -43, -35, -22, 17, -22, 6, 5, -35, 29, -27, 3, -36, 0, -15, -21, 23, -7, 38, -25, -2, -11, 26, -48, -18, 7, -3, 10, -35, 1, 29, -1, 49, 2, -11, 9, 19, 12, -10, -28, 6, 18, 23, -6, -15, -13, 33, -17, 6, -8, -13, 0, -6, -19, 3, -6, 19, 56, 14, -1, 17, -28, 15, -13, -44, -14, -3, -63, -3, 36, 6, -23, -49, -7, 14, -5, 8, 8, -29, -41, -20, 27, 1, -26, 12, 0, -3, 1, -19, -6, -21, -28, 12, -12, -4, 12, 20, 28, -9, 2, 10, 5, 28, 13, 2, 8, 37, -20, 22, 35, 14, -3, 14, 2, 2, -28, -31, 7, 31, 11, -17, 10, 0, -41, 25, -15, -9, 20, 0, -8, -29, 24, 19, -24, -22, 10, 39, 5, -1, 8, 10, -1, -7, 35, 20, -2, 19, -39, -39, 15, 9, -8, 7, 19, -16, 47, 11, 2, -6, 50, 7, 13, 17, -6, 3, -30, 11, -31, 76, -20, -6, -6, 21, 53, -5, 4, 3, 12, 31, -3, 17, 0, -38, 29, 12, -13, 15, 3, -2, -12, -22, 48, -32, -54, -20, -2, -7, -39, 20, -23, -4, 26, -3, -10, -7, -31, 20, -36, 30, -16, -8, -30, 12, 45, 16, -10, 17, -25, 21, 17, 10, -8, -16, -2, -16, 1, -42, -2, 3, 1, -43, -13, 2, -8, -33, 15, -2, 17, -60, -33, 0, -27, 16, -12, -9, -8, 8, -29, -5, 31, 19, -29, -8, -19, -19, 20, 13, -44, 23, -22, 15, 16, -17, -5, -52, 2, 31, 2, -8, -24, 13, -13, -9, 4, 0, -61, 3, -8, -2, -23, 18, -13, 9, 19, -35, 44, 7, -5, 9, -13, -3, 14, 23, 5, 33, -24, 0, 27, -36, 8, 33, 3, 24, -25, -44, 17, -17, 8, -9, 7, 15, -11, -41, 33, 3, -72, 14, -18, -23, 23, 0, 1, -8, -11, 18, -44, -29, -34, 24, 4, -10, -13, -10, 29, 0, -15, -1, -41, 30, 5, 25, 39, 23, -27, -39, -15, 16, 6, -6, -36, -5, 35, 7, 21, -1, 51, -65, -4, -2, -15, 4, 1, -1, -74, -20, 25, 44, -62, -16, 27, -7, 12, 43, 17, -1, -28, -6, -33, 40, -44, -3, -30, -7, 12, -22, 19, 30, 8, 28, 44, -25, 13, -5, -18, 3, 51, -15, 7, -7, 18, -26, -39, -20, 5, -15, 14, -41, -33, -62, -11, 63, 47, -44, 37, 35, -15, -29, -13, -6, -12, -7, 45, -4, 26, -18, -11, 32, -16, 31, -7, -13, -14, 74, 45, -50, 58, 9, 7, -9, -63, -15, -27, -29, -46, 30, -17, -60, -13, 18, 5, 3, -1, 58, -23, 5, -47, 13, -32, 16, 7, -29, 5, -4, -21, 37, -70, 7, 5, -47, 17, -43, -12, -10, -23, 8, 13, 35, -23, -20, 40, 30, 32, 26, 21, -58, 39, 11, -31, 6, 26, -19, 50, -7, -15, -22, 3, -15, -44, -32, -7, 0, 18, -29, -20, 17, -17, -28, 5, 1, -58, 22, 1, 38, -12, 1, -39, -38, 8, 3, 12, -4, 15, -16, 1, 19, -9, -26, 29, 20, -18, -10, 17, 12, -9, 18, 34, -41, 12, -5, -1, 6, 6, 45, 5, 0, -16, 9, -18, -45, 23, 9, -16, -27, 5, 28, 14, 10, -44, -20, -31, -4, -39, -2, -49, 8, -5, 4, 29, 24, 43, 11, 2, -35, 6, -14, -32, -30, -25, -19, -1, -4, -31, 27, -11, -2, -44, 48, 14, -16, -12, -18, -15, -17, -27, -26, 16, 26, -13, 48, -33, -10, 14, -8, 45, 33, 37, 91, 2, 20, -6, 6, 46, 6, -48, 18, 14, 54, 4, 37, 3, 35, -33, 1, 28, -34, -27, -30, -41, 36, -45, 21, 34, -5, -93, 45, -47, -32, -2, -11, 6, -16, -71, 31, -18, -30, -13, 1, 16, -9, 32, 4, -22, -25, 14, -2, -53, 23, 2, 12, 0, 32, -49, 17, 11, 36, -9, 14, 9, -7, -62, 33, 17, 10, -18, -3, 27, 18, -3, 13, 35, 8, 18, -25, -15, -12, 28, 3, 37, 31, 0, -49, -17, 10, 5, -23, -25, 24, 10, -11, -39, -20, 3, -20, 1, -37, -1, 26, -43, -21, -12, -17, 23, 5, 18, -1, 2, 3, -5, -2, 12, 9, -23, 31, -9, -31, 33, -3, 14, -19, -11, -15, -16, 0, -19, -26, 15, 18, -11, 6, -11, -32, 12, -5, 7, 41, 29, 8, -45, -9, -7, -73, 15, -28, 10, -40, 0, 16, -15, 23, 4, 16, 2, 28, -1, 15, -28, 7, 38, 12, -7, 0, 16, 2, -1, 6, -27, -1, -36, -55, 13, 58, -12, -62, 15, 22, 22, -26, -10, 60, 31, 48, -21, 57, 0, 51, -30, 39, -31, -59, 6, 50, 30, 0, -1, -24, -15, -19, -8, 2, -6, -40, 31, -17, 26, 46, -3, 9, -12, -17, 12, -42, -5, -1, 19, 0, 20, 33, 28, -21, -14, -11, -1, 22, -18, -12, -7, -46, 23, -3, -7, 17, 33, -10, -27, -48, -18, 32, -4, -7, 27, -3, 18, -13, -11, 14, 40, 3, -17, 13, -8, 24, 26, 17, -22, 37, -14, 19, -11, -42, -12, 11, -30, 5, -15, -29, 4, 1, -24, -29, 1, 12, -34, -11, 15, -38, 7, 14, -7, -11, 32, -2, 20, 19, -37, -39, -6, 17, -51, -14, 3, 19, -17, 9, -42, 36, -32, 4, 3, 3, 12, -5, 34, 0, 15, 12, -19, 7, -41, -35, -15, 23, -15, -18, -3, 25, 4, -21, 26, 35, 6, -45, 7, 31, 23, -11, -34, -7, -2, -24, -10, -16, -2, -11, -30, 2, -62, -25, 3, -1, 0, -23, 18, -3, -10, 2, -12, 17, -19, 17, -4, 3, -16, -31, -7, -27, 17, -18, -14, 13, 14, 15, -18, 15, -1, 11, 17, 2, -18, 19, 6, -51, 16, -17, 8, -14, 10, 30, 7, 6, -4, 9, 2, 1, 18, -22, 8, -24, -19, -15, 12, -19, 18, -36, 41, -3, 30, -33, -12, 19, -19, -6, -16, 29, -21, -12, -22, 15, -35, 20, 9, 15, -21, 31, 17, 1, 16, -15, 10, 9, -4, 4, 10, 16, 44, -14, -10, 11, -23, -5, 46, 10, -20, -6, -25, -27, 24, -27, 7, 8, -41, 0, -12, -1, -24, 63, -14, -4, -21, 5, 2, -30, -21, 17, -12, -12, 19, -43, -8, 24, -10, 24, 42, -1, 6, 34, -32, -5, 40, 50, 24, -6, -7, 39, -6, -5, -60, -20, -27, 1, -29, -25, 28, -34, -8, -21, 7, -19, -4, 3, -42, 1, -20, -10, 2, 17, 35, 23, -2, -18, 18, -16, 18, 13, -17, -19, -8, 30, 0, 4, 7, 10, -21, -17, -32, 1, -14, -6, 28} #define DS-CNN_conv_ds_1_pw_conv_biases_0 {24, 26, 36, 58, 83, 33, -15, 84, 4, 98, -8, 36, -55, 23, -4, 44, -21, 56, 45, 37, 81, 6, -7, 47, 20, 45, 40, 38, 18, 36, -34, 42, 22, -27, 55, -16, 22, 48, 17, 44, 19, 83, -15, 22, -8, -28, 67, 38, -38, -8, 98, 67, 48, 30, 49, 21, 28, 61, -24, 23, 52, 75, 26, 52} #define DS-CNN_conv_ds_2_dw_conv_depthwise_weights_0 {8, -43, 19, -46, -15, 20, -14, -26, 2, -43, 26, 30, 5, 29, 40, 43, 13, 23, -11, 6, -12, -11, -10, 15, 57, 12, -22, 23, -14, 35, 24, -1, 5, 8, 15, -19, 26, -32, 32, 32, 12, 21, -11, 50, 30, -9, 31, 46, 8, 36, -56, -18, 8, -15, -21, -15, 29, -44, -18, 27, 4, 2, -8, 15, -11, -20, -13, -34, 47, -14, 17, 21, -5, 43, 3, 5, -15, 36, -16, 5, -29, 19, 18, 47, 9, -15, -7, -3, -12, 5, 12, 8, 6, -7, 16, 28, 1, 0, -1, -9, 2, 12, 37, 18, 5, 9, -1, 42, -7, 7, -21, 24, -13, -26, 16, 16, -30, 24, -25, 5, 23, -53, 18, -12, -13, 17, 0, 20, 0, 12, -15, 16, 5, -12, -4, 15, -15, -20, -4, 33, 26, -5, 0, 1, -38, -24, -5, -16, -33, -28, 23, 14, 4, 27, 33, 42, 8, 18, 29, 4, 6, -24, -11, -1, -5, 37, 24, -5, 19, 11, -12, 19, -4, -4, 19, -18, 10, 10, -16, 20, 9, -21, -31, -12, -19, -10, -13, -16, 29, -31, 1, 8, 9, -21, 19, -26, -8, 3, -11, -5, -14, 15, 5, 5, -3, 26, -14, -12, 12, -2, -14, 11, -13, -3, -5, 42, 12, 19, 0, 6, -22, -6, -24, -13, 17, 10, 18, -10, 17, 25, 8, 10, 2, 27, 12, 33, 10, 23, 7, 3, -5, 17, -2, 19, 28, -1, -12, -11, 18, -31, -13, 15, 53, -4, -13, 19, -9, -11, 2, -33, 8, -1, -3, 20, 33, -2, -6, -1, -10, 23, 18, 4, -17, -18, -6, -14, 14, 20, 6, -26, 4, -10, -10, 23, -7, 11, 8, 36, 4, -1, 14, 10, 6, 8, 14, 15, -14, 20, -5, -3, -7, 6, -6, 11, -2, 16, 12, -21, 2, 2, -29, 7, 0, -11, 8, 2, -13, 36, -8, -11, -15, -18, 21, 4, -12, -10, -9, -1, -3, 16, -5, 21, 13, -31, 17, -7, 1, 21, 18, -41, -8, -2, 15, 21, -7, 39, 8, 3, 11, -8, 29, 8, 11, 3, -3, -9, -19, -44, 3, 2, 14, -14, -14, -10, 1, 3, 8, -41, 11, 6, -3, 10, 18, 1, 2, -16, 3, 10, 7, 2, 8, -39, -14, 4, 10, -24, 14, -43, -5, 21, -18, -1, -13, 9, 12, 22, 18, 45, -6, -43, 56, 73, -12, 16, -35, -36, -12, 8, -80, -16, -25, 22, -18, -26, -30, 14, -3, -13, 16, -15, 20, 53, 24, 5, 1, 47, 9, 12, 16, 12, -8, 0, -20, -37, -19, 27, 1, 39, 6, -31, 4, -7, 23, -4, 30, -42, -6, 25, -7, 7, 6, 31, 3, 6, -24, 14, 27, -3, -6, 1, -27, -15, 33, 39, -12, -4, 19, 12, 23, 29, 25, 0, 51, 77, 10, -14, -21, 21, 36, -11, 29, -33, 21, 1, -3, 4, -1, 20, -25, -2, -24, -36, 0, 9, 8, -10, -14, 11, 24, -20, 19, 23, 21, -10, -1, 4, -16, 2, 41, 31, -15, -5, -19, -36, -1, 44, -4, -13, -16, -18, 1, 12, -1, 21, 17, -40, 23, -6, -8, 66, 2, 11, -13, -17, 22, 71, 16, -8, -11, -40, -4, -11, -8, -14, -1, -25, -1, 11, -22, 16, 18, 12, 24, -37, 11, -5, 8, 6, 6, -14, 10, -14, -28, -2, 29, 4, 45, -9, -12, -4, 22, -15, 35, 26, -21, 5} #define DS-CNN_conv_ds_2_dw_conv_biases_0 {20, 67, -17, 45, -6, 3, 47, -23, -7, -24, -4, -49, 11, -19, -50, 4, 6, -48, -13, -26, 37, 30, -13, -62, -18, -55, 15, -48, 45, -14, -12, -34, -30, 42, -24, 33, -9, -23, -76, -51, -14, -31, 27, -20, -15, -19, -15, -4, 14, 1, 44, -20, -45, -6, 23, 44, -18, 82, -14, 2, -47, -12, 52, -33} #define DS-CNN_conv_ds_2_pw_conv_weights_0 {-54, 1, -53, -23, 20, -27, 24, -58, 7, 12, -5, 17, -19, -17, 4, 26, 41, -7, 12, 18, -23, 6, 4, 5, 18, 31, -29, 40, 29, 48, -47, -12, -25, 5, 45, 3, 13, -14, -50, -1, -16, 13, 38, -19, 14, -52, -5, 19, 7, 6, 17, 46, -4, 19, -11, 8, -22, -24, 14, 16, -12, -14, -38, -48, 26, 2, 3, -12, 20, 17, 26, -13, -2, -1, 19, -33, 20, 27, -22, 24, 17, -42, 7, -7, -13, 5, 6, -11, -30, -12, -3, -12, -24, 5, 51, 7, -16, 75, 15, -36, 0, 17, 12, 45, -19, 8, 5, 21, -17, 28, -48, -8, -12, -5, -14, -60, 22, -18, 9, 24, -48, 10, -21, 50, 7, -26, 14, -27, 10, -24, -7, 16, 31, 1, -11, -1, -51, -12, -40, 1, 17, -27, -10, 21, 22, -9, -3, -16, 6, -21, 23, -11, 57, 22, -23, -28, 3, 2, 6, 10, -10, -19, 31, 30, 15, -29, -13, 14, -33, 28, 1, -12, 15, -55, 15, 22, -48, 6, -42, -8, 15, 26, 53, 16, 6, 25, -39, -1, -20, -15, 19, 15, -7, 16, -12, -5, 8, 33, 25, 0, 4, -30, -8, -20, 7, 11, 11, 9, -8, 7, -8, -13, -28, 10, -19, -9, -7, -18, -5, 22, -7, -26, -12, -13, -27, 25, -2, -40, 11, -8, -18, 30, 5, -20, -15, 30, -5, 3, -20, -18, 23, 4, -1, -2, -5, 19, -14, 10, -22, -12, -29, -19, 9, 10, 13, -22, 23, -12, -40, 12, -19, 45, -21, -8, -29, 27, 21, -22, 6, -12, -10, 13, -57, 4, 40, -28, 28, 5, 6, -8, -4, 31, -36, -6, -2, -25, 46, -15, 21, 33, -10, -20, -17, -4, -3, -19, -37, -3, 23, 57, -23, -18, -15, -20, 1, 26, 23, 9, -30, 2, -9, 6, -14, 37, 11, 55, 20, -28, -76, 27, -9, -38, 24, 25, -25, -43, 4, 16, -22, 27, -8, -14, -20, 22, 22, -38, 10, -20, -26, 16, 63, -37, 8, 39, 11, 14, -27, -18, -9, -2, 27, 7, -9, 40, 26, -4, -2, 31, -11, 8, 6, 20, 12, 11, 3, -2, 27, 29, -76, 9, 34, 20, 3, -28, -6, -32, 4, 21, 19, -1, 0, 9, -32, -7, 11, -31, 21, -2, 46, -37, 25, 2, 14, -4, 1, -28, 32, -6, -48, -16, -36, -21, -21, -28, -20, -10, 47, 35, -36, -2, -18, -3, 7, -40, 8, -6, -2, -46, 52, -6, 0, 51, 3, -15, 18, -20, 6, 51, 36, -36, 17, -9, 28, 30, -25, 40, -4, 23, 25, 44, -6, 7, -2, 20, -9, 14, -38, -3, 13, 15, -29, 5, -49, -8, 9, -4, 1, -5, 42, 1, -28, -1, -12, -13, 44, -9, 29, 26, -57, 8, -60, 19, -3, 30, 51, 6, 51, 19, 7, 27, 33, 12, -18, 13, -45, 16, 0, 18, -50, -32, -32, -55, -32, 39, 7, 39, 13, 30, 31, 4, -15, -39, 2, -5, -22, -19, 14, 19, -17, -20, 18, -14, -3, 2, 0, 48, -55, 27, -14, -13, 7, 16, 7, -4, -24, 11, -22, -5, -8, 40, -21, -4, -25, 23, -16, -24, 17, 4, 15, 32, -19, -18, 25, -33, 30, -75, -25, -21, -53, 37, 37, 3, 20, 39, -9, 12, 33, 35, 3, -13, -9, 33, -4, 9, -38, -4, 27, 13, 14, -15, 21, -1, -3, -25, -19, -8, -26, 15, -10, -8, -12, 20, 25, 4, -20, 6, 32, -14, 22, 2, -10, 0, -57, -10, 33, -2, -45, 36, -39, -22, 0, -20, -41, 30, 21, -14, -39, -16, 22, 34, -1, 5, 26, -12, -16, 35, 17, 16, -16, 29, 16, -23, -7, 26, 35, 5, 10, -14, -4, -10, 1, 23, -15, -6, 10, 2, -8, 7, -1, 16, 11, -15, 28, -3, -11, -4, 12, -9, -18, -25, 10, -18, -26, -38, 32, 12, 4, 34, 45, -13, -5, 43, -25, 19, 36, 20, 14, -30, -34, -26, 24, 21, 14, -1, 30, 14, 18, 14, -1, -36, 0, -39, -21, -19, -6, -14, -16, 19, 5, -51, -10, 64, 9, -22, 54, -19, 7, -11, 27, -46, 7, -33, -35, -25, -39, -22, -9, 22, 11, 35, 5, 0, 14, 41, -10, -1, 40, -19, -44, -47, 7, 5, -6, -14, -15, -21, -10, 1, -55, -44, -23, 42, 6, 11, 17, -1, 26, 37, 40, -5, -42, 1, 11, 10, -12, -40, 1, -3, -32, -7, 4, -16, -15, -40, 4, -38, -5, 16, -34, 3, -26, -5, -20, 21, 8, 9, 27, 8, 36, 36, 10, -9, 19, -17, -14, -14, -50, -11, 25, -15, -38, 17, -25, -21, 33, -50, 27, -20, 47, 46, -25, 6, 26, 32, 0, -25, 43, 15, -18, 9, -12, -6, 8, -5, 15, -15, -18, -15, 25, 24, -27, 23, 2, -24, -5, -27, -10, 11, -53, 65, -5, -56, 17, 5, 38, 12, -41, -29, 23, -25, -13, 17, 34, -45, 0, -33, -29, -14, -24, 27, -9, 11, 28, -37, -23, -4, 26, -9, 4, -1, -9, -23, 20, 2, 14, -1, 57, -1, -23, -9, -44, 38, -17, 7, 8, -19, 9, 7, -1, -42, -4, -42, 8, -1, -26, 25, 32, 0, -41, -14, -50, -24, 2, 11, -33, -18, 7, 4, 24, -6, 9, -14, -14, -2, 12, 4, 23, 29, -34, 7, 20, 7, 1, -15, 1, 8, 0, 7, -23, 42, -22, 26, 3, 15, -17, -23, 20, 5, -31, -28, -13, -11, 5, -38, -19, -26, -25, -9, 3, 14, -40, -5, -33, 5, -5, -19, 39, -41, -28, 0, -36, 15, 11, -12, 20, -15, 31, 30, 13, -9, 14, 35, 25, -5, 5, -17, -7, 2, 6, 37, -1, -22, 6, -34, 19, 39, 31, 4, 21, -28, -14, -12, 58, 13, -9, 26, -14, 19, -33, 36, 6, -2, -24, 16, 12, 13, 41, -12, 5, 34, 4, -6, -8, 47, 23, -23, -22, 24, -41, 11, 49, -1, 20, 43, -2, -17, 0, 16, -31, 33, -27, 16, 20, 40, -3, -26, 6, 20, -59, 14, 16, -39, 33, 9, -17, -3, -29, -17, -9, 13, 42, -3, -44, 25, -34, 5, 11, 11, 7, -12, 12, -24, 23, -20, 7, -27, -18, -26, 18, 41, 7, -12, 11, -1, 11, -14, -2, 1, 0, 4, 19, -23, -13, -9, 0, -3, -55, 36, 10, -20, -27, -17, -26, -38, -6, 23, 4, 36, 12, 21, -29, 17, -5, 33, -8, -12, -15, 27, -7, 31, -17, -8, -17, -15, -44, -6, -6, -35, -45, 0, -41, 26, -20, 24, 13, 23, -17, -14, -17, -19, -39, 15, 31, 14, -50, -29, 38, -44, 16, 18, -3, -17, 9, -1, 23, -9, -9, 3, -2, 13, -8, 24, -38, 25, 23, -14, 24, -1, 4, -27, 20, -18, -6, -51, -6, 7, 24, 10, -36, 21, 6, 5, 42, 38, 29, 17, 60, 14, 10, -31, -16, -15, 38, 34, 5, 12, -29, -27, -39, 10, -8, 26, 40, -16, -39, 0, 22, -11, 5, 6, -17, 23, -11, -7, -40, 20, -20, 9, -38, 10, 9, -3, -16, -17, 9, -20, -23, 30, 15, 7, -33, 24, 0, -20, -25, -58, -12, -23, 12, -46, -41, 30, -10, 43, 34, 20, -4, 23, 3, 12, -37, 3, -63, -36, -27, 42, -15, 19, -42, 22, -23, -20, 12, -8, 25, -26, -30, -10, 10, -30, -4, 39, -24, -17, 49, 27, -20, 0, 13, -3, -15, 17, -14, 22, -18, -3, 37, -36, -7, 8, -41, 11, 4, 0, 13, -44, -14, 6, 30, -9, -18, 32, 17, 25, 21, -6, 13, -24, 1, -10, -3, -2, 22, 12, -21, -46, 13, -6, -36, -6, 7, 34, -3, 36, 0, -23, -6, 12, 5, -21, -27, -5, 21, 15, -8, -20, 5, 27, -18, -9, 22, -1, 11, -27, 7, -13, 12, -19, 18, 14, -17, 1, -8, 44, -11, 6, -16, 3, -12, -16, 2, -4, 15, 2, 4, -33, 8, 30, 22, -16, 4, -17, -37, 32, 4, 14, -41, -6, -39, -4, -17, -19, -35, 17, -30, -20, 18, 4, -21, -2, -16, -3, 20, -15, -6, -7, -14, 8, 10, -4, -20, 5, 7, -4, -21, -15, -10, -12, 2, -19, 6, 1, -15, 13, 3, 10, -9, -8, 20, -19, -19, -15, -11, -3, 8, 14, -11, -32, 10, 3, 5, -28, 35, 2, -14, 11, 3, 28, 2, -21, 13, 15, 17, -2, 9, 18, -36, 16, -38, 19, -31, -2, -19, -1, -23, 15, 17, -8, 3, -5, 11, 13, 2, 19, 6, 0, 18, 6, -25, -38, -2, 1, -38, 23, 35, -22, -21, -39, -20, -18, -24, 11, 20, -33, 9, -13, 47, 30, -25, -33, 4, 12, -6, 23, 29, 15, 22, -6, -38, 25, -35, -2, -9, -7, -19, -3, 32, 2, 12, 27, 7, 8, -41, -4, 11, 2, -1, -9, 21, -29, 9, 8, -13, 25, 5, -9, 38, 15, -14, -27, -20, -42, 6, -3, -11, -29, 25, 21, -33, -16, 13, 10, 23, -13, -17, 26, 5, -2, -13, 7, 27, -10, 13, -22, -20, -10, 34, 1, 34, -2, -10, -24, -20, -18, 27, -31, 34, -3, -28, 10, 12, 1, -23, 7, 27, 26, -42, -13, 18, 17, -7, 38, 62, 32, 4, 18, 3, 14, -20, -38, -14, -3, -10, 13, -3, 32, -12, 9, -14, 44, 32, 9, 6, -49, -7, 14, 7, -2, -3, -12, 4, -44, 18, 28, 11, 30, -30, 38, -5, -18, 23, -28, -11, 0, -25, -5, -2, -27, -38, -47, 13, -11, 21, -57, -41, 23, 0, -17, -13, 20, -19, 2, -12, -21, -4, 23, 1, -9, -1, -31, -12, 5, 16, -13, 17, -12, -22, 12, -5, -13, 2, 2, 6, 6, -3, 2, -16, -18, -8, -10, -15, -15, -27, -38, -3, 13, -4, -30, -7, -26, -7, -13, -5, 16, -17, 7, -25, -13, -12, 12, -10, 17, 10, 3, 2, 6, 8, -26, -11, -30, 8, -19, 7, 15, 2, 26, -6, 3, 15, -14, 7, 0, -22, 1, -9, 33, -2, 1, 14, 19, -44, -13, -15, -2, -30, -6, 1, -5, -6, -19, 28, 21, 6, -16, -1, -1, -30, 79, -14, 26, -13, 1, -8, 16, -1, -4, -2, 17, 5, 10, 7, 41, -10, 10, 15, 25, 43, 10, -24, -12, -18, 57, -45, 16, -9, 1, -3, -48, -7, 48, 11, 31, -8, -43, -39, 3, 42, -7, -21, -6, 0, -29, -35, -14, 13, -16, 12, -36, -30, -13, -11, 5, 15, 12, -9, 1, 20, -35, -34, -16, 42, -13, -3, 20, 62, 12, 44, -6, -14, -32, -15, -40, -17, -30, -11, -17, 34, 21, 22, -11, 18, 28, -21, -2, -1, 4, 24, -27, 15, 19, -14, 4, -12, 18, -5, 1, 2, -40, -7, -7, 4, 18, -26, -1, 0, -16, 56, -6, -39, -8, -16, -22, 3, 21, 25, 12, 13, -8, -44, 18, -24, -26, 13, 22, 37, 11, -1, -19, -26, -6, -30, -3, -2, -6, 2, -16, 38, -5, 7, -2, 11, -52, 7, -22, -2, -29, -14, -3, 17, -7, -26, -17, 50, -6, 9, 14, -11, -7, 20, -21, -7, 14, -8, 9, -47, 36, 7, 20, -10, 3, 32, 12, 16, 1, -16, 11, -2, 44, -33, -45, -60, 51, 15, -42, -16, -23, 6, -10, -47, 15, -4, -37, -31, 9, -27, -25, 9, 12, 24, 22, -13, 46, -9, -12, 27, 12, -13, -7, 23, 31, -22, -47, -12, -28, -37, 45, 35, 28, -57, -13, -6, 0, 1, 10, -25, -11, 9, 5, 47, -27, 0, 22, 32, 16, -27, 23, -4, -25, 3, 29, -21, -9, 23, 17, -15, 21, 14, -45, -8, -16, -6, -23, -45, 38, 29, -11, 8, 19, -19, -47, 20, 25, -16, -13, -40, 4, 24, 29, -34, -41, -20, 35, 17, 39, -21, 11, 5, -34, -19, 37, -7, 26, 7, -6, 22, 1, 23, -23, 7, 17, -15, -26, -9, -26, 19, 7, 17, -22, -41, 36, -6, -12, -14, -45, -10, -23, -6, -39, -12, -40, -12, -3, -80, -16, 13, 21, -31, 15, -48, 10, 23, 27, -15, 45, 5, 32, 7, 9, 5, 8, -13, -34, -25, 48, 16, 2, -5, 20, -9, 12, -8, 27, -2, -3, -21, 49, 0, 31, 15, 26, -25, -49, 3, 36, -35, -9, 25, -41, 19, -25, 40, -21, 27, -18, 27, 26, -3, -15, -16, -61, -13, -24, 25, 1, 40, -31, -23, 27, -35, 6, 3, -11, -4, -16, -7, 8, 64, 58, 15, 2, 6, 6, -18, 17, 4, -30, -36, -17, -16, 7, 46, 34, -24, 35, -11, -7, -34, 39, -15, -24, -22, -6, 14, 25, -44, -9, 24, 12, -16, 42, -25, -5, 9, -16, -28, -27, -34, -28, -18, 28, -22, -26, 10, 2, 24, -18, -29, -21, -15, 15, 35, 7, -24, 30, 21, -21, 11, 16, -34, -37, -15, 21, -15, -6, 30, -27, -10, -21, 2, -17, -1, -5, 6, -18, -22, -16, 6, 20, -32, -25, 38, 5, 33, -4, -1, 27, 26, 12, -12, 8, 15, 50, 8, -41, 30, -9, -49, 29, -11, 11, 33, -3, -26, -14, 15, -6, -10, 30, -42, -8, -20, 22, -42, 39, -22, -7, -35, -50, -20, -2, -24, 12, -24, -6, -19, -7, -16, 34, 4, -12, 6, -10, 13, -3, 16, -5, -5, -45, -6, 18, -57, 12, -15, 31, -15, -31, 32, -23, 31, -13, 50, -24, 44, 9, 28, -5, -56, 42, 33, 13, 1, 3, 9, 4, 24, 20, 28, 23, 21, -4, 40, 22, -31, 31, -32, 12, -3, 20, 10, 0, 60, 9, 3, -37, -14, -4, 3, -30, 24, -16, 14, -11, 20, -2, -21, -6, 10, -18, -15, -20, 3, -11, -27, -29, -52, -14, -14, 28, 3, -44, 1, -19, 35, -14, 6, 21, 18, 17, -22, -13, -5, -27, -23, -16, 7, -32, -32, 29, -8, 30, 24, -30, -8, -22, -17, 12, 24, -45, 11, 47, 6, -51, 19, 1, -34, -5, 21, 29, -44, -14, -24, 9, -43, -6, 20, 27, -24, -26, 20, -55, -2, 8, 16, 27, 12, 35, -83, 17, 28, -16, 30, -3, -27, -12, -2, -2, -37, 36, -1, -12, 12, -7, -27, 42, 7, 6, 8, 4, -5, -60, 28, 24, 22, 26, -3, -24, -8, 27, 1, -27, 26, -50, -1, 7, 30, -26, 16, 12, -24, -25, -57, 23, -14, 0, 6, 17, -44, -27, 43, -39, -37, -1, 31, 33, 4, 44, -26, -15, -9, 7, 6, 14, -7, -39, 16, -10, -35, 4, -38, 35, -55, -60, -7, -11, -25, -30, -6, -9, 22, -18, 42, -9, -2, 9, 52, -28, -12, 22, -41, 46, -47, 45, -33, -8, -50, -23, -5, 14, 2, -16, -37, -8, -19, 16, -5, 33, 14, 28, -28, 31, 46, 29, -35, 11, -14, -13, 3, -20, 8, 6, -5, 22, 15, -11, 39, 22, 9, -10, -28, -27, -7, -49, -43, -13, -15, 10, -44, 27, 8, 36, 14, -48, -15, -32, -36, 17, -20, 7, 11, 27, -22, 24, 26, 6, -8, 19, 18, -7, -10, -24, -2, -8, 17, 52, -14, -9, 21, 15, 11, 7, 4, -16, -10, 9, 11, 18, 19, 7, 19, -9, 23, -3, -37, -8, -18, -7, -14, -2, 8, -21, -2, 15, -17, -26, 13, -2, 13, -31, 8, -29, -23, -10, -25, 1, 5, 3, -7, 4, -4, -19, 9, 21, -26, -22, -40, -21, 7, 7, 1, 7, -1, 31, -12, 28, 3, 21, -24, -12, -6, -29, -3, 25, 24, 17, -43, -1, 1, 2, -6, 10, -26, -25, -14, -17, -20, -9, 27, -21, -17, -19, -5, 6, 11, 12, 6, -13, -5, -10, -22, -1, 23, -10, 21, -4, 2, -9, -34, -17, -7, 30, 29, 5, -16, 3, -37, 6, -24, 24, 16, -24, -15, -26, -8, 27, 21, -8, 13, 15, -31, -3, 0, 8, 9, -3, -16, -8, 13, -16, -18, 23, -31, 10, -29, -19, -2, 8, -21, 17, -5, 25, -4, 18, 11, 30, -41, -16, 8, 9, -25, 27, -33, 22, -64, -9, -72, 40, -3, -9, -4, 5, -40, -36, -17, -27, 42, -13, 18, -10, -3, 11, 28, 64, 28, 26, -40, -10, -15, 0, 16, 9, 11, -9, -30, -24, -1, -20, -6, -12, -19, 26, -23, 18, -4, 5, 9, 35, 35, 0, -45, 5, -37, -9, 15, -16, -2, -33, -13, 46, 10, -22, 35, 41, 20, 14, 20, 15, -20, -2, 3, 33, -5, -24, -8, 5, -1, -18, -16, -18, 15, 0, -24, -22, -22, 6, 11, -8, 10, -15, 9, -19, -33, -11, -1, 21, 24, 18, -16, -34, -28, -10, 5, -32, 2, -43, -36, -10, -9, -8, -10, -23, 7, 7, 3, 1, 24, -13, 20, 38, 22, 17, -24, 21, 3, -12, 15, -18, -23, -3, -38, 9, -27, -8, -26, 2, 6, -31, -20, -13, 16, 15, -27, -23, 5, -4, -7, -21, -11, -15, 9, 49, -16, -5, -1, 12, -16, -28, 1, 0, 10, -31, -36, 8, 2, -9, 10, 13, -7, -20, -28, -19, -7, -28, 21, -4, 34, 34, 24, 6, -1, -21, 33, -9, -8, -8, 14, 9, 9, 22, -29, 21, -6, 6, -4, -32, 11, 20, -4, -13, 15, -44, -3, 12, 3, -21, 17, 28, -11, 7, -2, -24, -3, 3, -12, 18, 5, 42, -16, 7, -31, -29, -5, -33, 1, -1, -8, -18, 19, 36, -23, -30, 17, 7, 6, 48, -3, -13, 13, -22, 29, 20, 18, -30, -38, 2, -49, -6, 28, 18, 30, 13, 8, 18, -16, -19, -47, 15, 11, -20, -36, -47, -7, 26, -4, -5, -14, 26, 7, 26, 3, -40, 12, -15, 0, 26, -43, -35, 30, -11, 26, -37, 9, -1, -22, 27, -9, 32, -12, 10, -30, -20, 17, 31, 13, -34, 1, 16, -22, -20, -17, -10, -11, 1, -16, -21, -42, 8, 13, 4, 8, 1, -17, -3, -33, 2, 9, 36, -1, -50, 1, 29, 37, 22, 3, 37, 13, 29, -13, -40, 27, 5, -52, 17, -21, 3, -16, 11, 15, -13, -40, -34, -12, 16, 11, -14, 4, -13, -12, 3, -17, 32, 29, -42, 4, -89, -6, -7, 25, -1, 8, 50, -19, -29, 43, -31, -4, -30, -28, 16, -9, -13, -16, -10, -61, -10, 19, 58, 7, -20, -54, 18, 0, -32, 8, 34, 14, -67, -35, -21, -42, 15, -31, 0, 11, -6, -31, 3, -16, 29, 45, 46, -18, 17, 7, 23, -40, 25, 5, -13, -47, -3, -15, -22, 29, 24, 14, 24, -11, 2, 6, 5, 45, 24, 13, 3, 6, -23, 3, -6, 6, 50, -15, 7, -32, -25, 13, -2, -15, 28, 11, 4, -34, 15, 14, 10, 8, -46, -26, -21, -14, 18, -11, -16, -43, -27, -42, -19, -9, -23, 9, -18, -42, -4, 4, 19, 23, 2, 4, 4, -32, -32, 24, 13, -14, -5, 7, 46, -8, -18, -9, -4, 30, -17, 2, -31, -39, 0, 3, 14, -20, -23, 17, -26, -22, 0, 18, 16, 20, 33, -26, -2, -14, 31, 48, -11, 13, -45, 8, 44, -7, -18, -9, -13, 11, 9, 23, -32, 28, -9, -46, 31, 13, -38, -14, 12, -9, 40, 17, 1, -17, 23, 16, -2, 8, -21, -9, 25, 16, -38, -16, -5, 15, -17, 4, 13, 9, -10, -37, -48, 7, -21, -7, 20, -14, 16, -5, -13, -15, 26, 7, -15, 30, -12, 24, -4, 29, -27, -26, 8, -29, 3, 17, 1, 15, -12, 21, -17, -21, 35, -5, 32, -7, -28, -49, -17, 8, -31, -9, -12, -13, 20, -12, -7, -8, 6, -13, -47, 46, 18, 40, 4, -34, 1, -37, -28, 1, 18, -15, 5, 26, 19, 12, 32, 11, -2, 19, 4, -5, 29, -9, 18, -18, 16, -30, -42, 52, -55, 23, 6, 25, -3, 2, -3, -4, 46, 31, 3, -42, 26, -1, 30, -18, -12, -17, 0, -38, 23, -6, -6, 16, 26, -39, 26, -29, 6, 14, 23, 4, -28, 31, 23, 12, 13, -6, 3, -24, -38, -2, -11, 1, 33, 25, -19, 7, 32, 27, -8, -35, 22, -13, -14, 18, 51, -15, -10, 46, 40, 16, -12, 35, 13, 0, 15, 0, -19, 3, 11, 11, 6, -20, -18, 20, 21, 23, 30, 22, 6, -8, -4, -23, 9, -7, -6, 17, 11, -13, -29, -4, 12, -25, -11, -41, -40, -2, 56, 35, 5, -48, -23, 25, -21, 32, -2, 5, 14, 10, -6, -2, -26, -45, 14, 13, 6, -20, -26, -22, -8, 7, 48, 32, -15, -31, -11, 8, -21, 24, -20, 12, -13, -17, 7, -19, 4, 23, -17, 30, -31, -29, -2, -13, -10, -50, -20, 10, 29, 0, 56, 13, -21, -36, 3, -26, 39, -46, -5, 17, 4, 44, -8, -46, 44, 2, 14, -18, -46, 11, -53, 40, 1, -27, 2, 13, -41, 33, 27, 7, -15, 27, 25, -2, 12, -28, -1, -22, -30, 14, -7, -21, -25, -10, -1, 24, 18, -23, -34, 39, 24, 8, -51, -51, 12, 13, 49, 6, -28, 4, 63, 6, -41, 17, 21, -55, 34, 9, 83, -34, -18, 2, 2, -19, 28, 25, 22, -64, 1, -14, -6, 46, 51, 51, -3, -25, 9, 16, -57, -6, 8, 30, 9, -13, -28, 3, -9, 18, -13, -17, -41, -24, 30, -11, 8, 36, 13, 51, -2, 7, -13, -28, 63, 31, 7, -2, -27, -4, 8, 5, -15, -11, -54, 30, -34, -45, -17, 32, -2, 17, -8, -22, -6, -27, 16, -25, -17, 6, 37, 42, 40, 29, 25, 40, -11, 11, 31, -47, -46, -23, 23, 1, -8, 19, 31, 12, -4, -30, -26, 21, 34, -39, 17, 5, 10, -43, -3, -7, -31, -24, -8, 16, -20, 16, 31, 3, 7, -35, -2, 14, 10, -27, 3, -38, 19, 8, -8, -2, 2, -43, 18, -12, 14, 14, -3, 50, -27, 11, -36, -20, -17, -3, -14, 0, 11, -5, -6, 18, 1, 8, 19, 16, 34, 33, -10, -16, -46, -18, 12, 34, 27, 19, -9, 47, 10, 26, 41, 16, 2, 2, -51, 18, 13, 14, -18, 7, 28, 12, -5, 18, 24, -6, -15, 18, 39, -10, -15, -20, 42, 8, 15, -20, -3, -5, -24, 2, 1, 31, -9, -10, -16, 15, 15, 1, 34, -12, 17, -13, 19, 18, 12, -11, -16, 41, -10, 11, -19, -4, -18, -2, 7, 24, -16, -20, -3, -38, -34, -2, -31, 1, -1, -12, -8, 33, -8, 0, 57, 29, -28, 67, 39, -14, 8, 21, -6, 19, 8, 24, -25, 13, -14, -13, 66, -5, -12, 5, -28, 13, 8, 17, 7, -5, 30, -20, 38, -1, 5, -35, -36, 36, 15, 9, -49, 1, -11, 21, 9, 23, 2, -11, 19, 35, -14, 11, 12, 1, 46, 38, -6, -5, -14, 19, 3, 46, -19, -21, -41, -6, -17, 6, 18, -6, -9, -4, -1, -2, 14, 8, -7, -15, -28, -17, 11, 13, 7, -19, 13, 11, -48, 22, -37, -26, 9, -55, -3, 31, -25, 2, -37, -20, 17, 34, -5, -2, -42, -58, 16, -31, 21, 12, -5, -36, 34, -11, 5, -12, 33, -13, -38, 5, 9, -36, 27, -30, 11, -3, 12, -48, -20, 5, -3, 61, -43, 15, -21, 2, 26, -48, -11, -4, -24, 12, 23, 35, -31, 9, -14, -5, 11, -6, -2, -21, -17, -28, -4, -32, 11, 36, -16, -31, 20, 0, 17, -67, -16, 0, 19, 32, -19, -27, 19, -8, 20, 0, -32, -22, 20, -11, -18, 12, 8, -12, -40, -4, -17, 8, -22, -4, 10, -30, -13, -21, 25, 8, 7, 23, 6, 1, -12, -11, -5, -6, -21, 2, 3, -29, -5, -17, 17, -28, 4, 3, 11, -4, -7, -2, 6, 0, 44, 35, -18, -4, 16, -16, -44, 6, -37, 22, 18, -2, -28, 5, 34, 18, -6, 8, -20, 32, -3, 40, 9, -22, -26, 16, -6, 8, -11, -20, 0, -65, -15, 24, 12, -23, 26, -43, 20, -7, 3, -12, -25, 20, 27, -9, -26, 15, -5, 18, -5, 10, 46, -34, -17, 28, -20, 28, 2, -44, 28, -27, -17, -8, 1, -20, 16, 7, -19, -16, -13, -2, -8, -3, -26, 15, -29, -22, -17, -39, -3, -25, -13, -7, -23, 43, 42, 35, 9, -32, 1, 3, -16, -28, 40, -22, -8, -41, -16, 9, -31, -29, 13, -5, 15, 55, 0, 32, -9, -22, 6, 7, 52, -22, 3, 8, 5, 8, 40, 4, 2, -7, -26} #define DS-CNN_conv_ds_2_pw_conv_biases_0 {5, -17, -1, 18, -3, -5, -32, 19, 13, -5, 17, 45, 7, 55, 10, -71, 6, 50, 14, 21, 15, 55, 3, -3, -16, 59, -15, 28, 17, -34, 10, 31, -30, 72, 25, -15, 52, -2, 26, 7, 48, 22, 28, 28, 51, 4, 42, 39, -2, 52, -19, -5, -40, 18, 18, -67, 17, -39, -24, -25, 68, 46, 1, 31} #define DS-CNN_conv_ds_3_dw_conv_depthwise_weights_0 {38, 25, 40, 44, -32, 22, -55, 51, -19, -20, -22, -45, 24, -22, -5, -15, 45, 50, 50, 9, 3, 45, 49, -80, -28, -13, -31, 52, 92, 49, -16, 33, -41, -10, -20, 10, 29, 24, 50, 34, -16, -44, 29, 45, -39, -60, 4, 17, 27, -45, 34, 20, -23, 27, 54, 39, 29, 2, 26, -37, 22, 29, -30, -51, 0, 13, 28, 42, -23, 17, 27, 39, 9, -9, 5, -21, 13, -31, -22, 13, 31, 27, 52, 39, -30, 30, 12, -13, -19, 25, -37, 33, 39, 41, -46, 33, -29, -49, -14, -30, 19, -8, 27, 41, 53, -11, 32, 39, -24, -7, 64, 20, 10, -25, 42, 25, 44, 17, -6, 28, 23, -28, -4, -16, 5, 8, -6, -35, -2, 36, 28, 45, -6, 4, -15, 9, -28, -32, -30, -12, 13, -11, -20, -6, 30, 28, -2, 9, -10, 56, 27, 48, 5, -59, -23, 9, 39, 44, -35, 12, 15, -25, -51, -22, 21, 31, 13, 17, -13, -2, 11, -30, 17, 1, -9, 15, 19, -22, 16, 13, -52, -4, 33, -16, 6, 40, 11, -1, -27, 14, 10, -34, 43, 20, 37, 28, -31, 24, 10, 17, -27, -19, -18, -52, 40, -46, -49, -1, 54, 38, 25, 26, -25, 36, 57, 37, -39, -29, -9, 36, 77, 79, -27, 41, -26, 12, -22, 3, 37, 29, 34, 64, 33, -35, 30, 45, -37, -28, 55, 29, 27, -39, 49, 17, -42, 38, 65, 36, 39, 13, 38, -30, 26, 56, -38, -59, 13, 21, 33, 30, -27, 26, 27, 15, 0, -18, -16, -36, 19, -22, -55, 40, 40, 32, 15, 54, -14, 49, 38, -5, -28, 9, -11, 27, 50, 43, -28, 28, -29, -27, -31, -26, 23, -15, 29, 35, 51, -35, 29, 34, -40, -17, 55, 21, 22, -28, 42, 26, 22, 16, -25, 10, 20, -37, -17, -24, -9, 27, -8, -41, 12, 31, 21, 43, -28, 5, 30, -1, -26, -19, -44, -10, 26, -27, -22, -8, 33, 26, -2, 47, 10, 44, 27, 57, -5, -69, -13, 5, 78, 51, -32, 18, 22, -38, -49, -25, 23, 36, 22, 37, -29, -10, 17, -23, -20, 10, -12, 20, 10, -20, 20, 13, -25, 7, 29, -29, 17, 27, 4, 10, -49, 39, -18, -27, 46, 4, 29, -1, -10, 10, 27, 14, -21, -36, -12, -42, 29, -38, -72, 0, 40, 8, 0, 32, -21, 25, 48, 68, -38, -25, 12, 24, 21, 94, -38, 37, -28, 28, 6, 2, 21, 13, 11, 52, 19, -51, 31, 68, -25, -32, 75, 21, 15, -43, 52, 0, -3, 33, 69, 24, 32, 11, 30, -35, 16, 48, -47, -44, 22, 23, 25, 22, -14, 13, 32, 2, -7, -15, -29, -16, 22, -25, -44, 48, 15, 18, -7, 51, -5, 15, 15, 44, -26, 0, 4, 23, 37, -53, -16, 10, -18, 7, -29, -26, 10, -6, 8, 35, 33, -41, 21, 35, -61, -23, 24, 27, 29, -10, 14, 20, -22, 18, -15, 5, 16, -40, 8, -23, -16, 54, -6, -33, 38, 31, 7, 53, -23, 8, 34, 7, -26, -26, -38, -9, 33, -15, 11, 14, 30, 27, -10, 38, 39, 25, 31, 86, -5, -57, -9, -2, 46, 64, -29, 23, 20, -31, -34, -26, 9, 29, 24, 20, -72, -5, 17, 30, -59, 13, 1, 12, 23, -8, 35, 18, 13, 10, 15, -27, 7, 20, 19, 26, -53, 36, -24, -8} #define DS-CNN_conv_ds_3_dw_conv_biases_0 {-49, -51, -63, -85, 61, -41, -31, -47, 49, 73, 63, 111, -52, 71, 89, -25, -56, -60, -29, -72, 20, -87, -54, -47, 67, 67, 52, -50, -58, -43, 87, -55, 34, 61, 85, 55, -57, -32, -55, -52, -25, 74, -62, -74, 109, 61, -51, -41, -55, 85, -47, -27, 32, -37, -52, -34, -45, -5, -25, 63, 28, -56, 66, 86} #define DS-CNN_conv_ds_3_pw_conv_weights_0 {41, -13, -22, 16, -33, -31, -26, -8, -13, -5, 2, 42, -45, 7, -12, 17, -20, 48, -7, -16, -9, 20, -27, -10, 2, -9, -24, -9, -8, -14, 17, -21, -35, 17, 27, -33, 16, -23, -27, 12, -35, 6, -28, 22, -15, 6, -41, -3, 2, 1, 27, 19, 0, 17, 27, 25, -20, 6, 9, -50, -49, -20, 30, 19, 5, 16, 0, 8, -39, 9, 14, 12, 69, -34, 75, -14, -6, 54, -16, -5, -12, 58, 4, -28, 41, 14, -52, -1, 28, -10, 1, 23, -58, -24, -19, 8, 22, 11, 16, -4, -11, 12, -23, 28, 24, -10, 8, -10, 30, -15, 0, -22, -21, 57, 13, -30, -47, 8, -14, -17, -7, 13, -26, 8, -2, 46, 17, 37, 22, -17, 17, -10, -13, -13, -10, -36, 2, -21, -6, 1, -18, -6, 13, -33, -8, 10, 5, 5, 0, -6, -16, -17, 25, 32, -23, 9, 12, 33, -1, -12, -3, 6, 4, -7, 1, 18, -1, 11, 2, -7, 7, -5, -8, 10, -1, -27, -10, -24, 12, -59, 48, -2, -32, -12, -7, -24, 3, -39, 3, -10, -24, -3, 2, 10, -19, -9, -27, -17, -31, 7, 20, -33, 6, 19, 13, -14, -11, -38, 15, -18, -44, 3, 40, -7, -13, -14, -16, -15, -14, 19, 1, 19, -29, 15, 27, -2, -37, 29, 17, 22, 11, -6, 19, -1, -13, -18, -22, 24, -13, -44, -2, -19, -28, 6, -3, -43, 3, 22, -15, 20, -3, -37, 29, -7, 21, -4, -19, -65, 26, -16, -53, -49, 6, 36, 37, -90, -14, 52, 20, -47, -31, -31, -30, -32, -10, 0, 18, -17, 3, -8, 27, -17, -39, -14, -11, 18, 8, -5, 13, -39, -24, -42, 23, -24, 19, -2, 1, -37, -19, -13, -63, -26, 30, -29, 20, -36, 25, -4, -4, -6, 14, -4, 11, 21, -4, -23, 35, 9, 68, -4, 18, 5, 16, -3, -16, -24, -26, -34, -12, -33, 29, -8, -37, 3, -7, -20, 50, -8, -16, -18, 10, -17, -32, 5, -31, 21, 9, 20, -28, -14, -45, -26, -23, 15, 25, 24, 12, 35, -41, 9, 8, -29, 25, 12, -17, -47, -3, -22, -26, 11, -15, 8, 50, 3, -17, 25, 17, 26, -10, -2, 19, 41, -3, 4, -12, 2, -12, 31, -21, 0, 12, -14, -3, 12, 27, 19, 4, 6, 9, -18, -11, 0, 4, -2, 35, -53, 23, -13, -7, 35, -32, -3, 13, -25, -30, -38, -16, -40, -17, 5, 27, -45, 27, 9, 4, 2, -3, -20, -60, -26, -21, -19, -30, 26, -35, -9, 26, -13, 39, 10, -8, 33, -1, -43, 6, -23, 32, -44, -45, -14, 68, -9, -13, 44, -4, 8, 18, -47, 1, 13, -26, 8, 9, -8, 8, 22, -1, 39, -11, -16, 39, 4, -9, -80, -17, -22, -7, 23, -13, -19, 87, 1, -7, 37, -11, -33, -24, -78, 12, 47, -47, 42, -19, 7, -31, -13, -26, 16, -24, -11, 0, 6, 15, -2, -9, 22, 20, -10, 3, -37, 33, 2, -29, -64, 33, -54, -11, 4, 9, 10, -13, -33, -29, 24, -9, -2, -11, 14, 12, 56, 9, 16, 9, -29, -19, -3, 8, 6, -11, -1, -4, 28, -37, 3, 14, -32, -45, 30, 10, 50, -11, -55, -65, -13, 2, 20, 5, 25, 26, 3, 13, -25, -11, -19, -9, -10, -4, 24, 10, -27, 31, 0, 11, -28, 13, 6, 2, -23, -18, -8, 15, -33, -9, -41, 45, 19, -11, 19, 13, 28, -2, -40, 6, -1, -5, -34, 6, -5, 13, -3, 17, 2, -1, -17, -7, 5, 44, -13, -12, -10, -49, 10, -12, -3, 19, 22, 19, -5, 4, -14, -35, -3, 40, 8, -19, -28, -24, -4, -1, -25, 12, 23, 14, 15, 22, -3, -14, -9, -33, 14, -19, 43, 16, 10, -36, 22, -9, 14, -10, 9, -19, 2, -42, 6, 31, -4, 7, -21, 0, -25, 18, -17, -14, -23, 7, -16, 22, 18, -4, -26, 10, -8, -22, 8, -19, 21, -12, 11, 16, 28, 31, -21, 2, -7, 21, -27, -18, 15, -41, 46, 20, 17, 12, 44, -16, -8, -18, 16, -20, -14, 28, 60, -9, -16, -14, -10, 7, 16, 43, 32, 3, 40, 5, -17, -25, 51, 10, -21, 37, -8, -23, -6, 14, 40, 24, -21, -26, -2, -2, -19, 29, -32, 8, -24, -6, 15, 1, -27, -6, 1, -17, -41, -17, -29, -23, -17, -47, -3, 39, 10, 15, 21, -9, -21, -10, 27, -8, -1, -1, -3, 18, 10, -27, -14, -16, -53, 6, -8, -12, -11, 24, 3, 24, -40, -28, -22, -51, -40, 33, 38, 4, -9, 35, 22, -1, 9, -24, 14, 24, -14, 13, 2, 44, -10, 6, -16, -27, -14, -10, -41, -26, 29, -21, 35, -32, 13, 5, 3, -20, -36, 21, -31, -4, -33, -33, 3, 17, 1, 7, -28, -8, -5, -3, 10, -15, -3, -10, -44, 1, 1, 7, 8, -27, 27, 19, 21, 7, -2, -10, -2, -9, 27, -17, 21, -32, -17, 12, -12, -7, 20, -15, 23, -6, -64, 18, 14, 8, -20, -35, 21, 34, -13, -34, 13, 21, 12, 2, 4, -11, -22, 7, -28, 2, 31, -30, 7, 3, -25, 11, 2, -24, 73, 12, 11, -8, 21, -35, -11, -9, 27, -3, -24, 11, 18, -24, -17, 3, -38, 25, 20, 8, 15, 2, 26, 2, 3, 9, 15, 26, -15, -43, -19, -38, 10, 17, 25, -13, 9, 16, -2, -31, 21, 9, -38, -17, -11, -49, -43, -20, -9, -20, -5, 9, 24, -23, 0, -41, -11, -34, -16, -2, 47, 23, -17, -16, -44, -11, 21, -6, -25, -11, -8, 6, 15, 15, -2, -6, -46, 25, 14, -16, -9, -21, 26, -11, -3, -18, -13, -13, 16, 5, 30, 29, -17, -20, -11, -21, -5, 2, 15, -9, 9, -3, -20, -15, 7, -13, 15, -6, -24, -13, -25, 42, -21, -2, 14, 19, 21, 21, 0, 13, 5, 0, -8, -12, -3, -19, -7, -32, -33, -32, -2, -29, -12, -18, -4, -29, 35, -4, -5, 6, -11, 17, 16, -26, -9, 11, -13, -2, 34, -20, 8, -6, -20, 6, 9, 11, -28, -6, -22, -27, 50, 12, -8, -21, 29, 23, -6, 22, 11, -4, -2, 9, 3, -35, 6, -13, -22, -19, 13, 2, 5, -16, 23, -27, -10, -14, 26, 11, 24, 21, 53, -30, 16, -13, 1, -28, 8, -9, -30, 50, -4, -7, 4, 25, 14, -9, 25, 23, 19, 24, 8, 19, 10, 12, -2, 5, 16, -10, 19, -10, -11, 8, -33, 27, 29, 38, -9, -34, -24, -21, 30, 0, 11, -26, -22, 12, 10, 20, -26, -56, -16, -17, -11, 13, 4, -16, 30, 1, -34, 40, 10, -7, 1, -12, -14, -52, 17, 0, -41, 36, -20, 1, 32, 37, -38, -30, -19, -8, 26, 16, -20, -9, -52, 9, -41, -25, -18, -7, 7, 0, -30, -18, -18, -3, 6, 1, -28, 11, -20, -23, -14, 13, -10, -15, 6, 14, 39, -38, -6, -11, -12, 3, -16, -8, 11, -13, 29, 12, 16, 2, -1, -8, -7, -17, -1, -17, -37, 13, -26, -24, 18, 3, 13, -30, -5, -1, 6, 20, 29, -37, 21, -16, 18, 32, 1, -34, 20, 36, 18, -16, -3, -13, 29, -40, -26, 0, -25, 9, -31, 6, -13, -17, -13, 21, -32, -17, 3, -24, -8, -17, -27, -26, 24, 13, -17, 2, 6, -35, 15, -38, -8, -26, -21, 3, -34, -8, -28, -5, 5, -24, 7, 8, 18, 23, -14, -5, 20, 31, -30, -15, -1, -9, 4, 0, -8, 5, 20, 3, 17, -18, -12, 24, -8, -1, -2, -10, -8, -13, 17, -3, 35, -18, -44, -35, -48, 0, 3, 47, 20, 4, 41, -9, -16, 20, -35, 7, -14, 19, -40, -5, -48, -64, -1, 5, -15, -5, 15, -36, 29, -11, 17, 26, -15, 24, -6, -20, -13, -23, 24, 31, 0, -4, -5, -39, 23, 21, -15, 10, 10, 29, -9, 18, 16, -30, 13, -7, 4, 24, -13, -33, 7, -26, 6, -10, 2, 13, 20, -36, 3, -23, 6, 4, -11, 2, -2, -21, -13, 68, -32, 9, 4, 16, 27, 29, 13, -3, 10, 13, -5, -21, -9, 38, -7, -2, -37, 20, 36, 1, -14, -9, 45, 22, -12, 29, -23, 23, 25, 3, -10, 6, -20, 16, -15, -36, 7, -14, 40, 30, -20, 15, 20, -21, -18, 18, 4, 41, 9, 11, -13, 19, 23, 14, 10, 45, -5, 7, 43, -13, 14, 7, -8, -24, 50, -11, 22, -21, -9, -33, -30, 11, 19, -25, 20, 29, -9, 7, 17, 2, 22, -32, 19, 16, 20, -7, -42, -32, -6, -11, 4, -14, -6, 7, 17, -19, 5, 7, -43, 0, 37, 0, -6, -12, -17, 6, -2, 5, -20, -8, 27, -17, 8, 23, 25, -12, -23, -7, -54, 14, 14, -9, -20, -12, -21, -8, 34, 0, 8, -1, -27, -13, 16, 11, 7, -12, -45, -20, -7, 17, -55, -7, 12, 25, -7, 16, 1, -23, 6, 7, -17, -28, -29, 1, 21, -15, -31, -6, -8, 13, -9, 2, 10, -13, -3, 12, -13, -4, 28, -27, 23, -21, 17, 39, -32, 5, 4, 18, -31, -9, -12, -46, 31, -15, -1, -33, 21, -23, 31, -1, -24, 5, -49, -51, -12, -10, 44, -11, 35, 25, -27, 49, -3, -21, 22, -7, 43, -47, 69, -34, 29, 18, 41, 15, -12, -14, 44, -14, -34, 33, 26, 10, 19, -13, 33, -20, -15, -17, -40, 13, 33, -42, -44, 7, 15, -23, 13, -17, -25, -6, -52, 34, 30, -5, -13, 7, 19, 11, 31, -2, 6, -7, -39, 19, -2, 11, -9, -52, -37, -22, 13, 13, 6, 42, -15, 34, 1, 44, -45, 6, -23, 12, -12, -32, 15, -41, -23, 20, -6, -23, -13, 13, -30, -26, 1, -9, -27, 30, 30, -12, -35, -32, -8, 28, 21, -23, 23, 16, -5, 0, -43, 6, -35, -40, -3, 17, 35, 15, 3, 2, -23, -30, 2, -4, -4, -12, 31, -12, -6, 7, 7, -34, -33, -36, 21, -2, 9, 5, 17, -23, 38, -7, 10, -13, 8, -11, -10, -13, 3, -14, -7, -22, 24, -9, -15, -11, -24, 13, -29, -7, 39, -4, -13, -6, -20, -18, -5, -22, 15, -11, -28, -19, 6, 15, 18, 2, -27, -3, 15, 24, -3, 29, 3, -21, 6, -10, -20, 0, 12, -8, 34, 15, -9, -13, -3, -35, -24, 16, -28, -25, 27, 10, -4, -31, 9, 34, 13, -30, 5, -20, 29, -28, 25, 0, 21, -8, -6, -24, 16, -13, -29, -8, -14, 3, -6, 20, -27, -14, 16, -37, -3, 16, 12, -13, -14, 18, -10, 23, -3, 44, -13, 52, -43, -30, 11, 36, 2, 15, 11, -39, 33, 24, -21, 59, 8, 1, -27, 4, 16, -17, -20, 24, 21, -18, 1, -3, 35, -12, 59, 54, -5, -32, 1, -2, -27, -9, 10, 7, 12, -18, -7, -1, -9, 7, -10, -23, -12, 8, 1, 21, -17, 21, -26, 11, 23, 48, 11, -19, -6, -12, 3, -55, -31, -17, -12, -38, -3, -2, 6, -1, -2, -26, -36, 17, -10, -27, 13, 25, 12, 1, -19, -2, 18, -37, -28, -10, 7, -6, -19, 0, 2, -6, 9, -14, 5, 5, 6, -22, -28, -4, -10, -3, -15, 31, -26, 11, -14, 11, -8, -7, -13, -5, 33, 7, -18, -20, 17, -13, 8, 7, 3, 41, 1, 12, -21, -48, -38, 5, -36, 18, -33, -36, -14, -5, -8, 17, -22, -48, -14, -21, -22, 31, -27, -6, -37, -11, -10, -3, -8, 28, 9, 8, 19, 40, -7, -57, 75, 35, 12, 25, -2, 4, 29, 30, 37, -43, 5, -21, 24, 2, 10, -25, -22, -5, 6, 14, -24, 21, 18, 11, -45, -30, 50, -8, 38, -25, 0, -16, -1, -28, 11, -7, -27, 14, 0, 4, -16, -1, 28, -25, -27, -29, 28, 1, -3, 55, 0, 11, -38, -40, -23, -28, 12, 3, 15, 1, -1, -10, -11, 10, 21, 5, -6, 10, -14, 17, -8, -6, -14, -25, -24, 7, 2, -11, 15, 53, -8, -21, -33, -16, 5, -12, -1, -62, 13, -4, 38, -3, -11, -15, -28, 33, 19, -23, 38, 2, -22, 7, -6, -1, 46, -15, -5, -12, -19, -19, 20, -13, 18, -13, -17, 27, 8, -49, -41, -7, 6, 7, 30, 4, 10, 13, -20, -29, -14, -25, 14, 13, -45, 31, 18, 0, 23, -35, -35, -15, -60, 15, 0, -8, -37, 11, -36, 0, -14, -5, -4, -4, -7, 26, 4, 14, 30, 1, 28, 9, 9, -20, 26, 33, 0, 13, 24, 26, 11, -27, 5, -21, -25, 31, 23, 16, -2, 7, -11, 15, 17, -36, -7, -3, -16, -21, 58, 6, -20, -23, -2, 0, 1, 26, 24, -54, 15, -8, -7, -15, 1, -2, -23, 9, -22, -40, -1, 13, -48, -1, -11, 5, 41, 19, 2, -29, -3, -50, 21, 35, -5, -16, -28, -1, -1, 14, 20, 12, -28, 4, 3, 43, 33, -30, -36, -32, -40, -54, 15, 21, 0, -14, 2, 10, -1, -18, -2, -50, -10, 20, 31, -2, -29, 12, -28, 8, 72, -23, -2, -38, 38, -25, -23, 19, 18, -15, -21, 20, -11, -6, 1, -12, 0, -9, -44, 32, -3, -6, 6, 12, -20, -1, -44, 17, -30, -28, 19, 23, -10, 23, -27, 15, 4, 11, -4, -11, 3, 61, -7, -16, -28, -48, -12, 7, 13, -26, -11, 3, 21, 34, -38, -8, 8, 4, 30, -2, 0, 25, -5, -1, -5, -34, 13, 6, -7, -52, 18, 16, -6, 21, 39, -1, 9, 10, -21, -20, 11, 17, 47, -56, -2, -20, 4, -21, 0, 63, 18, -63, 34, -30, -29, -9, 8, -16, 22, 27, -5, 31, -24, 20, 6, 10, 19, -11, 43, -32, 7, -19, 8, -1, 8, 6, -11, -10, 42, -65, -17, 33, 5, 53, 13, -3, -14, -39, 1, -16, 16, 19, 0, -24, 6, -11, -19, -35, -20, 35, -3, 28, 12, 45, -3, -3, 11, 12, -5, 1, -16, 6, -11, -22, 35, 20, -19, 1, -4, -8, 10, -7, 3, -27, -18, 18, 3, 14, -21, -24, 21, 18, -31, -34, 8, 4, 11, -13, 0, 20, -7, 2, -10, 3, -5, -2, 3, -26, -19, 4, 0, -9, 7, 22, -12, -38, -40, -21, 8, -6, 13, 5, 16, -16, 7, -1, -8, -13, -10, 47, 3, 29, 32, 7, -14, -5, -25, -16, 9, -2, -13, -6, -11, 25, -19, 19, -8, -39, 7, 25, -27, 10, 16, -18, 14, 4, 5, 35, -3, 0, 5, -4, -14, 19, 1, -12, 13, 41, 3, 8, -5, -12, -51, 18, 21, 22, -1, 34, -13, -15, -17, -21, 6, 11, -9, -27, -23, -34, -15, -13, 32, -35, -6, 21, -14, 25, 41, -25, 12, -10, -55, 31, -22, 41, -46, -24, 0, 13, -5, -17, -29, 5, 0, -12, -2, -15, 35, -21, 5, -26, 6, 22, 24, 14, -24, 27, -3, 25, 5, -21, 10, -39, 6, 1, 3, 17, 18, 26, -22, -30, 0, 1, 6, -8, -13, 41, 29, 0, 15, -26, 24, -35, -32, -22, 6, 13, -20, -15, -42, -8, -15, -25, 10, -21, 17, 31, 21, 20, -25, 0, -13, 12, -5, 27, -20, -17, 10, -15, 21, -8, -16, -20, -12, -9, -15, -10, -19, -4, -15, 9, -19, 17, -18, 18, -9, 7, -9, -17, 31, -1, -11, 10, -20, 2, -7, 7, -23, -9, -25, 22, -11, -3, 21, 8, 9, -3, -15, -23, 5, 13, -7, 10, 31, 15, -18, -17, -30, 2, -9, -13, 33, 6, 10, 5, -55, -5, -18, -4, -42, 15, -15, -19, -37, -13, 16, 27, -49, -42, -22, -8, -11, 4, -23, 17, 14, 10, 11, 33, -22, 0, -8, 30, -18, -6, 14, -34, 16, -31, 0, -14, 5, -30, 0, -21, 7, 31, 8, 0, -41, 8, -22, 9, -3, 13, 3, 11, -38, -45, -8, 24, -25, 1, -23, 5, -12, -7, -23, 5, 17, -39, -10, -19, 12, -4, 17, -19, 4, 24, 25, 20, -16, -6, -40, 18, -31, -18, -13, 3, 9, 31, -28, 0, 30, -83, 0, 9, 28, -37, -10, -8, 2, -14, -14, 0, -5, -4, 30, 7, -51, -6, -30, 11, -40, 12, -19, -16, -35, -17, -58, 50, -24, 30, -4, -9, -3, 17, -44, -25, -3, 23, -55, -25, -17, 2, 0, -6, -7, -6, -11, -64, -1, 30, 19, 43, 8, -36, 13, 31, 23, -17, 14, 13, 13, 30, 4, -34, -11, -49, -17, -31, -7, -12, -29, 4, -3, 15, 7, -4, 23, 1, -24, 10, 26, -18, -3, 23, 5, -6, -1, -21, 13, -22, 1, -3, -29, -29, -4, -21, 20, -1, -14, -9, 19, -19, 9, 12, -21, -7, 6, 38, 22, 1, 13, 12, 9, -20, -41, -21, 7, -19, -8, -29, -38, 4, -28, 19, -26, 1, 7, 17, -2, 9, -2, -24, -15, 24, 30, 9, 14, 32, 25, -17, 14, 17, -31, -25, 20, 14, -1, 33, 18, -7, 21, -22, -13, 32, -11, 11, 8, 3, -22, 27, -10, 36, 8, 4, -26, -30, 15, 13, -20, 12, 7, 8, -11, 1, -9, 0, -29, -15, 13, 21, -13, 19, -23, -43, 11, -6, 5, 1, 2, -5, -30, -9, 5, 18, -19, 2, -24, -15, 0, 46, 35, -26, 30, 28, -17, -26, -15, -20, -5, -26, -19, -12, 23, -19, 31, -17, -26, 15, -4, 15, -3, 2, 0, -17, 2, -23, -24, -14, 4, 7, 15, 9, 7, 36, 21, 4, 3, 7, -16, -6, -4, 36, -4, 17, -8, -23, -29, -69, 38, 3, 13, 14, -17, 24, -13, -41, -18, -29, 5, 10, 29, -5, 1, 15, 2, 45, 9, 11, -29, 3, -3, -25, 14, 9, 0, -6, -26, -3, 6, 7, -2, 6, -63, -5, -36, 26, -23, 7, 15, -15, -26, 9, 18, 5, 6, -30, 14, 2, -5, -32, -11, 5, -4, -8, 5, 3, -36, 20, -21, 39, -9, 14, -1, -11, 53, -54, -16, -29, 7, 26, -21, -11, 13, -21, -23, -30, -16, 7, -4, 4, -11, -34, -53, 2, -18, -3, -16, 3, 30, -7, -15, 8, 9, 5, -28, 8, -17, 17, 27, 9, -40, -1, -8, 8, 14, 0, 4, -15, 14, -14, 2, -23, -15, 24, -10, 1, -3, 14, -14, -8, -22, -28, -26, 3, -18, -11, 24, -60, 30, -21, 9, -24, -21, 41, -22, -22, -9, 17, 13, -24, 22, 27, -24, -18, -14, -24, -23, -17, -12, 7, -10, -17, 24, -2, 19, -7, 26, -30, -30, -13, 27, -22, 20, -22, 4, -18, 18, -6, -29, -4, 11, -3, -7, -25, -20, -20, 25, 5, 12, -13, 7, -40, 14, -42, 2, -4, -22, 9, -6, -16, 9, 5, 14, 1, 7, 7, 15, -39, 2, 6, -45, 8, -15, 5, 0, 10, -29, -9, 33, 23, 7, -29, 7, -9, 4, -12, -14, -13, -11, -2, 28, 8, -10, 18, -25, -48, -44, -22, 12, -8, -50, -6, 18, -54, -12, 23, 20, -1, 18, -30, 7, -46, -25, -6, -3, 13, -24, 25, 32, 5, -3, 24, -36, 31, -7, 3, 16, 7, 24, 7, 3, -11, -14, -11, -15, -2, -6, -28, -26, -24, 3, 2, 23, -7, 6, -15, -17, -40, 28, -22, 7, -19, 26, -8, -16, 21, 12, -22, -2, 27, -42, 10, 32, -44, -21, 7, -12, -26, 5, -41, -18, -42, -15, -30, -13, -23, 23, 12, -18, -63, 53, 27, 5, 4, 36, -9, 0, 6, 19, 20, 7, -38, 12, 54, -12, -75, -28, -18, -12, 27, 17, 29, 47, -10, -41, -32, -15, 12, -12, -3, -42, -31, -22, 1, -39, 37, -31, 37, -14, 26, -1, 32, -64, 12, 5, 0, 1, 8, -15, 3, -4, -19, 20, -20, -11, -18, -5, -43, -18, -2, -24, 28, 14, 24, 1, 39, 7, -56, 12, 6, 15, -31, 2, 21, -4, -13, -5, 8, -4, -7, -8, -9, 9, -11, -12, 19, 17, 4, -48, 4, 1, 11, -4, 14, -4, 16, 27, -26, 21, 12, 6, 31, 10, 24, 35, -26, -18, 15, -1, -14, -25, 3, 28, 32, 12, -30, 28, -23, -14, -5, -28, -19, -9, -29, -26, 11, -19, 17, -12, -8, -17, -7, 32, 1, 3, 14, 20, -3, 11, 16, -6, -17, 0, -13, -10, 2, -5, 5, -27, -14, -13, 5, -5, 5, 13, -13, -11, -11, 8, 4, 27, 7, 0, -17, -7, -13, -6, -3, 33, -7, 5, -14, -49, -7, 7, -5, -9, -21, -38, -39, 31, 4, -17, -46, -22, -14, 18, -20, 29, -46, -27, -16, 7, 4, -10, -2, -4, -21, -2, -53, 14, -16, 13, 2, 11, -2, -24, 9, 16, -5, -30, -6, 0, -12, -14, -11, -21, 6, -1, 7, 14, -1, 17, -19, -11, -49, 18, 6, 15, 7, 24, 10, 0, 16, -5, -18, 1, -14, 32, -17, 5, 4, 15, -30, -23, 13, 17, 19, 14, 31, -21, 44, -8, -11, -2, 64, -12, 18, -21, 25, -18, 28, 10, -2, 18, -35, 2, 12, 25, 16, -25, 45, -10, -7, 13, 4, -7, 4, 41, 23, 16, -12, 61, 7, -15, 4, -39, -15, -5, -51, 13, 9, 60, -1, 12, -29, 35, -22, -23, 47, 56, -5, 37, -43, 14, 4, -60, 39, -48, -14, 43, 14, 0, 23, 10, 12, 11, -15, -1, 0, 10, -26, 7, 11, -8, 21, -3, 1, -6, -29, -4, 0, -26, -6, 13, 7, 22, -12, -4, 7, -1, -24, -45, -36, 4, -11, 21, -10, 5, -2, 11, -16, -1, 17, -10, -25, 15, -3, -32, 5, -25, -17, -30, -27, -11, -33, 7, -4, -33, -34, -12, 4, 15, 4, -17, 11, 17, 19, -14, 27, 13, -14, -36, 44, -14, 18, 27, 33, -17, -9, -2, -38, 22, -2, -12, -22, -25, 2, -17, -1, 12, -12, -13, -12, 67, -45, -8, 17, 22, -34, 1, -14, -29, -9, -5, -50, -22, -8, -33, -30, 55, 4, -6, -20, -43, -17, -20, 13, 6, -41, -29, 9, -34, -26, -37, -20, 1, -24, -35, -24, -23, 8, -22, 16, -2, 11, 0, -15, -13, -55, 20, 34, 11, -2, -36, 23, -14, -28, 15, -72, 9, -18, -36, 26, -28, -5, -41, 1, 37, -19, -31, -5, -72, -8, 33, -4, 8, 0, 33, 9, 16, -10, 7, -14, 54, 38, 34, -4, -22, 1, 7, -49, 36, 28, -13, -18, 23, 29, -8, -75, -62, 30, 7, 9, 25, 5, -11, 3, 4, 16, 12, 24, 17, 10, 20, -3, 14, 0, 11, -11, 11, 1, 25, -19, 24, 13, -7, -27, -7, 17, 10, -7, -11, -35, -35, 15, -4, -15, 7, -5, 43, -19, 42, 0, -18, 13, -15, -13, -23, -26, -24, -9, 7, 2, 5, -12, -39, 4, 61, -46, 18, -19, -32, -2, 24, -34, 5, 29, -6, -27, 30, -1, 8, -19, -44, 5, -45, -17, 24, -15, -1, 25, -24, 2, 42, 17, -8, -1, 19, -19, -6, 31, -2, -12, -4, -14, 15, 2, -41, 42, 31, -4, 36, 9, 2, -35, 10, -5, -47, -4, -15, -34, -23, -45, -14, 3, 28, 31, -17, 29, -9, -27, -30, 28, -12, -14, -37, -14, 6, -18, 25, 23, -9, 40, -2, -26, -25, -1, 31, -2, -1, 16, 21, 13, -7, 12, 15, 20, -13, 37, 35, -35, -15, -14, 2, 36, -16, 18, 32, 11, -11, 0, -21, -21, 27, -19, 28, 34, 5, 47, 33, 13, 13, 25, -17, -24, 13, -16, -7, -10, 43, 17, -32, 20, -2, 32, 3, -2, -23, -25, 1, 33, -7, 47, 7, 49, -30, 40, 8, -7, -26, -18, -8, -72, -22, 18, 34, 29, -28, 1, 0, 0, 19, -6, -3, -18, 11, -41, -11, 21, -4, 12, -50, -14, 31, 9, 8, 14, 0, -1, 19, -22, -18, 19, 7, -14, 3, 55, -3, 8, 17, -23, 11, 4, -6, -11, -20, 21, 6, -17, -28, 19, -10, -8, 25, 5, -19, 0, -20, -44, -22, -16, -4, -15, 19, -7, -12, 7, 6, 6, 35, -37, -52, 0, -11, -6, -1, -7, -29, 13, 15, 42, 5, -27, 1, -35, 0, 3, -6, 6, -3, 38, 6, -21, 15, 7, 18, 28, -12, 37, -11, 3, -14, -59, -19, -11, 12, -31, 21, -8, -9, -15, -15, -19, -60, -27, 8, -14, -9, 30, 16, -6, -6} #define DS-CNN_conv_ds_3_pw_conv_biases_0 {23, -57, 14, 43, 86, 24, 44, 15, 33, 9, -19, -1, 15, 2, 33, 18, -34, -14, 28, 64, 4, -15, -37, 16, 27, 30, 12, 1, -60, 50, 30, 42, 31, -3, 38, 7, -2, 22, -9, 5, 14, 60, 69, 31, -4, 15, 12, 56, 63, 34, 40, 45, 22, 37, 39, -66, 32, 52, 55, 15, 9, -88, -21, 22} #define DS-CNN_conv_ds_4_dw_conv_depthwise_weights_0 {61, -58, 95, 60, 47, 49, 54, 61, -22, 51, -31, -24, 82, 7, 56, 76, -33, -53, 107, -3, -58, -39, -49, 98, -24, 72, 100, 79, -51, 100, -23, 68, 61, -51, 68, -21, -29, 57, 69, 83, 65, 67, 47, 44, -37, 56, -44, -52, 53, 72, 79, -34, -33, 80, 60, -32, 87, 66, -24, -42, 64, -17, 39, 88, 56, 40, 114, 48, 37, -39, 47, 39, -22, -45, -14, -25, 59, -5, 31, 65, -18, -31, 95, -9, 4, -27, -13, 108, -25, 53, 76, 64, 4, 62, -29, 54, 62, -30, 48, -23, 1, 61, 50, 46, 81, 55, 43, 41, -23, 40, -35, -8, 14, 57, 43, -26, -25, 67, 47, -25, 79, 58, -25, -28, 41, -13, -9, 87, 43, -65, 89, 49, 45, 28, 42, 58, -20, -108, -21, -45, 72, -40, 46, 84, -25, -33, 83, -2, -19, -32, -20, 83, -14, 46, 96, 54, -37, 80, -24, 59, 50, -24, 58, -25, -17, 47, 56, 65, 70, 65, 40, 31, -21, 32, -28, 14, 58, 60, 62, -34, -13, 65, 48, -21, 54, 39, -33, -31, 45, 1, -95, 93, -23, -22, 40, -16, -10, 5, -17, -19, -3, -8, 6, -8, -16, -1, -18, -38, 6, 29, -23, -13, -34, 11, 21, -2, -7, -21, -31, -35, -3, -20, 8, -27, -31, 15, -32, 0, -23, -15, -28, -23, -37, -30, -15, -24, -17, -13, 18, -20, 4, -28, -40, 6, -10, -48, -20, -6, -32, -25, 1, 27, -16, -4, -24, -46, -17, 10, -1, -14, -11, -48, -16, -24, 9, -53, -3, 1, -18, -8, -20, -37, 8, 20, -17, -16, 4, 9, 15, -5, -3, -20, -33, -34, 4, -21, 5, -26, -27, 9, -30, -3, -9, -25, -25, -25, -21, -30, -14, -18, -14, -6, 24, -7, 2, -30, -24, 15, -7, -44, -19, -5, -31, -22, 1, 23, -8, -9, -43, -42, -20, -6, -15, -16, -12, 1, -22, -24, -1, -75, 0, 1, -15, -27, -16, -40, 13, 21, -27, -10, -13, 4, 14, -6, -3, -22, -37, -38, 3, -24, 5, -38, -25, 10, -33, 4, -24, -27, -27, -5, -9, -18, -17, -22, -3, -5, 20, 8, 0, -20, -33, 8, 1, -35, -19, 0, -32, -26, 5, 24, -6, 3, -21, -43, 63, -36, 56, 53, 46, 35, 53, 52, -23, 43, -24, -46, 95, 0, 53, 82, -30, -45, 111, -18, -63, -27, -51, 87, -25, 65, 73, 75, -27, 91, -29, 62, 70, -40, 65, -21, -7, 51, 68, 65, -102, 78, 51, 46, -15, 49, -40, -48, 43, 73, 67, -38, -17, 103, 54, -18, 71, 65, -28, -41, 70, -38, 36, 101, 53, 38, 100, 37, 27, -64, 57, 40, -26, -5, -11, -46, 62, -11, 33, 71, -21, -30, 100, -29, -10, -6, -11, 96, -25, 56, 48, 66, 5, 63, -23, 50, 53, -27, 43, -22, 2, 69, 62, 51, -76, 59, 51, 43, -9, 46, -37, -26, 16, 60, 38, -23, -13, 84, 55, -17, 82, 62, -26, -26, 58, -29, 35, 94, 40, -34, 92, 44, 42, 22, 51, 57, -21, 44, -30, -24, 57, -45, 45, 78, -27, -41, 80, -32, -32, -7, -33, 86, -15, 61, 80, 57, -29, 88, -17, 61, 47, -23, 60, -17, -16, 71, 70, 58, -73, 53, 41, 46, -1, 44, -34, 11, 47, 63, 73, -36, -16, 76, 56, -19, 64, 51, -24, -28, 67, -6, 30, 90} #define DS-CNN_conv_ds_4_dw_conv_biases_0 {-48, -7, -47, -45, -44, -14, -41, -76, 53, 13, 43, 39, -27, 19, -46, -45, 47, 55, -40, 29, 34, 40, 49, -48, 77, -38, -13, -51, 36, -35, 57, -39, -54, 55, -41, 56, 37, -62, -51, -57, -1, -44, -35, -37, 59, -42, 59, 30, -62, -35, -72, 64, 70, -28, -68, 58, -45, -49, 71, 54, -58, 27, -5, -44} #define DS-CNN_conv_ds_4_pw_conv_weights_0 {-19, 4, 11, 7, 10, 2, -13, 7, 30, 0, 29, 0, -2, 31, -26, -17, 16, -6, 19, 2, -18, -16, 33, -22, -21, 6, -7, 0, 7, -18, -41, 14, 3, -21, 47, 7, -38, -7, -4, 6, 8, 17, 9, -14, 19, -7, -16, 6, -8, 13, 0, -18, -7, -1, -13, 2, 3, 2, -24, -17, -4, -9, -1, 7, 16, 10, 2, -2, -1, 4, -20, -2, 4, -5, -30, 14, 26, 14, -5, 18, 0, -9, -4, 0, -12, -13, 27, 19, 2, -15, 18, -11, 17, -1, -3, 31, -3, -11, 24, -11, 1, -11, -14, -2, 7, -20, -6, 6, 13, -14, -41, 1, -7, 6, 0, 1, 23, -8, 18, 17, 15, -17, 4, -16, 7, -8, 11, -1, -17, -10, 1, 0, 13, 24, -7, -3, -5, 14, 30, -6, 28, -8, -16, -13, 12, -26, 38, -2, 11, -8, 18, -22, 20, 22, -11, -22, 7, -15, -6, -14, -12, 8, -3, 10, -25, 15, 36, -12, -3, 23, -3, 1, 13, 10, 19, -20, -21, 18, 8, -46, -18, 9, -4, 1, 7, -18, -26, 31, -15, -16, 2, -6, -13, -8, 5, 6, 17, 3, -18, 14, 28, 6, -3, 2, 2, -15, 20, 1, -18, -10, -13, 6, -2, -8, 2, 16, 3, 12, -3, -22, 8, -8, 11, -5, 11, 5, -13, -18, 0, 14, 1, -8, 9, 22, -7, 0, 12, -26, -19, 7, -20, 25, 5, -9, 29, 3, 32, 9, 40, -11, -9, 15, -2, 13, 24, -17, -11, 12, 17, 1, -10, 9, -8, -17, -14, 10, 4, 6, 30, 2, -7, -7, 1, -9, -9, 12, 13, -4, 16, -7, 3, 2, 12, -5, -10, 4, -20, 5, -11, 8, 8, -8, -2, 2, 9, -9, 3, -1, 13, -1, -3, -1, -13, -3, -8, 0, 8, 2, 9, -10, 6, -5, 24, 37, -10, -1, -7, -2, 32, -2, -3, -11, 19, 36, 12, -3, -2, 6, -16, -7, -11, -2, 1, -25, 17, 16, 13, 21, 15, -6, 14, 17, -45, -25, 3, -10, -16, 5, 0, 7, -10, -2, 11, 4, -12, -2, -16, -9, -11, -5, 5, -2, 0, -20, 8, -2, -4, 1, -8, 6, -14, 0, 6, 5, -1, -23, -3, 12, 14, -13, 12, -1, -1, -5, 5, 6, 11, -11, 14, -17, -15, -8, -17, -6, 22, -7, 2, 0, 11, -2, -30, 32, -2, -9, 3, 12, -15, -13, -3, -22, -3, 20, 9, 40, -23, -1, -8, -4, 3, 6, -28, 11, -23, 10, -19, -12, 28, 0, -12, -5, -2, 18, 5, 14, -22, -22, -12, -19, -4, 26, -16, -16, -11, -4, 3, -8, -8, 13, -5, 2, -6, -12, 2, 8, -14, -2, -7, 10, -5, -5, 4, 6, 6, 10, 22, -9, 5, 7, 6, -12, 0, 1, -6, -8, -4, -16, 19, 40, -7, 13, -7, -29, 31, 5, -20, -6, -17, 10, -5, -16, 9, -2, 8, -9, -11, -13, -9, -8, 13, -13, -15, 16, -5, 19, 3, -11, -16, -2, -8, -24, -14, -12, -19, -14, -9, -20, 7, 15, -4, 16, 14, 7, 24, 10, -6, -23, 12, -6, -2, -12, 3, -1, -3, 9, 17, 2, -12, 54, -1, -16, -13, -12, -1, 15, -11, -47, 15, 19, -2, -6, 6, -18, 0, -22, -5, -10, 21, -10, -51, -2, -12, -1, 5, -25, -15, 14, -3, -19, 14, 1, -14, 9, -10, -3, -15, -16, -7, 8, -10, -11, -3, -12, 9, -5, 25, 15, -17, -17, -15, 9, -2, -9, -4, -38, -7, 2, -26, -25, 30, 54, 7, 5, 16, 0, 3, -2, 6, -3, 7, -12, -5, -5, 19, 10, -1, 12, 16, 7, -5, 1, 22, 1, -7, -9, -5, -7, 8, -12, 6, -19, -5, 30, 9, -17, -6, 10, -12, 7, -8, 35, -3, -4, -16, -13, -19, -26, -3, 14, 9, -9, 4, -5, -4, -5, 32, 6, -27, 3, 2, -14, -12, 9, 2, 21, 23, -24, 13, -1, 3, 2, 26, -9, 17, 12, 0, -27, 18, 0, 2, 7, 7, 7, -24, 21, 25, -9, -15, 2, -12, 3, 1, -9, 24, -15, 8, 9, 1, 0, 2, -41, -2, 15, 7, 24, 5, -1, 6, -1, -12, 33, 7, -1, 11, -5, -2, -17, 9, -1, -15, -10, 10, -9, -18, -4, -8, 9, -6, -10, -11, -8, 3, 7, 6, 1, -8, 1, 9, -25, 3, 19, -1, 7, 15, -11, 14, 23, 0, -6, 22, -14, 6, -1, -1, 0, 20, -21, -5, 32, -11, 4, 17, -12, 6, -25, 9, -18, 0, -12, -14, 2, -3, 11, 37, -9, 5, -6, -17, 17, 18, -1, -3, -14, -6, 30, -9, 18, 11, -19, 7, -16, -4, -4, 7, 44, -10, -31, -23, -5, 0, -17, -26, 8, 10, -18, -10, -4, 14, -9, -19, 21, -41, 8, 0, -2, -46, 17, -9, -21, 13, 15, 0, 4, 18, 4, -17, -3, -21, 67, -5, -15, -7, 11, 3, 9, 3, -5, -13, 32, -13, -7, -23, -11, -10, -7, 0, -2, 15, -13, -26, -4, 44, -9, 4, 0, -24, -18, 16, -15, -13, 18, -20, 2, -9, -5, 1, -24, -1, 8, 22, 5, 0, -8, -6, 0, 6, 0, 11, 4, 32, 6, 11, -14, -10, 25, -10, 0, 6, -6, 34, 16, 14, -7, 13, -19, -10, -5, 14, 10, 0, -5, 6, 6, 24, 11, 17, -4, 2, 3, 13, 5, -18, -11, -29, 8, 15, -31, -16, 14, -3, 1, -8, 37, 2, 8, -19, -26, -10, -14, 10, -32, 8, 29, 3, -2, 42, -22, -4, -10, -10, -15, 9, -3, -3, 9, 21, 4, -10, 15, -2, -15, -5, -15, 8, -13, -5, 14, -6, 0, -11, 6, -14, 15, 20, -10, 24, -3, 12, -19, 2, 6, -15, 20, 11, -11, 2, 28, -21, 3, -21, -5, 6, 8, -2, -3, -22, 32, 13, 30, -7, -6, -9, -4, -14, -1, -10, -6, -28, 4, -9, -8, 0, -15, 9, -4, -5, -10, -42, 14, 0, -17, -4, -18, 0, 1, -14, -1, 14, 7, -2, 46, -14, 11, 18, -11, -11, 20, -20, 12, 1, 1, 19, -6, -13, 3, 16, -11, 4, 17, -16, -10, 4, -34, 15, -1, -38, -14, 7, 21, 4, -2, 0, -8, -8, -28, 22, -23, 3, -10, 32, 26, 15, -20, 18, 21, 9, 14, -16, 10, 7, -3, 7, -11, 5, -13, 30, 14, 9, 0, -1, -10, -9, -24, -37, -13, -5, -33, -9, 9, -9, 13, 2, 14, -17, -2, -5, -15, 7, -5, -8, 5, 6, -21, -1, -4, -7, -26, 13, -9, -22, 6, 1, 8, -12, -13, -4, 28, -14, -18, 15, -16, 17, -6, 19, 7, 6, 1, 10, -3, 13, 13, 20, -10, 28, -2, 37, -10, 1, 7, 12, 1, 7, -8, -8, 16, 36, -16, -15, -23, -5, -9, 4, -9, 14, -4, -8, -15, -1, -10, 5, -4, -14, 0, 16, -20, -19, 4, 3, -17, -27, -25, -9, -6, -33, -10, 15, 20, 17, 11, -2, 29, -26, -11, -1, -10, -11, 0, -2, 8, 9, -11, -3, -2, -11, 28, 4, 1, 2, 8, 11, 18, 0, 0, 6, 22, 15, -19, -4, 15, -1, -13, -12, 9, 37, -11, -7, 6, 30, -12, 10, -5, 3, 7, 2, 6, -20, -14, 11, 17, -2, -1, 12, 1, -2, 6, -12, -19, 3, 16, -24, -14, -19, 7, -2, -13, -7, -2, 2, -16, -4, -24, -9, 20, 16, -9, 32, -10, -3, 12, -10, 3, 5, -2, -4, 13, -4, 24, 20, 5, -1, 14, 22, -19, -17, -12, 10, -25, 16, 17, -8, -9, 17, 11, 6, 21, 12, 8, -10, -10, 0, -2, -17, -13, 30, 5, -30, 11, 7, -22, 5, 13, -17, -23, 26, -4, 21, 0, 0, -15, 6, -13, -25, 15, -6, 16, -7, 5, 5, -1, 1, -8, 5, -1, -12, 8, 3, 3, -22, -5, -8, 29, 1, 17, 26, -16, 7, 4, 4, -12, 6, -3, 14, -16, 13, 32, 10, -1, 38, 10, 31, -7, -9, 0, 0, 14, -18, 5, -6, -8, 4, 3, -3, -18, 2, -3, 6, 4, -17, 1, -12, 36, -4, 3, -16, 12, -13, -16, 3, -11, -3, 13, -2, -4, -13, -4, 2, -27, 7, -13, 0, 0, -11, 5, 0, -20, -10, 7, 6, -12, 3, -2, 11, 13, 14, 27, 9, -9, 5, -7, -12, 7, -3, 6, -21, 20, -2, -13, -16, -15, 0, -17, -15, -5, 9, -21, -19, -9, 18, -16, 4, 12, -26, -21, 17, 7, -12, 21, -13, -14, -3, 9, 1, -33, -13, -1, 18, 7, 19, -5, -6, 6, -9, 3, 11, 16, -7, 4, -1, 5, -1, -2, -29, -2, -14, -21, 9, 19, 25, -10, -1, 1, -12, 20, 16, 1, -1, 7, -2, -4, 34, -16, 3, 7, -21, -15, -3, -13, -9, 23, 9, 10, 11, -14, -16, 19, -12, 3, -9, -20, 13, -1, -12, -5, -9, -30, -4, -12, 0, 21, 19, 13, 28, -4, 26, -3, 5, -8, 21, 6, 34, -1, -2, 25, 7, 6, -7, -9, -4, 14, -5, -6, -1, -26, -4, 5, -8, 7, -2, 18, -11, 28, 24, -9, 6, 4, -9, -24, 28, -17, 25, 3, -32, 32, -17, 24, -2, -1, 7, -3, -6, -1, 9, -20, -8, -4, 16, 11, -31, -5, 1, 19, 9, -7, -23, 6, -14, 21, -9, -26, -27, 16, -5, 9, 11, 9, 24, -8, -5, 28, 6, -7, -7, -2, -11, -6, -4, -11, -5, -16, -8, 40, -4, -6, 12, 17, 5, -2, -7, 2, -12, 23, -3, 3, -19, 4, 1, -25, -17, -23, 12, 3, 5, -12, -6, 14, 9, 18, -4, -15, 0, 12, 10, -23, -5, -9, -21, 5, 1, 4, -3, 13, 1, 14, 15, 7, -1, 0, 9, 3, 0, -13, 13, -4, 25, -3, 10, -2, -3, 24, -1, 19, -4, -3, 16, 1, 24, -12, 4, 0, 1, 30, -5, 8, -4, 8, -29, 8, 16, 2, -8, 8, 14, -29, 56, 15, 13, -20, -12, -7, 29, -7, 11, -17, 1, 2, -17, 5, -9, 3, -6, 17, 21, -2, -9, -19, 16, -14, 5, 9, 25, 13, 9, -12, -2, 5, -22, -3, -2, 10, 24, 2, -9, 2, 18, 3, 2, -17, 11, -7, -16, 3, -9, -10, 0, 8, 9, -5, 29, 16, 7, 6, -13, 14, -9, 0, -5, -23, 25, 5, -3, -12, 9, 17, -3, -10, 11, -5, 4, -3, -27, 22, -5, -16, 20, 9, -9, 16, -11, -3, 25, 0, 21, -14, 15, -7, -7, -2, -4, 10, -9, -18, -18, 7, -17, 20, 3, 3, -16, 1, -14, -8, -8, -6, 0, 6, 9, 8, -3, 4, 11, 1, -3, 12, 4, -11, 5, 7, -2, -17, 20, -1, 29, -17, 10, 5, -33, 3, -9, 11, 7, 2, 27, 3, -14, -11, 8, -21, -28, 21, -11, -2, -6, 28, 21, -7, 12, 4, 14, -6, 12, -17, -3, -17, 0, -50, -6, 4, -6, -6, -21, -8, 2, -7, -15, -7, -8, 2, -13, -4, -13, 18, 3, 4, -4, 5, 1, 1, -21, -3, -12, -1, 11, 7, 1, -14, 53, -4, -9, -3, -25, 26, 14, 8, 2, 21, -10, -15, 11, -9, 11, -10, -10, 11, 18, 0, -15, -3, 16, -21, 4, -1, 24, -11, 5, -6, 3, -9, -15, -2, -3, 4, -2, -6, 23, 1, 2, -1, -5, -8, -5, -22, 12, -6, -5, -2, 1, -4, -18, 16, 12, -14, 2, -7, -7, -2, 5, 8, -6, -7, 0, -5, -1, -1, -3, 12, -1, 14, -4, -17, 7, -4, 10, 29, 8, -29, -4, 2, -6, -18, -9, -2, 2, -14, -11, 9, 14, -7, -31, 3, -8, 19, -3, -12, -5, 7, 12, 7, -1, -16, 2, -6, 8, 9, -13, 5, -8, 13, -8, 16, -3, 10, -23, 15, -22, -19, -12, -16, -5, 1, -18, -17, -15, 12, 17, 0, -4, 2, -26, -3, 5, -5, -7, 7, 33, 11, 1, -3, 10, -13, -4, 3, -5, -1, -7, 36, -16, 1, -5, 17, -8, -7, 0, 9, 22, -23, 11, 8, 0, 16, 8, 1, -10, 2, -5, -15, 2, -7, -14, 17, -1, 24, 29, 21, 31, -6, 16, -8, 7, 0, -2, 9, 10, -11, -20, 12, 7, 9, -25, 9, -6, 22, -35, -20, -17, -3, -7, -5, 26, -1, -31, 5, 26, 21, -21, -34, -43, -3, -7, 11, 13, 15, -9, -19, 9, -9, -21, 0, -5, -6, 9, -11, 1, -1, 11, -6, 8, -6, 31, 4, -13, -4, 9, 25, 9, -7, -4, -10, 5, -5, -17, 2, -11, 18, -3, 2, 31, -5, 8, 9, 0, -6, 10, -14, 7, -4, -1, 13, 17, -13, 11, -13, 28, 36, 19, -23, 3, -10, -5, 4, -3, 9, -5, 13, 9, -17, -6, 23, 1, -14, -1, -14, -11, 1, 2, -31, 5, -18, 8, 23, 3, -16, -11, 2, -12, 6, 7, 10, -7, 8, -11, -26, 16, 2, 22, 0, 1, 16, 23, -9, 3, -4, 22, -7, -10, -1, 2, -1, 0, 17, 5, -9, -6, -20, -9, -24, 6, 22, -2, 19, -7, 9, 11, 5, -21, 33, -11, -2, 8, 17, 8, -14, 7, -4, -23, -1, -8, 3, -3, -31, -15, -4, -3, 8, 9, -12, -8, -11, -20, -7, -15, -10, -12, -13, -20, -11, 6, 2, -16, 5, 22, 14, 3, -19, -30, -4, 21, 2, -8, -40, 0, 9, -8, 4, 17, 24, 23, 5, -14, -32, -16, 25, 5, 22, -21, -13, 5, -18, 1, 11, -9, -11, 5, 9, -6, 5, -3, -2, -16, -6, -12, 5, -2, -8, 18, 0, 13, 18, 26, 17, -9, 6, 0, -9, -13, -5, 16, 9, 34, -15, 16, 0, 9, 6, -9, 14, 20, 17, 6, 1, -3, -14, -23, -5, -9, -13, -4, 6, -8, -10, -23, 22, 5, 0, -15, -4, -20, -15, -2, -3, 28, 19, -12, -6, 6, 1, -11, -9, 26, -14, -10, -8, -11, 17, 10, -20, 5, 10, 10, -1, -6, -8, -17, 4, -8, -3, 6, -10, 4, -11, 5, -14, 31, 10, 3, 9, -13, 8, -19, 1, -5, 9, 8, 5, -1, -11, -26, -12, -5, 3, 7, -11, 4, -19, 4, 5, 24, 4, 4, -8, -18, -1, -7, 2, -10, 0, -16, -12, -5, 6, -5, 27, 8, 4, -4, -20, -36, 9, -13, -4, -6, -8, 30, 24, -1, -8, -41, 24, 8, 25, 18, 6, 37, -16, -13, -9, -8, -17, -4, -1, 23, 13, 17, 8, 5, 2, -21, -4, 13, -7, -16, -14, -13, 16, 11, 2, -4, 13, -11, 40, -10, -16, -23, -1, 5, -3, 3, -24, -24, -1, 16, 17, 20, -8, 21, -7, -9, -12, 15, 13, -11, -2, -1, 7, 0, -10, 21, -5, 10, -14, 20, 27, 12, 2, -19, 12, -2, 10, -11, -13, 4, 32, -12, -14, -4, 11, 43, -3, 1, 5, -18, -5, -17, 9, -9, -7, -19, 6, 7, -14, -6, 27, -25, 7, 14, 34, -2, 2, -4, -8, 24, -28, -12, 3, -19, -1, -12, 0, 22, -4, 10, -7, 19, -13, 19, -3, -8, 28, -5, -14, 14, 6, -18, 13, 9, 6, -9, -9, -4, 33, 13, -10, 3, -1, 5, 19, 8, 12, 32, 7, -6, -2, -2, -8, 38, -15, -19, 18, 22, 9, -3, 2, -8, 24, -14, -15, 1, -1, -1, -16, -9, -10, -18, -8, 3, -3, -13, 11, -8, 0, 42, -14, 22, -3, -24, -16, 17, 13, 2, -11, -3, 6, 0, -15, 14, 9, -4, -36, -17, 4, 15, -13, -4, 4, 8, -6, -9, -14, 1, 13, 4, -1, -23, 9, 1, -22, 15, -17, -8, 23, -32, -16, -2, 14, -16, 7, 27, -13, 7, -13, 1, 25, -16, -7, 18, 11, -49, 27, 0, -1, -21, -9, -1, -3, -4, 2, -24, 7, -6, 7, 2, 2, -24, 25, -3, 20, 11, 8, 4, 22, 12, 5, -16, 13, -14, 15, 5, -13, -16, 36, 23, 7, 33, 4, 21, -10, -11, -2, -5, 12, 5, 7, 7, 11, -10, -15, -19, -14, -11, 14, -8, -14, 6, -18, 6, -13, 4, 0, 1, 4, -28, -8, 8, 14, 3, -6, -21, -2, -12, 13, 2, 30, 24, -13, -7, -6, -4, 10, -2, 2, -8, -2, 30, -16, -6, 29, -8, -13, 2, 8, 18, 2, 26, 26, -16, 2, 9, 18, -6, -10, 10, -8, 27, -14, -14, 7, -16, -7, -29, 3, -11, 4, -18, 9, 2, 4, 7, -2, -27, -3, 3, 22, -12, -14, -30, 17, 5, -23, 20, 0, -14, -11, -11, -2, 10, -13, 12, -15, 18, 15, -11, 1, -6, 22, -7, -4, 3, -3, -10, -13, -3, 27, -1, -41, 1, 14, -4, 20, -17, 4, -15, -18, 1, -16, -6, 10, -6, -22, -9, 12, 18, 25, 18, 11, -25, 8, 4, -18, 9, -1, 2, 13, -3, -18, 16, 10, 4, -12, -3, -8, -11, 15, 25, 10, 3, 15, -6, 8, -10, 16, -3, 19, -8, -12, -16, 31, 16, 17, -7, 5, 13, -6, 13, 23, -8, -24, -32, 15, -3, 5, 7, -14, 24, -19, 6, -8, 6, -3, -24, 14, -15, 2, 12, 19, 11, -6, -2, -2, -20, 6, -6, -8, 7, -20, -10, -16, 35, 7, 21, 17, 3, 11, -21, -18, -11, 1, -15, 29, -26, 2, 1, 1, -27, 28, 13, 15, -27, -4, -5, 19, 7, 18, -18, -9, 8, 5, -7, 13, -36, -7, -14, 25, 17, 11, 19, -10, -10, -12, 1, 20, -10, 0, 4, 14, 7, 5, -8, 15, 16, -11, -4, 13, 3, -14, -26, 10, 8, 8, 14, 6, -2, 0, 11, -19, -5, -1, 16, -10, 5, 8, 13, -14, -1, -4, 14, -1, 19, -13, -5, -6, 15, -1, -12, 0, -10, 0, 18, 3, 38, 13, 16, -20, 15, 34, -7, -20, -7, 7, 24, -11, 0, 7, 13, 15, 0, -2, -4, 4, 11, -8, -18, -2, 3, 5, 0, 14, 12, -5, -24, -1, -13, 11, 9, 6, -28, -4, -4, -17, -2, -5, 4, 7, 29, -22, 24, -27, 3, -19, 1, -7, 14, -3, -16, -10, 19, -15, -14, 2, -7, 9, 19, 24, 39, 0, 32, -2, 40, 9, 13, -30, -5, 1, 10, -11, -4, -19, 4, 2, -17, 13, -18, -3, -20, -8, -2, 8, -2, 0, -1, -12, -17, 4, -4, -10, 6, -16, 14, -11, 14, 16, 19, 26, -21, 0, -19, 11, -16, -24, -8, 4, -10, -7, -9, -16, -6, -15, 11, 6, 8, 19, -10, 9, -3, 8, -14, 3, 3, 10, -12, 0, -3, 37, 7, 14, 25, 16, 15, 1, 6, -8, 1, -11, -11, 4, -8, 7, 8, -14, -23, 18, 4, -12, 10, 21, -17, 13, -14, 8, 16, 15, -18, 26, -24, -27, 13, 11, 10, 20, 7, 3, -4, -17, 12, 15, 1, -5, -13, 4, -2, -6, 11, 11, -8, -21, -13, 22, 10, 18, 15, 6, 8, 19, 18, 17, 9, -23, -14, -5, 4, 12, -6, -29, 13, 4, 1, -12, -1, -2, 38, 9, -13, 0, 27, -23, -10, -11, 26, -8, -9, 6, -19, -14, 1, 30, -42, -25, 1, -19, -15, -13, -12, 14, -17, 10, 6, -2, -11, -6, 0, 3, 6, 5, 5, 5, -1, -19, 2, 9, -11, 5, 1, -18, -14, -4, 5, -3, 4, -33, -12, 30, 22, -28, 2, -2, -12, 19, 20, 2, 1, 7, -13, 31, -13, 3, -16, -10, -38, 2, 3, -1, -4, -3, 9, -20, 16, 7, -26, -16, -15, 6, 16, -10, -4, -4, 3, -5, 10, 2, 11, -20, 0, -16, 32, -18, 1, 0, 1, 15, -9, 2, 29, -10, 23, 1, -4, -7, 25, 29, 20, 16, 4, 7, 33, -4, 16, -21, 10, -19, 5, -8, 0, 4, -10, 12, -22, 22, 0, 27, 37, -22, -4, -19, -8, 7, -3, 2, -14, -2, 11, 7, -23, -14, 3, 26, 7, -18, 22, 9, 14, -21, -2, 24, 36, -12, 0, -14, 24, 2, -6, -4, 20, 2, -15, 2, 44, -25, -14, -5, -4, 7, -5, -13, -1, 28, -8, 3, 21, -12, 22, -48, -4, 9, -3, -26, -8, 18, -7, -18, -9, -1, 36, -22, -6, -8, 7, 5, -9, -24, 18, 3, -4, 19, -13, -31, -17, 23, -35, 0, -19, -8, 1, 3, -5, 1, 5, -1, -9, -33, -20, 2, 16, 7, 16, 1, 16, 3, -6, 1, 29, -9, -8, -3, -4, 1, 23, -31, -21, 8, 2, -25, -3, 9, 16, -31, -22, 8, -17, 14, -6, 13, 1, 17, 7, -9, 39, -5, 6, -1, 0, -7, 3, -6, -11, 27, -12, -5, -25, 12, -5, 27, -14, -11, -10, -28, 4, 15, 9, 0, -17, 5, 9, 38, -9, -23, -23, 13, -9, 6, 22, 30, 3, -15, 8, -4, -15, -1, -8, 5, -11, -26, -2, 1, -16, 15, -5, -6, 5, 12, -9, 4, 7, 6, -6, 7, 6, -1, -2, -12, -10, 8, 3, -19, -19, 10, -15, 2, 1, 6, -40, 17, -16, -17, 1, 2, -30, -5, -13, 14, -1, 33, 6, 5, 7, 17, 14, -15, -17, -7, -5, -11, -13, 3, -3, -7, -11, 11, 12, 0, -34, 17, -10, -1, -4, -8, -13, -9, -4, 1, -9, 3, 14, -8, 0, 17, -6, 30, -8, -9, -11, 14, -10, -11, -11, -2, 4, -8, -14, 2, -1, 2, -19, 30, -8, -1, 11, -10, 1, -17, 20, 36, 27, 13, 29, 7, -7, -16, 27, -15, -2, -17, -1, 20, 23, -9, 12, -4, 12, -19, -12, 17, 4, 15, 12, -6, -4, 24, 8, 5, 16, 2, 4, 3, -1, -2, -15, -25, -1, 2, 5, -2, 0, -13, -19, 25, -3, 18, -5, 17, -2, -4, -16, -32, -11, 3, 5, 8, -2, -31, 26, 14, -19, -6, 7, 4, 33, -19, -9, -4, -10, -7, 5, 11, 12, 20, 16, -23, 5, -6, -9, -6, 5, 32, -17, -5, 19, -15, 13, -9, -8, 0, -7, 20, 23, 10, -9, 14, 33, -6, -1, -13, 16, -5, 5, -18, 9, 25, -7, -11, 8, 17, 29, 6, -16, -2, -8, -3, 11, 26, -13, 7, -14, -9, 21, -16, -17, 6, -22, -3, -10, -4, -2, 12, -8, 3, -28, 16, -1, -14, 6, 6, -15, 10, -12, -8, 6, -13, 16, -21, 7, -3, 2, 16, 21, -28, -17, 23, -11, 2, -2, 7, 9, -12, 9, 18, -5, -20, -16, 1, 34, -1, 4, -28, 23, -10, 21, -2, -15, 35, 14, -21, -7, -5, 35, -6, -7, -14, -8, -25, -8, 2, -19, 1, 15, -1, -2, -22, -13, 36, 9, -21, -10, 5, -18, 26, -5, 22, -5, 2, 7, 29, 16, -5, -4, -8, -12, 1, -2, -11, -5, -2, 1, -16, -4, 15, -18, -21, 1, 7, 9, -2, 0, -8, -10, -18, -15, -1, 4, 4, 12, -5, -12, 1, -15, -24, -7, -1, 15, 44, -10, -5, 33, -15, -3, 1, -17, 11, 37, -9, 12, 18, -28, 4, 6, 5, -17, 20, -6, 1, 16, -2, -16, 2, 7, -22, -4, -2, 21, 6, 6, -9, -1, -20, -19, -17, 13, 10, -9, -6, -7, 10, 3, 0, 5, 2, 0, -13, -6, 16, -2, -9, -16, 14, 8, -12, 6, -9, -22, 0, 13, 13, -16, 10, -11, -10, -13, -20, 0, -10, -9, 28, 4, -18, 29, -3, 13, 2, -4, 21, -4, -13, -11, 2, 13, -1, -2, 0, 21, -13, 5, 16, 15, 7, -6, -5, 1, -16, 19, -20, -1, 32, 11, -11, -17, 19, 21, -12, -19, -6, 6, -3, -4, -5, -3, 11, -20, -9, -9, 20, 10, 8, -4, 18, -21, -16, 12, -5, -12, -11, 2, -2, -2, 9, -8, 12, -8, -12, 14, 13, 1, 13, 22, -17, 17, -9, 26, -8, -2, 5, -7, 6, 12, 13, 16, 8, 7, -25, 7, 2, -10, 15, -2, -14, 13, 3, -9, 17, 7, 15, -20, -7, -6, 9, 9, -15, -11, 33, -9, -14, -14, 6, 31, -4, -13, -19, 9, 5, -12, 15, -2, -10, -34, -15, -27, 9, -4, 6, -4, 20, -9, -21, 7, 29, 4, 4, 11, 6, 0, 1, -31, -8, -3, 29, 11, 6, 7, 26, 2, 13, -4, 3, 16, 29, 15, -14, 18, -8, -3, 9, 6, -6, 7, -4, 9, 10, -10, -5, -5, 0} #define DS-CNN_conv_ds_4_pw_conv_biases_0 {72, 44, 49, 0, 34, 58, 79, 88, 110, 30, 25, 57, 56, 54, 43, 74, 60, 36, 44, 51, 19, 42, 98, 10, 20, 24, 12, 65, 81, 41, 68, 64, 46, 32, 67, 59, 65, 63, 30, 32, 40, 51, 20, 93, 24, 42, 4, 26, 55, 29, 89, 24, 34, 114, 43, 91, 7, 19, 74, 40, 45, 58, 25, 28} #define DS-CNN_fc1_weights_0 {-46, -76, -51, -43, -46, -26, 36, -69, -78, -68, -71, -82, 33, 33, 55, -11, -24, -59, 24, 17, -47, -20, -17, -45, 66, -7, -26, -60, -85, -31, -52, 62, -53, -83, -18, -68, 28, -52, -13, -66, -64, 51, -38, -52, 59, 41, -40, -39, -16, 29, 2, -44, -54, -63, -55, -13, -32, -50, 52, -23, -56, -42, -63, 54, -19, 25, -27, 37, -15, -36, -40, -3, 4, 48, 38, -2, -34, -11, -11, -21, 22, 23, 5, -10, -11, -30, -19, 7, -19, 5, -5, 15, -11, 27, 12, -2, -33, 13, -13, 27, -43, -35, 17, 29, -24, -30, -31, 2, 7, -39, 24, 33, -23, 17, -39, 28, 47, 2, -9, -16, 39, 32, -20, -23, 5, 25, 30, 16, 7, -56, -14, 21, -62, 25, -19, -36, 25, -26, 39, -2, -4, -53, 30, -33, 13, -20, -54, 17, -44, 7, 4, -25, 10, 18, -69, -65, 23, -6, 27, 37, 22, 16, -54, -50, 6, 19, 34, 34, 26, 30, -14, 3, -16, 5, 41, 32, -30, -16, 21, -8, 30, -16, -22, 36, -9, -10, -65, -47, -61, -39, 45, -25, -10, -38, 30, -44, -28, -48, -35, -35, 18, 12, -33, 45, -28, -4, 53, -19, -13, -20, -7, 31, -8, -46, 31, 47, -29, -41, 4, 25, 8, -40, -27, -38, 2, -47, 41, -9, 8, -40, 45, -29, 58, -17, -29, 6, -38, -28, -12, -27, -39, -29, 52, -26, 16, 49, 26, -35, -34, -37, 32, 33, -21, 16, -45, 41, -6, 53, 33, 59, 49, 3, -18, -2, -14, -26, -15, 33, -39, 34, 13, 27, -26, 47, -61, -38, 49, 13, -10, -38, 8, -38, 9, -43, -38, -4, -36, -29, 55, 37, 1, -34, -16, -34, -28, -32, 25, -23, 22, -44, -20, -51, 26, 60, -29, -2, -35, 48, 13, -41, 9, -26, -60, 29, 18, -53, -68, -21, -36, -16, 27, -40, -37, 13, 12, 48, 6, -11, -42, -42, -81, -16, -38, -23, -43, 27, 16, 30, -44, -17, -37, 45, -58, 2, -20, 49, -17, 2, 33, 19, -54, -5, 45, -34, -12, -36, 42, 38, -15, 47, 1, -27, 42, 47, -36, -24, 33, 25, -27, -9, 17, -36, -47, -16, 36, -26, -49, -24, -8, 10, -16, -11, 42, -18, -5, -44, 24, 15, -67, -37, -20, -5, 63, 52, -42, -60, 54, -48, 49, 41, 33, -29, 36, -27, -14, 48, -24, -29, -22, 35, -21, 11, 29, 45, 11, -19, -11, -20, 3, 29, 34, -28, 42, -1, -29, -3, -16, -37, -12, -21, -57, -67, -40, -41, -44, -78, -52, -6, -34, -7, 9, -44, 18, 31, 14, -48, -37, -11, -57, 32, -65, -35, -21, 13, -20, -57, -39, -45, -7, 24, -49, 47, 36, -58, -17, -1, 54, 59, 40, 43, 11, 22, -34, -8, 48, -66, -60, -19, 7, -37, -45, -47, -67, -14, 48, 42, -31, -61, 26, -38, 57, -9, -32, 39, -15, 10, 43, -4, 35, 59, 4, -50, -77, -17, 0, 42, 14, 51, 0, -43, -44, -56, 71, 25, -6, -57, 0, -56, 27, 44, 25, 11, -23, 1, -30, -21, 20, -14, 50, 39, 17, -25, -19, -27, -46, 22, -7, -70, -52, 56, -46, -58, -15, -26, -33, -33, 57, 13, 59, -46, -23, -17, -42, -27, 28, 59, 14, -40, -2, 24, -44, 7, 16, -52, -37, -3, 12, -30, -61, -6, 24, 12, -41, -43, 33, -26, -23, 47, -41, 36, -27, 12, 52, 47, 32, -45, 45, -57, 11, -31, -34, 9, -58, -41, -23, 51, -27, -11, -54, 2, -6, -45, -8, -14, -51, -54, 43, -33, -19, 56, 43, 30, -3, -42, -8, -49, -44, -13, -37, -25, 32, 5, -1, 40, -43, 57, 10, -28, -44, 34, -37, 26, -21, -50, -39, 38, -14, -20, 13, -34, -46, 47, 17, 12, 51, -65, -13, -38, -32, -3, 44, -41, 16, -53, -26, 32, 10, -44, -18, -42, 48, -61, -52, -31, 20, -11, 37, -28, -13, -52, -36, -26, -19, 43, -25, -36, -19, 54, -46, -58, 37, -16, 18, -34, 38, 44, 41, -23, 38, -18, -32, -25, -17, -39, 20, -32, 43, -29, -23, -24, 25, 57, -34, 3, 21, 4, -21, 9, 40, -62, -29, -21, 41, 27, -38, -30, 37, -50, 13, 55, -42, -61, 7, -46, -5, 48, -26, -32, -30, 28, -14, 18, -53, -17, -23, -35, -16, -48, -44, 27, 46, 58, 43, 29, -45, 20, 7, 48, -20, 12, 37, 8, 63, -23, -47, -29, -35, -54, -26, 10, 18, -69, -29, -48, -11, 22, 19, -35, -34, -38, -32, -20, -29, 24, 48, -38, -23, -22, 36, -20, -39, 5, -33, 48, -40, 36, 31, 17, -67, -20, 23, 27, -16, -30, -57, -19, -10, 23, -5, -28, -44, -6, -26, -49, -29, 4, -32, 48, -45, -30, -14, 25, 32, 42, -35, -56, 44, 37, -34, -59, -20, 28, 38, 48, 35, -29, -32, -7, 42, -12, 34, 27, -30, -33, 3, -7, -35, 53, -31, -30, -46, -30, -13, -33, 52, -38, 1, 23, 12, 2, -28, -5, 17, 9, -29, 45, 54, -36, -13, -27, -31, 27, -26, -28, 35, -38, -29, -23, -58, -48, -23, 27, 51, -13, -43, 16, -10, -37, 20, 11, -49, -20, -13, -24, -16, -5, 65, -19, 36, 37, 13, -41, 55, -32, -29, -26, 2, 31, -43, -61, -38, -30, 11, 0, -18, 49, 30, -10, -23, -25, -17, -27, -9, -57, -3, -54, 37, -45, 32, -22, 31, -19, -11, 8, 20, -50, 29, 30, 56, 8, 8, 1, -53, -34, 5, -27, -16, 41, 23, 28, -31, -55, -59, -14, -27, -41, 35, -6, 19, 27, 23, 50, -25, -25, 10, -18, -16, 34, -49, 19, 4, 25, 11, -37, -32, 2, -14, 47, 33, -25, -62, 35, -34, 34, -37, -32, -38, -45, -32, -13, -4, -51, 35, -63, -18, -41, 44, 31, 26, 16, 32, 29, -17, -50, 24, 21, -42, 9, -37, -62, -7, 26, -58, -12, -25, -26, -53, -36, 15, 6, 0, 31, 50, 10, -26, -2, -43, 33, 34, -36, 24, 43, -59, 6, -39, -43, 20, -47, 12, -14, -2, 45, -39, -33, -32, 61, -31, 5, -48, -39, 51, 41, -10, 44, -40, -43, 0, 28, -3, 39, -56, -56, 34, -36, -43, 40, -34, 39, -31, -61, 10, 1, -55, 8, 13, 6, -30, -36, -35, 3, 34, -5, -12, 43, -30, 31, -47, 38, -27, -33, 11, -52, -43, 8, -42, 43, 21, 41, 20, -19, 39, 59, 2, -32, -15, -48, -59, 36, 6, -2, 42, -32, -57, 5, 22, 7, 47, -27, 21, -48, -41, -46, -31, 22, -41, 11, -42, -39, -54, -20, 26, -25, 27, 38, -14, 45, -41, -13, -41, 9, 56, -64, 19, 35, -23, -18, -39, -39, -33, 3, -20, -52, 53, -51, -44, 58, -28, 45, -25, -53, 5, 23, 4, -44, 51, -56, -27, 25, -43, -17, -26, -23, -20, -3, 19, 43, 26, -60, 51, 34, -45, 13, 10, -18, 42, 42, 10, 15, 44, 1, 42, 51, -29, 24, -6, -9, -38, -52, -28, -25, -51, -22, 33, -24, -53, -24, -24, -43, -37, -39, -57, -48, -36, 25, 5, 16, -26, -39, 24, 26, 10, -47, 18, -8, -19, -20, -2, -29, 31, -13, -26, 28, 46, 52, -29, 5, -47, -20, -13, 29, -62, -35, -10, 11, -23, -58, -22, 32, -34, 9, 7, 46, 38, 27, 44, 44, -24, 26, -35, 62, 34, 45, -15, -39, -43, 5, -47, 0, 11, -70, -31, 3, -38, -62, -35, 2, -44, -12, -56, -55, -23, -57, -27, 21, 18, 44, 25, -45, 28, -43, 18, 18, 37, 22, -38, -32, 20, -30, 53, 19, -2, -25, -2, -51, 33, -28, -64, -54, 37, 37, 65, -44, 27, 6, -16, -59, 7, 8, -55, -61, 60, -42, -48, -34, -4, 27, -45, -44, 34, 5, -9, 58, -9, 38, 16, 21, -50, -19, 33, -8, -41, -44, -11, 4, -57, 22, 44, -42, -53, -33, -37, -43, -63, -26, -55, -60, -18, 38, 49, 51, -54, -65, 11, -52, 36, -40, -16, 60, -42, 17, -36, 26, -8, -10, -43, 29, 56, -27, -40, 42, -13, -62, -65, 40, -55, -34, -23, -52, -22, 46, -24, -2, 62, -12, 6, -49, -41, 17, -34, -52, 59, 39, 51, -77, 54, 18, -40, 15, -18, -8, -3, 35, -46, -30, 34, -17, 22, -8} #define DS-CNN_fc1_biases_0 {70, -26, -43, 9, -30, -46, 25, -44, 15, 3, 21, -13, -13, 38, -4, 5, 7, 32, -1, 2, -1, 12}
4,637.333333
17,286
0.400281
eda68bb14edf1d8807fb67c59f3ba106b2d0d2fa
200
h
C
libs/Common-cpp/include/Microsoft/MixedReality/Sharing/Common/windows.h
ivte-ms/MixedReality-Sharing
edb38467be6dcd09447962a3c1f998fe700b8832
[ "MIT" ]
24
2019-12-11T18:56:39.000Z
2021-12-28T02:48:59.000Z
libs/Common-cpp/include/Microsoft/MixedReality/Sharing/Common/windows.h
ivte-ms/MixedReality-Sharing
edb38467be6dcd09447962a3c1f998fe700b8832
[ "MIT" ]
23
2019-12-11T20:21:30.000Z
2020-02-12T12:12:05.000Z
libs/Common-cpp/include/Microsoft/MixedReality/Sharing/Common/windows.h
ivte-ms/MixedReality-Sharing
edb38467be6dcd09447962a3c1f998fe700b8832
[ "MIT" ]
14
2019-12-11T18:56:44.000Z
2021-06-09T18:13:10.000Z
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. #pragma once // FIXME: Inlcude only on Windows platforms #define WIN32_LEAN_AND_MEAN #define NOMINMAX #include <windows.h>
20
43
0.77
609057e0c9677c9df7fb2f1bb000fcd061b848a4
577
h
C
Project/LooseLeaf/MMRoundedSquareView.h
rogues-gallery/loose-leaf
97269de375031af29c13f270f121cbe082aa453b
[ "MIT" ]
592
2016-12-29T18:30:08.000Z
2022-03-23T09:55:33.000Z
Project/LooseLeaf/MMRoundedSquareView.h
rogues-gallery/loose-leaf
97269de375031af29c13f270f121cbe082aa453b
[ "MIT" ]
179
2016-12-28T21:43:07.000Z
2020-07-30T12:04:30.000Z
Project/LooseLeaf/MMRoundedSquareView.h
rogues-gallery/loose-leaf
97269de375031af29c13f270f121cbe082aa453b
[ "MIT" ]
101
2016-12-29T00:22:46.000Z
2021-08-08T10:16:13.000Z
// // MMRoundedSquareView.h // LooseLeaf // // Created by Adam Wulf on 3/28/16. // Copyright © 2016 Milestone Made, LLC. All rights reserved. // #import <UIKit/UIKit.h> #import "MMRoundedSquareViewDelegate.h" @interface MMRoundedSquareView : UIView @property (nonatomic, readonly) UIView* rotateableSquareView; @property (nonatomic, readonly) UIView* maskedScrollContainer; @property (nonatomic, readonly) CGFloat boxSize; @property (nonatomic, weak) NSObject<MMRoundedSquareViewDelegate>* delegate; @property (nonatomic, assign) BOOL allowTappingOutsideToClose; @end
26.227273
76
0.772964
b80f8cc3f6449afa996f6f52c9bd7d4d23b557e2
691
h
C
brickBreak/BallsHandler.h
CorentinGt/brickBreaker
1a19760ee9ba10bd25d03b56ebc64149b9da0518
[ "MIT" ]
null
null
null
brickBreak/BallsHandler.h
CorentinGt/brickBreaker
1a19760ee9ba10bd25d03b56ebc64149b9da0518
[ "MIT" ]
null
null
null
brickBreak/BallsHandler.h
CorentinGt/brickBreaker
1a19760ee9ba10bd25d03b56ebc64149b9da0518
[ "MIT" ]
1
2015-12-12T10:56:29.000Z
2015-12-12T10:56:29.000Z
#ifndef DEF_BALLSHANDLER #define DEF_BALLSHANDLER #include "Ball.h" #include "Brick.h" #include "bar.h" /*Class that handle commons operation related to ball vector*/ class BallsHandler { public: BallsHandler(); void move(sf::Vector2f&, Bar&, std::vector<Brick*>& ); void ballsMove(sf::Vector2f&); void ballsCollision(); void barCollision(Bar&); void bricksCollision(std::vector<Brick*>&); unsigned int newBall(sf::Vector2f, float , sf::Color ); unsigned int aliveBalls(); void launchBall(Bar&); void draw(sf::RenderWindow&); std::vector<Ball>& getBalls(); private: std::vector<Ball> myBalls; /*Balls array*/ sf::Vector2f standardBallSpeed; /*default ball speed*/ }; #endif
23.033333
62
0.722142
69641898a1c76f22f52be3eb8cfc7d86cd93f1e3
1,013
c
C
crackme3.c
olaredenish2017/olare1995
fa84583a925bb39e59f6c6a690b38cd7e6ef8247
[ "Apache-2.0" ]
null
null
null
crackme3.c
olaredenish2017/olare1995
fa84583a925bb39e59f6c6a690b38cd7e6ef8247
[ "Apache-2.0" ]
1
2021-06-01T00:13:07.000Z
2021-06-01T00:13:07.000Z
crackme3.c
olaredenish2017/olare1995
fa84583a925bb39e59f6c6a690b38cd7e6ef8247
[ "Apache-2.0" ]
null
null
null
/* Sample code to compare password Author: Olare Denish Odhiambo Compile with debug symbols $gcc -m32 -ggdb -mpreferred-stack-boundary=2 -o comparePassword comparePassword.c Compile without debug symbols $gcc -m32 -mpreferred-stack-boundary=2 -o comparePassword comparePassword.c */ #include <stdio.h> #include <string.h> // Function to compare password void compare_string() { // allocate space for the password char USER_PASS[254]; char PASSWORD[] = "SecurityNik"; printf("Enter the password: \n"); // read the user's password fgets(USER_PASS, sizeof(USER_PASS), stdin); // Compare what the user entered with what we expect if (strncmp(USER_PASS, PASSWORD, sizeof(PASSWORD)-1) == 0) printf("Welcome to my world! :-) \n"); else printf("Stay Out! \n"); } int main() { // Call the compare_string function compare_string(); return 0; }
25.325
81
0.615005
5053107f329766aeb253dfdb373681c7f82c6412
403
h
C
chapter_2/libchapter2/src/FilesystemUtils.h
sergey-shambir/cg_course_examples
921b6218d71731bcb79ddddcc92c9d04a72c62ab
[ "MIT" ]
5
2017-05-13T20:47:13.000Z
2020-04-18T18:18:03.000Z
chapter_2/libchapter2/src/FilesystemUtils.h
sergey-shambir/cg_course_examples
921b6218d71731bcb79ddddcc92c9d04a72c62ab
[ "MIT" ]
null
null
null
chapter_2/libchapter2/src/FilesystemUtils.h
sergey-shambir/cg_course_examples
921b6218d71731bcb79ddddcc92c9d04a72c62ab
[ "MIT" ]
8
2016-10-24T16:24:21.000Z
2021-03-15T11:23:57.000Z
#pragma once #include "Utils.h" #include "filesystem_alias.h" #include <string> class CFilesystemUtils { public: CFilesystemUtils() = delete; static fs::path GetResourceAbspath(const fs::path& path); static std::string LoadFileAsString(const fs::path& path); static SDLSurfacePtr LoadImageByPath(const fs::path& path); static TTFFontPtr LoadFixedSizeFont(const fs::path& path, int pointSize); };
25.1875
74
0.766749
da4e65b7cd72c65e3dff1da08fe65555f55e7ef6
676
h
C
ojgl/examples/FreeCameraController.h
nordstroem/OJGL
785127f4367fbfd972396c577cd1b8cd28ba8e01
[ "MIT" ]
null
null
null
ojgl/examples/FreeCameraController.h
nordstroem/OJGL
785127f4367fbfd972396c577cd1b8cd28ba8e01
[ "MIT" ]
5
2017-07-24T22:12:47.000Z
2020-09-21T18:32:32.000Z
ojgl/examples/FreeCameraController.h
nordstroem/OJGL
785127f4367fbfd972396c577cd1b8cd28ba8e01
[ "MIT" ]
1
2017-07-24T21:50:21.000Z
2017-07-24T21:50:21.000Z
#pragma once #include "render/Window.h" #include "utility/Matrix.h" #include "utility/OJstd.h" #include "utility/Vector.h" namespace ojgl { class FreeCameraController { public: Vector3f position { 0, 0, 0 }; float heading = 0.f; float elevation = 0.f; public: static FreeCameraController& instance(); FreeCameraController() = default; void update(const Window& window); Matrix getCameraMatrix() const; void set(const Vector3f& newPosition, float newHeading, float newElevation); private: static constexpr float _translationSpeed = 0.025f; static constexpr float _rotationSpeed = 0.02f; Vector2i _previousCursorPosition; }; }
21.806452
80
0.718935
1351cba40048e577ccfb19b7a7ee072b5690cd6f
619
h
C
runtime/musl-lkl/lkl/include/sound/ac97/compat.h
dme26/intravisor
9bf9c50aa14616bd9bd66eee47623e8b61514058
[ "MIT" ]
11
2022-02-05T12:12:43.000Z
2022-03-08T08:09:08.000Z
runtime/musl-lkl/lkl/include/sound/ac97/compat.h
dme26/intravisor
9bf9c50aa14616bd9bd66eee47623e8b61514058
[ "MIT" ]
3
2021-09-06T09:14:42.000Z
2022-03-27T08:09:54.000Z
runtime/musl-lkl/lkl/include/sound/ac97/compat.h
dme26/intravisor
9bf9c50aa14616bd9bd66eee47623e8b61514058
[ "MIT" ]
1
2022-03-18T07:17:40.000Z
2022-03-18T07:17:40.000Z
/* * Copyright (C) 2016 Robert Jarzmik <robert.jarzmik@free.fr> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This file is for backward compatibility with snd_ac97 structure and its * multiple usages, such as the snd_ac97_bus and snd_ac97_build_ops. * */ #ifndef AC97_COMPAT_H #define AC97_COMPAT_H #include <sound/ac97_codec.h> struct snd_ac97 *snd_ac97_compat_alloc(struct ac97_codec_device *adev); void snd_ac97_compat_release(struct snd_ac97 *ac97); #endif
29.47619
74
0.77706
9284bbf32d3ad853cf666adf272118db0498091f
629
h
C
src/Calculator/Views/CalculatorSymbolicOperators.xaml.h
OGWeekendWarriors/calculator
2aab654055a5be05af5e08e1b639a80e557a4bcd
[ "MIT" ]
null
null
null
src/Calculator/Views/CalculatorSymbolicOperators.xaml.h
OGWeekendWarriors/calculator
2aab654055a5be05af5e08e1b639a80e557a4bcd
[ "MIT" ]
14
2020-03-12T21:58:52.000Z
2020-05-04T01:57:56.000Z
src/Calculator/Views/CalculatorSymbolicOperators.xaml.h
OGWeekendWarriors/calculator
2aab654055a5be05af5e08e1b639a80e557a4bcd
[ "MIT" ]
1
2020-04-21T14:33:22.000Z
2020-04-21T14:33:22.000Z
// // CalculatorStandardOperators.xaml.h // Declaration of the CalculatorStandardOperators class // #pragma once #include "Views/CalculatorSymbolicOperators.g.h" #include "Views/NumberPad.xaml.h" namespace CalculatorApp { [Windows::Foundation::Metadata::WebHostHidden] public ref class CalculatorSymbolicOperators sealed { public: CalculatorSymbolicOperators(); DEPENDENCY_PROPERTY_OWNER(CalculatorSymbolicOperators); property bool IsErrorVisualState { bool get(); void set(bool value); } private: bool m_isErrorVisualState; }; }
20.290323
102
0.688394
a18d6aeed6e2e5b59d07ab4bebf75e674c4591c9
1,147
h
C
kern/include/multitasking.h
A1Liu/dumboss
43881bf0f3bf27c12ec22d53cc27ce2915ebabaf
[ "MIT" ]
null
null
null
kern/include/multitasking.h
A1Liu/dumboss
43881bf0f3bf27c12ec22d53cc27ce2915ebabaf
[ "MIT" ]
null
null
null
kern/include/multitasking.h
A1Liu/dumboss
43881bf0f3bf27c12ec22d53cc27ce2915ebabaf
[ "MIT" ]
null
null
null
#pragma once #include <types.h> typedef enum { Done, Blocked } TaskProgress; typedef void (*TaskCode)(void *data, s64 size); typedef struct { TaskCode code; void *data; s64 data_size; } TaskData; #define add_task(...) PASTE(_add_task, NARG(__VA_ARGS__))(__VA_ARGS__) #define _add_task1(fn) (_Static_assert(CMP_TYPE(typeof(fn())), void), _add_task(fn, NULL, 0)) #define _add_task2(fn, data) \ (_Static_assert(CMP_TYPE(typeof(fn(data))), void), \ (sizeof() > 8) ? _add_task(fn, &(data), sizeof(data)) : _add_task(fn, data, 0)) #define _add_task3(fn, data_ptr, size) \ (_Static_assert(CMP_TYPE(typeof(fn(data, size))), void), _add_task(fn, data_ptr, size)) #define _add_task(fn, data, size) \ add_task_inner((TaskData){.code = (TaskCode)(fn), .data = (void *)(data), .data_size = size}) bool add_task_inner(TaskData data); _Noreturn void task_begin(void); _Noreturn void task_main(void);
42.481481
100
0.556234
5982a0c8df0b6e51a33776ec4c28ae8a24fb4aad
3,269
h
C
incl/c_device_lkm.h
paldier/eip97
ce4edaca76d0e253c98eb1611a7a6b6f45fadb17
[ "BSD-2-Clause" ]
null
null
null
incl/c_device_lkm.h
paldier/eip97
ce4edaca76d0e253c98eb1611a7a6b6f45fadb17
[ "BSD-2-Clause" ]
null
null
null
incl/c_device_lkm.h
paldier/eip97
ce4edaca76d0e253c98eb1611a7a6b6f45fadb17
[ "BSD-2-Clause" ]
null
null
null
/* c_device_lkm.h * * Configuration Handling for Driver Framework Device API implementation. * A build-level configuration file is included and sanity-checked. * Do not edit this file. Edit cs_hwpal_lkm.h instead. */ /***************************************************************************** * Copyright (c) 2010-2014 INSIDE Secure B.V. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 2 of the License, or * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. *****************************************************************************/ /*---------------------------------------------------------------- * get configuration settings from product config file */ #include "cs_hwpal_lkm.h" // choose from LOG_SEVERITY_INFO, LOG_SEVERITY_WARN, LOG_SEVERITY_CRIT #ifndef HWPAL_LOG_SEVERITY #define HWPAL_LOG_SEVERITY LOG_SEVERITY_INFO #endif #ifndef HWPAL_MAX_DEVICE_NAME_LENGTH #error "Expected HWPAL_MAX_DEVICE_NAME_LENGTH \ defined by cs_hwpal_lkm.h" #endif #ifndef HWPAL_DEVICES #error "Expected HWPAL_DEVICES defined by cs_hwpal_lkm.h" #endif // Device driver name used for looking up the device and reporting #ifndef HWPAL_DRIVER_NAME #define HWPAL_DRIVER_NAME "SafeXcel" #endif /*---------------------------------------------------------------- * Other configuration parameters that can be set in a top level * configuration */ /* HWPAL_DEVICE_ID * * Device identification required for implementation of Device API */ /* HWPAL_VENDOR_ID * * Device vendor identification required for implementation of Device API */ /* HWPAL_REMAP_ADDRESSES * * Macro that can be used to remap a device static resource offset * (a relative address) to another address * * Example: * #define HWPAL_REMAP_ADDRESSES HWPAL_REMAP_ONE(0x71004, 0x71200); * */ /* HWPAL_DEVICE_MAGIC * * Optional magic number used to validate device administration data */ /* HWPAL_DEVICE_DIRECT_MEMIO * * Enable this parameter in order to use the direct memory I/O * operations bypassing the Linux kernel memory I/O API */ /* HWPAL_PLATFORM_DEVICE_NAME * * Platform-specific device name that can be used for looking up * device properties */ #ifndef HWPAL_PLATFORM_DEVICE_NAME #define HWPAL_PLATFORM_DEVICE_NAME HWPAL_DRIVER_NAME #endif /* HWPAL_PLATFORM_DEVICE_COMPATIBLE * * Platform-specific compatible device that can be used for device probing * */ #ifndef HWPAL_PLATFORM_DEVICE_COMPATIBLE #define HWPAL_PLATFORM_DEVICE_COMPATIBLE HWPAL_PLATFORM_DEVICE_NAME #endif /* HWPAL_USE_UMDEVXS_DEVICE * * Use external Linux kernel device data structure provided by the kernel * after instantiating the device driver in the kernel. * */ //#define HWPAL_USE_UMDEVXS_DEVICE /* end of file c_device_lkm.h */
28.426087
78
0.705414
deac8816e34e4faa8c03e67354acad5d6aed8287
279
h
C
test/unit-tests/journal_manager/log/log_buffer_parser_mock.h
YongJin-Cho/poseidonos
c07a0240316d4536aa09f22d7977604f3650d752
[ "BSD-3-Clause" ]
null
null
null
test/unit-tests/journal_manager/log/log_buffer_parser_mock.h
YongJin-Cho/poseidonos
c07a0240316d4536aa09f22d7977604f3650d752
[ "BSD-3-Clause" ]
null
null
null
test/unit-tests/journal_manager/log/log_buffer_parser_mock.h
YongJin-Cho/poseidonos
c07a0240316d4536aa09f22d7977604f3650d752
[ "BSD-3-Clause" ]
null
null
null
#include <gmock/gmock.h> #include <list> #include <string> #include <vector> #include "src/journal_manager/log/log_buffer_parser.h" namespace pos { class MockLogBufferParser : public LogBufferParser { public: using LogBufferParser::LogBufferParser; }; } // namespace pos
15.5
54
0.756272
dd0327e8ed2e7ef9fe91cc12c2d9809f8467638e
389
h
C
src/ofxWebWidgets/Widgets/Set.h
elliotwoods/ofxWebWidgets
64dd735e051ce285990f2cd04f24831a5cd488f6
[ "MIT" ]
1
2017-10-02T08:42:25.000Z
2017-10-02T08:42:25.000Z
src/ofxWebWidgets/Widgets/Set.h
elliotwoods/ofxWebWidgets
64dd735e051ce285990f2cd04f24831a5cd488f6
[ "MIT" ]
1
2019-05-05T16:31:21.000Z
2019-05-07T05:32:36.000Z
src/ofxWebWidgets/Widgets/Set.h
elliotwoods/ofxWebWidgets
64dd735e051ce285990f2cd04f24831a5cd488f6
[ "MIT" ]
null
null
null
#pragma once #include "Base.h" #include "../Constants.h" #include "../RequestHandler.h" namespace ofxWebWidgets { namespace Widgets { class Set : public map<size_t, shared_ptr<Base>>, public RequestHandler { public: void add(const shared_ptr<Base> &); void handleRequest(const Request & request, shared_ptr<Response> & response) override; protected: }; } }
24.3125
90
0.686375
6e95743b21dac11c96e2d3b5c57e668cb3126655
3,533
h
C
driver/inc/drv_eeprom.h
cd103/mm_pwm_logo
633f4869f378c411f9e537fb3a88c02511fa40d5
[ "Apache-2.0" ]
1
2019-06-06T08:41:07.000Z
2019-06-06T08:41:07.000Z
driver/inc/drv_eeprom.h
cd103/mm_pwm_logo
633f4869f378c411f9e537fb3a88c02511fa40d5
[ "Apache-2.0" ]
null
null
null
driver/inc/drv_eeprom.h
cd103/mm_pwm_logo
633f4869f378c411f9e537fb3a88c02511fa40d5
[ "Apache-2.0" ]
1
2019-06-06T08:41:14.000Z
2019-06-06T08:41:14.000Z
//////////////////////////////////////////////////////////////////////////////// /// @file DRV_EEPROM.H /// @author C Yuan /// @version v2.0.0 /// @date 2019-02-18 /// @brief THIS FILE CONTAINS ALL THE FUNCTIONS PROTOTYPES FOR THE EEPROM /// DRIVER LAYER. //////////////////////////////////////////////////////////////////////////////// /// @attention /// /// THE EXISTING FIRMWARE IS ONLY FOR REFERENCE, WHICH IS DESIGNED TO PROVIDE /// CUSTOMERS WITH CODING INFORMATION ABOUT THEIR PRODUCTS SO THEY CAN SAVE /// TIME. THEREFORE, MINDMOTION SHALL NOT BE LIABLE FOR ANY DIRECT, INDIRECT OR /// CONSEQUENTIAL DAMAGES ABOUT ANY CLAIMS ARISING OUT OF THE CONTENT OF SUCH /// HARDWARE AND/OR THE USE OF THE CODING INFORMATION CONTAINED HEREIN IN /// CONNECTION WITH PRODUCTS MADE BY CUSTOMERS. /// /// <H2><CENTER>&COPY; COPYRIGHT 2018-2019 MINDMOTION </CENTER></H2> //////////////////////////////////////////////////////////////////////////////// // Define to prevent recursive inclusion -------------------------------------- #ifndef __DRV_EEPROM_H #define __DRV_EEPROM_H //////////////////////////////////////////////////////////////////////////////// /// @addtogroup MM32_Driver_Layer /// @{ //////////////////////////////////////////////////////////////////////////////// /// @defgroup EEPROM /// @brief EEPROM driver modules /// @{ //////////////////////////////////////////////////////////////////////////////// /// @defgroup EEPROM_Exported_Constants /// @{ #if defined(__MZ309) #define EEPROM1 ((u32*)0x08006000) #define EEPROM2 ((u32*)0x08006800) #define EEPROM3 ((u32*)0x08007000) #define EEPROM4 ((u32*)0x08007800) #endif #if defined(__MT304) || defined(__MT307) || defined(__MZ306) || defined(__MZ308) #define EEPROM1 ((u32*)0x0800E000) #define EEPROM2 ((u32*)0x0800E800) #define EEPROM3 ((u32*)0x0800F000) #define EEPROM4 ((u32*)0x0800F800) #endif /// @} //////////////////////////////////////////////////////////////////////////////// /// @defgroup EEPROM_Exported_Types /// @{ //////////////////////////////////////////////////////////////////////////////// /// @brief tEEPROM_INSTANCE //////////////////////////////////////////////////////////////////////////////// typedef struct { tPREFIX sPrefix; u16 size; // block size bool erase; // erase or no erase } tEEPROM_INSTANCE; /// @} //////////////////////////////////////////////////////////////////////////////// /// @defgroup EEPROM_Exported_Variables /// @{ #ifdef _DRV_EEPROM_C_ #define GLOBAL /* -------------------------------------------------------------------- The Sub Handle Index table -------------------------------------------------------------------- */ static u32* tbIpBase[] = {EEPROM1, EEPROM2, EEPROM3, EEPROM4}; static s8 tbSubHandleIdx[] = {0, 1, 2, 3}; /* -------------------------------------------------------------------- The End of Sub Handle Index table -------------------------------------------------------------------- */ GLOBAL static tEEPROM_INSTANCE instance[INSTANCE_NUM]; #else #define GLOBAL extern #endif #undef GLOBAL /// @} //////////////////////////////////////////////////////////////////////////////// /// @defgroup EEPROM_Exported_Functions /// @{ void DRV_EEPROM_Init(u8 idx); /// @} /// @} /// @} //////////////////////////////////////////////////////////////////////////////// #endif /* __DRV_EEPROM_H */ ////////////////////////////////////////////////////////////////////////////////
30.456897
80
0.411831
f0fc5bdc23c877c411c9564a6d54320d87e4d36b
1,604
h
C
AWSCognitoIdentityProvider/Internal/JKBigInteger/AWSJKBigInteger.h
hardikdevios/aws-sdk-ios
6dfaf175a3b551ea3b1f8764f71bceda8942a2f1
[ "Apache-2.0" ]
1,026
2015-01-04T14:53:58.000Z
2018-11-05T15:33:48.000Z
AWSCognitoIdentityProvider/Internal/JKBigInteger/AWSJKBigInteger.h
hardikdevios/aws-sdk-ios
6dfaf175a3b551ea3b1f8764f71bceda8942a2f1
[ "Apache-2.0" ]
1,364
2018-11-07T18:32:17.000Z
2022-03-31T22:03:58.000Z
AWSCognitoIdentityProvider/Internal/JKBigInteger/AWSJKBigInteger.h
hardikdevios/aws-sdk-ios
6dfaf175a3b551ea3b1f8764f71bceda8942a2f1
[ "Apache-2.0" ]
609
2015-01-01T16:30:03.000Z
2018-10-31T01:29:14.000Z
// // AWSJKBigInteger.h // AWSJKBigInteger // // Created by Jānis Kiršteins on 5/21/13. // Copyright (c) 2013 Jānis Kiršteins. All rights reserved. // #import <Foundation/Foundation.h> #include "aws_tommath.h" @interface AWSJKBigInteger : NSObject <NSSecureCoding> - (id)initWithValue:(aws_mp_int *)value; - (aws_mp_int *)value; - (id)initWithUnsignedLong:(unsigned long)ul; - (id)initWithString:(NSString *)string; - (id)initWithString:(NSString *)string andRadix:(int)radix; - (id)initWithCString:(char *)cString; - (id)initWithCString:(char *)cString andRadix:(int)radix; - (id)add:(AWSJKBigInteger *)bigInteger; - (id)subtract:(AWSJKBigInteger *)bigInteger; - (id)multiply:(AWSJKBigInteger *)bigInteger; - (id)divide:(AWSJKBigInteger *)bigInteger; - (id)remainder:(AWSJKBigInteger *)bigInteger; - (NSArray *)divideAndRemainder:(AWSJKBigInteger *)bigInteger; - (id)pow:(unsigned int)exponent; - (id)pow:(AWSJKBigInteger*)exponent andMod:(AWSJKBigInteger*)modulus; - (id)negate; - (id)abs; - (id)bitwiseXor:(AWSJKBigInteger *)bigInteger; - (id)bitwiseOr:(AWSJKBigInteger *)bigInteger; - (id)bitwiseAnd:(AWSJKBigInteger *)bigInteger; - (id)shiftLeft:(unsigned int)n; - (id)shiftRight:(unsigned int)n; - (id)gcd:(AWSJKBigInteger *)bigInteger; - (NSComparisonResult) compare:(AWSJKBigInteger *)bigInteger; - (unsigned long)unsignedIntValue; - (NSString *)stringValue; - (NSString *)stringValueWithRadix:(int)radix; - (NSString *)description; - (unsigned int)countBytes; - (void)toByteArraySigned: (unsigned char*) byteArray; - (void)toByteArrayUnsigned: (unsigned char*) byteArray; @end
28.140351
70
0.740648
2145c304fa7fddbacae2f4fe765e40e1152b67b9
5,772
c
C
user-contributed/imsor/sources/asc2hips.c
mikelandy/HIPS
fb5440573848cd22d55771484e3c036b6007f780
[ "MIT" ]
null
null
null
user-contributed/imsor/sources/asc2hips.c
mikelandy/HIPS
fb5440573848cd22d55771484e3c036b6007f780
[ "MIT" ]
null
null
null
user-contributed/imsor/sources/asc2hips.c
mikelandy/HIPS
fb5440573848cd22d55771484e3c036b6007f780
[ "MIT" ]
null
null
null
/* Copyright (c) 1992 Karsten Hartelius, IMSOR. Disclaimer: No guarantees of performance accompany this software, nor is any responsibility assumed on the part of the authors. All the software has been tested extensively and every effort has been made to insure its reliability. asc2hips - transforms an ascii-file to a HIPS-file. language: c. Program works with HIPS2. usage: see manual to load: cc -o asc2hips asc2hips.C -lm -lhips to run: asc2hips < ASCII-file > HIPS-file include-files: util.h Karsten Hartelius, IMSOR, 16/11 1992. */ #include "util.h" #define MAXFORM 20 struct Form { int num, size, type; }; struct Form format[MAXFORM]; struct header hd; int Nelem, /* number of variables including coordinates */ Nrec, /* number of data-records */ Nrows, /* number of rows in output */ Ncols, /* number of coloumns in output */ Nformat, /* number of format-types */ xpos, /* coloumn-number of x-coordinate */ ypos, /* coloumn-number of y-coordinate */ out_format; /* format of output */ Boolean defaultformat, /* input is alined in separate coloumns */ defaultsplit, /* end-of-record marker is space or newline */ irregular, /* output is a file of Irregular format */ element_seq; /* data listet as record-wise */ Fmatrix data; /* matrix containing data */ char splitmark; /* end-of-record marker */ char nextchar(); int main(argc,argv) int argc; char* argv[]; { void rparam(), read_default(), read_special(), shift_order(), printout(); Progname = strsave(*argv); rparam(argc,argv); data=fmatrix(Nelem,Nrec); if (defaultformat) read_default(); else read_special(); if (element_seq) shift_order(); printout(argc,argv); return(0); } void printout(argc,argv) int argc; char* argv[]; { int i; struct header hd; init_header(&hd,"IMSOR","",Nelem,"",Nrows,Ncols,out_format,1); if (irregular) setparam(&hd,"Irregular",PFBYTE,1,1); update_header(&hd,argc,argv); write_header(&hd); fwrite_from_fvec(stdout,data[xpos],Nrec,out_format); if (Nelem > 1) fwrite_from_fvec(stdout,data[ypos],Nrec,out_format); for (i=0;i<Nelem;i++) if ((i!=xpos) && (i!=ypos)){ fwrite_from_fvec(stdout,data[i],Nrec,out_format); } return; } void rparam(argc,argv) int argc; char* argv[]; { int i, j, l; splitmark = ' '; defaultformat= TRUE; defaultsplit= TRUE; irregular= TRUE; element_seq = FALSE; Nelem = 0; Nrec = 0; Nrows = 1; out_format = PFFLOAT; xpos = 0; ypos = 1; /* read parameters */ for (i=1;i<argc;i++){ if ( (!strcmp(argv[i],"-f")) || (!strcmp(argv[i],"-e"))){ Nelem=atoi(argv[++i]); continue; } if ( (!strcmp(argv[i],"-n")) || (!strcmp(argv[i],"-nc"))){ Nrec=atoi(argv[++i]); continue; } if (!strcmp(argv[i],"-r")){ Nrows=atoi(argv[++i]); irregular=FALSE; continue; } if (!strcmp(argv[i],"-x")){ xpos=atoi(argv[++i]); continue; } if (!strcmp(argv[i],"-y")){ ypos=atoi(argv[++i]); continue; } if (!strcmp(argv[i],"-a")){ element_seq = TRUE; continue; } if (!strcmp(argv[i],"-form")){ defaultformat=FALSE; Nelem = 0; i++; for (j=0; ((i<argc) && (argv[i][0]!='-'));j++,i++){ if ((format[j].num = atoi(argv[i++])) == 0) perr(HE_MSG,"option f: error in argument"); if (!strcmp("f",argv[i])){ format[j].type = 1; Nelem += format[j].num; format[j].size = atoi(argv[++i]); } else if (!strcmp("s",argv[i])) format[j].type=2; else perr(HE_MSG,"error in format-specification"); } Nformat=j; i--; continue; } if (!strcmp(argv[i],"-s")){ defaultsplit=FALSE; splitmark=argv[++i][0]; continue; } if (!strcmp(argv[i],"-w8")){ out_format=PFDOUBLE; continue; } perr(HE_MSG,"wrong argument"); } if (Nelem == 0) perror("missing specification of record size"); if (Nrec == 0) perror("missing number of records"); if ((xpos >= Nelem) || (ypos >= Nelem)) perror("bad position of x- or y-coordinates"); if (Nrec % Nrows != 0) perror("wrong number of rows"); else Ncols=Nrec/Nrows; return; } void read_default() { int i, j; char c; i=0; while ((i < Nrec) && (!feof(stdin))){ for (j=0;j<Nelem;j++) if (!scanf(" %f ", &data[j][i])) perr(HE_MSG,"error during read"); if ((!defaultsplit) && (i<Nrec-1)) do c=nextchar(); while ((!feof(stdin)) && (splitmark!=c)); i++; } if (Nrec != i) perr(HE_MSG,"bad number of records"); return; } void read_special() { int i, j, k, l, f; char streng[10], c; i=0; while ((i < Nrec) && (!feof(stdin))){ j=0; for (f=0;f<Nformat;f++) switch (format[f].type){ case 1: for (k=0;k<format[f].num;k++){ for (l=0;l<format[f].size;l++) streng[l]=nextchar(); streng[format[f].size]='\0'; data[j++][i]=atof(streng); } break; case 2: for (k=0;k<format[f].num;k++) c=nextchar(); break; } if (!defaultsplit && (i<Nrec-1)) do c=nextchar(); while ((!feof(stdin)) && (c!=splitmark)); i++; } if (Nrec != i) perror("wrong number of records in input"); return; } char nextchar() { char c; do { if ((c=getchar())==EOF) perr(HE_MSG,"end-of-file during read"); } while (c=='\n'); return c; } void shift_order() { int i, j, pos=0; /* shift frames and coloumns, corresponding to the case where data are listet in element-sequence instead of record-sequence. */ Fmatrix data2; data2=fmatrix(Nrec,Nelem); for (i=0;i<Nelem;i++) for (j=0;j<Nrec;j++) data2[j][i] = data[i][j]; for (i=0;i<Nelem;i++) for (j=0;j<Nrec;j++){ data[i][j]=data2[pos/Nelem][pos%Nelem]; pos++; } return; }
20.323944
71
0.588704
3970f6a12e7891de139a769a09d02f688238f64f
692
c
C
src/enum.c
jspahrsummers/libextc
7ab147f762f01957d1991e15380e4d9e25e51d94
[ "MIT" ]
33
2015-03-30T23:04:04.000Z
2022-02-21T12:48:57.000Z
src/enum.c
jspahrsummers/libextc
7ab147f762f01957d1991e15380e4d9e25e51d94
[ "MIT" ]
null
null
null
src/enum.c
jspahrsummers/libextc
7ab147f762f01957d1991e15380e4d9e25e51d94
[ "MIT" ]
3
2016-07-10T11:37:10.000Z
2021-10-30T07:15:06.000Z
/** * More versatile enumerations * ExtendedC * * Copyright (C) 2012 Justin Spahr-Summers * Released under the MIT license */ #include <string.h> #include "enum.h" int enum_from_string_ (const struct enum_map_item *items, size_t itemCount, const char *name) { for (size_t i = 0;i < itemCount;++i) { if (items[i].name == name || strcmp(items[i].name, name) == 0) return items[i].code; } return INT_MIN; } const char *enum_to_string_ (const struct enum_map_item *items, size_t itemCount, int code) { for (size_t i = 0;i < itemCount;++i) { if (items[i].code == code) return items[i].name; } return NULL; }
23.862069
101
0.609827
e8ba8032505555c5c4373383169f1f4e9f5aea8c
5,164
h
C
libcapture/include/udpcapture/gvcp.h
OlegZhavoronkov/tnk_certification
9ef3544f3fd27073b78e38bba26af76e79f55a78
[ "Unlicense" ]
null
null
null
libcapture/include/udpcapture/gvcp.h
OlegZhavoronkov/tnk_certification
9ef3544f3fd27073b78e38bba26af76e79f55a78
[ "Unlicense" ]
null
null
null
libcapture/include/udpcapture/gvcp.h
OlegZhavoronkov/tnk_certification
9ef3544f3fd27073b78e38bba26af76e79f55a78
[ "Unlicense" ]
null
null
null
#ifndef _GVCP_H_ #define _GVCP_H_ #ifdef __cplusplus extern "C" { #endif #include <stdint.h> //used only for recv discovery package -- now as magic value #define GV_INTERFACE_DISCOVERY_BUFFER_SIZE (512 *1024) #define GV_DEVICE_BUFFER_SIZE (16 * 1024) //GigE Vision Specification #define GVCP_DEVICE_PORT 3956 //GVCP #define GVCP_DISCOVERY_DATA_SIZE 0xf8 #define GVCP_MANUFACTURER_NAME_OFFSET 0x00000048 #define GVCP_MANUFACTURER_NAME_SIZE 32 #define GVCP_MODEL_NAME_OFFSET 0x00000068 #define GVCP_MODEL_NAME_SIZE 32 #define GVCP_DEVICE_VERSION_OFFSET 0x00000088 #define GVCP_DEVICE_VERSION_SIZE 32 #define GVCP_MANUFACTURER_INFORMATIONS_OFFSET 0x000000a8 #define GVCP_MANUFACTURER_INFORMATIONS_SIZE 48 #define GVCP_SERIAL_NUMBER_OFFSET 0x000000d8 #define GVCP_SERIAL_NUMBER_SIZE 16 #define GVCP_USER_DEFINED_NAME_OFFSET 0x000000e8 #define GVCP_USER_DEFINED_NAME_SIZE 16 #define GVCP_DEVICE_MAC_ADDRESS_HIGH_OFFSET 0x00000008 //register addresses #define GV_GVCP_CAPABILITY_OFFSET 0x00000934 #define GV_REGISTER_N_STREAM_CHANNELS_OFFSET 0x00000904 #define GV_HEARTBEAT_TIMEOUT_OFFSET 0x00000938 #define GV_TIMESTAMP_TICK_FREQUENCY_HIGH_OFFSET 0x0000093c #define GV_TIMESTAMP_TICK_FREQUENCY_LOW_OFFSET 0x00000940 #define GV_TIMESTAMP_CONTROL_OFFSET 0x00000944 #define GV_STREAM_CHANNEL_0_IP_ADDRESS_OFFSET 0x00000d18 #define GV_STREAM_CHANNEL_0_PORT_OFFSET 0x00000d00 #define GV_STREAM_CHANNEL_0_PACKET_SIZE_OFFSET 0x00000d04 #define GV_STREAM_CHANNEL_SOURCE_PORT_OFFSET 0x00000d1c #define GV_CONTROL_CHANNEL_PRIVILEGE_OFFSET 0x00000a00 #define GV_XML_URL_0_OFFSET 0x00000200 #define GV_XML_URL_1_OFFSET 0x00000400 #define GV_XML_URL_SIZE 512 #define next_packet_id(id) (0xf000 | ((++(id)) & 0xfff)) enum gvcp_command { GVCP_COMMAND_DISCOVERY_CMD = 0x0002, GVCP_COMMAND_DISCOVERY_ACK = 0x0003, GVCP_COMMAND_PACKET_RESEND_CMD = 0x0040, GVCP_COMMAND_PACKET_RESEND_ACK = 0x0041, GVCP_COMMAND_READ_REG_CMD = 0x0080, GVCP_COMMAND_READ_REG_ACK = 0x0081, GVCP_COMMAND_WRITE_REG_CMD = 0x0082, GVCP_COMMAND_WRITE_REG_ACK = 0x0083, GVCP_COMMAND_READ_MEM_CMD = 0x0084, GVCP_COMMAND_READ_MEM_ACK = 0x0085, GVCP_COMMAND_WRITE_MEM_CMD = 0x0086, GVCP_COMMAND_WRITE_MEM_ACK = 0x0087 }; enum gvcp_packet_type { GVCP_PACKET_TYPE_ACK = 0x00, GVCP_PACKET_TYPE_CMD = 0x42, GVCP_PACKET_TYPE_ERROR = 0x80, GVCP_PACKET_TYPE_UNKNOWN_ERROR = 0x8f }; enum gvcp_cmd_packet_flags { GVCP_CMD_PACKET_FLAGS_NONE = 0x00, GVCP_CMD_PACKET_FLAGS_ACK_REQUIRED = 0x01, GVCP_CMD_PACKET_FLAGS_EXTENDED_IDS = 0x10 }; //__attribute__((packed)) used for alignement as is (any way wrong offset of packet_id) struct gvcp_header{ uint8_t packet_type; uint8_t packet_flags; uint16_t command; uint16_t size; uint16_t id; }; __attribute__((packed)) struct gvcp_packet { struct gvcp_header header; char data[]; }; static inline void dump_data(const char *prefix, char *bytes, size_t size) { uint32_t i; fprintf(stdout, "%s: ", prefix); fflush(stdout); if (!bytes) { fprintf(stdout, "<null>\n"); fflush(stdout); return; } for (i = 0; i < size; i++) { fprintf(stdout, "%02hhx ", bytes[i]); fflush(stdout); } fprintf(stdout, "\n"); fflush(stdout); } #if 0 //moved to macros with the same name static inline uint16_t next_packet_id(uint16_t packet_id) { //bug: not updated packet_id return 0xf000 | ((++packet_id) & 0xfff); } #endif int get_net_parameters_from_socket(int fd, uint32_t *ip_value, uint32_t *port_value); void print_packet_full(struct gvcp_packet *packet); void print_packet_header(struct gvcp_packet *packet); void print_packet_data(struct gvcp_packet *packet); struct gvcp_packet *gvcp_discovery_packet(size_t *packet_size); int gvcp_discovery_ack(char *vendor, char *model, char *serial, char *uder_id, char *mac, struct gvcp_packet *packet); struct gvcp_packet *gvcp_read_register_packet(uint32_t reg_addr, uint32_t packet_id, uint32_t *packet_size); struct gvcp_packet *gvcp_write_register_packet(uint32_t reg_addr, uint32_t reg_value, uint32_t packet_id, uint32_t *packet_size); int gvcp_register_ack(uint32_t *value, struct gvcp_packet *packet); uint64_t gvcp_get_timestamp_tick_frequency(int fd, uint32_t packet_id); //important: read/write commands are possible only after connect to command socket int read_register(int fd, uint32_t reg_addr, uint32_t *value, uint32_t packet_id); //important: read/write commands are possible only after connect to command socket int write_register(int fd, uint32_t reg_addr, uint32_t value, uint32_t packet_id); //with timeout 500000us //TODO: make constant struct gvcp_packet *listen_packet_ack(int fd); //commands in registers uint32_t gvcp_init(int fd, uint32_t packet_id, int data_fd); int gvcp_watchdog(int fd, uint32_t packet_id); #ifdef __cplusplus } #endif #endif //_GVCP_H_
31.876543
129
0.75426
056cb7c6bc74c0d39b1289e83bea2ff2b1cf4012
5,468
c
C
src/matrix/src/matrix.c
vyacheslav-bezborodov/libem
63da1a21298ade746c2f84d3aeddc66461da86cc
[ "MIT" ]
null
null
null
src/matrix/src/matrix.c
vyacheslav-bezborodov/libem
63da1a21298ade746c2f84d3aeddc66461da86cc
[ "MIT" ]
null
null
null
src/matrix/src/matrix.c
vyacheslav-bezborodov/libem
63da1a21298ade746c2f84d3aeddc66461da86cc
[ "MIT" ]
null
null
null
#include <omp.h> #include <stdlib.h> #include <string.h> #include <limits.h> #include <matrix/matrix.h> int mtx_init(struct mtx* const m, size_t rows, size_t columns, mpfr_prec_t prec) { m->nrows = rows; m->ncols = columns; m->storage = (mpfr_t*) malloc(sizeof(mpfr_t) * m->nrows * m->ncols); if (NULL == m->storage) { return -1; } size_t i, j; #pragma omp parallel for private(i, j) schedule(static) for(i = 0; i < m->nrows; ++i) { for(j = 0; j < m->ncols; ++j) { mpfr_init2(*(m->storage + i * m->ncols + j), prec); } } return 0; } int mtx_clear(struct mtx const m) { size_t i, j; #pragma omp parallel for private(i, j) schedule(static) for(i = 0; i < m.nrows; ++i) { for(j = 0; j < m.ncols; ++j) { mpfr_clear(*(m.storage + i * m.ncols + j)); } } free(m.storage); return 0; } int mtx_fprint(FILE* stream, struct mtx const m) { int total = 0; int chars = 0; size_t i, j; for(i = 0; i < m.nrows; ++i) { for(j = 0; j < m.ncols; ++j) { chars = mpfr_fprintf(stream, "%Rf ", *(m.storage + i * m.ncols + j)); if (chars < 0) { return 0; } total += chars; } chars = fprintf(stream, "\n"); if (chars < 0) { return 0; } total += chars; } return total; } int mtx_fscan(FILE* stream, struct mtx m, char const* delim) { char buf[LINE_MAX]; size_t i, j; for (i = 0; i < m.nrows; ++i) { fgets(buf, LINE_MAX, stream); char* token = (char*) strtok(buf, delim); for (j = 0; j < m.ncols; ++j) { if (NULL == token) return -1; double d = atof(token); mpfr_t* const ptr = m.storage + i * m.ncols + j; mpfr_set_d(*ptr, d, MPFR_RNDN); token = (char*) strtok(NULL, delim); } } return 0; } int mtx_fill(struct mtx m, mpfr_t val, mpfr_t diagval) { size_t i, j; #pragma omp parallel for shared(m) private(i, j) schedule(static) for (i = 0; i < m.nrows; ++i) { for (j = 0; j < m.ncols; ++j) { mpfr_t* const ptr = m.storage + i * m.ncols + j; if (m.nrows == m.ncols) { if (i == j) { mpfr_set(*ptr, diagval, MPFR_RNDN); } else { mpfr_set(*ptr, val, MPFR_RNDN); } } else { mpfr_set(*ptr, val, MPFR_RNDN); } } } return 0; } int mtx_fill_d(struct mtx m, double val, double diagval) { size_t i, j; #pragma omp parallel for shared(m) private(i, j) schedule(static) for (i = 0; i < m.nrows; ++i) { for (j = 0; j < m.ncols; ++j) { mpfr_t* const ptr = m.storage + i * m.ncols + j; if (m.nrows == m.ncols) { if (i == j) { mpfr_set_d(*ptr, diagval, MPFR_RNDN); } else { mpfr_set_d(*ptr, val, MPFR_RNDN); } } else { mpfr_set_d(*ptr, val, MPFR_RNDN); } } } return 0; } int mtx_copy(struct mtx rop, struct mtx const op) { if (rop.nrows != op.nrows || rop.ncols != op.ncols) return -1; size_t i, j; #pragma omp parallel for shared(rop) private(i, j) schedule(static) for (i = 0; i < rop.nrows; ++i) { for (j = 0; j < rop.ncols; ++j) { mpfr_t* const rptr = rop.storage + i * rop.ncols + j; mpfr_t* const optr = op.storage + i * op.ncols + j; mpfr_set(*rptr, *optr, MPFR_RNDN); } } return 0; } int mtx_mul(struct mtx rop, struct mtx const op1, struct mtx const op2) { if (rop.nrows != op1.nrows || rop.ncols != op2.ncols) return -1; if (op1.ncols != op2.nrows) return -1; mpfr_prec_t const prec = mpfr_get_prec(*rop.storage); size_t i, j, k; #pragma omp parallel for shared(rop) private(i, j, k) schedule(static) for (i = 0; i < op1.nrows; ++i) { for (j = 0; j < op2.ncols; ++j) { mpfr_t* const prop = rop.storage + i * rop.ncols + j; mpfr_set_ui(*prop, 0, MPFR_RNDN); for (k = 0; k < op1.ncols; ++k) { mpfr_t* const pop1 = op1.storage + i * op1.ncols + k; mpfr_t* const pop2 = op2.storage + k * op2.ncols + j; mpfr_t tmp; mpfr_init2(tmp, prec); mpfr_mul(tmp, *pop1, *pop2, MPFR_RNDN); mpfr_add(*prop, *prop, tmp, MPFR_RNDN); mpfr_clear(tmp); } } } return 0; } int mtx_mulval(struct mtx rop, struct mtx const op1, mpfr_t op2) { if (rop.nrows != op1.nrows || rop.ncols != op1.ncols) { return -1; } size_t i, j; #pragma omp parallel for shared(rop) private(i, j) schedule(static) for (i = 0; i < op1.nrows; ++i) { for (j = 0; j < op1.ncols; ++j) { mpfr_t* const prop = rop.storage + i * rop.ncols + j; mpfr_t* const pop1 = op1.storage + i * op1.ncols + j; mpfr_mul(*prop, *pop1, op2, MPFR_RNDN); } } return 0; } int mtx_add(struct mtx rop, struct mtx const op1, struct mtx const op2) { if (op1.nrows != op2.nrows || op1.ncols != op2.ncols) { return -1; } if (rop.nrows != op1.nrows || rop.ncols != op1.ncols) { return -1; } size_t i, j; #pragma omp parallel for shared(rop) private(i, j) schedule(static) for (i = 0; i < rop.nrows; ++i) { for (j = 0; j < rop.ncols; ++j) { mpfr_add(*(rop.storage + i * rop.ncols + j), *(op1.storage + i * op1.ncols + j), *(op2.storage + i * op2.ncols + j), MPFR_RNDN); } } return 0; } int mtx_tr(struct mtx rop, struct mtx const op) { if (rop.nrows != op.ncols || rop.ncols != op.nrows) { return -1; } size_t i, j; #pragma omp parallel for shared(rop) private(i, j) schedule(static) for (i = 0; i < rop.nrows; ++i) { for (j = 0; j < rop.ncols; ++j) { mpfr_set(*(rop.storage + i * rop.ncols + j), *(op.storage + j * op.ncols + i), MPFR_RNDN); } } return 0; }
17.811075
131
0.565838
b23c6ba885a68657ee113284990a7e1d4e873fa6
737
h
C
src/rootheader.h
BenjaminMichaelis/EscapeCOVID
97c2d7a19e04bbe2d54d4b3f7ff5cdb3fb0637ea
[ "MIT" ]
5
2020-06-09T21:18:36.000Z
2020-06-11T19:41:34.000Z
src/rootheader.h
BenjaminMichaelis/EscapeCOVID
97c2d7a19e04bbe2d54d4b3f7ff5cdb3fb0637ea
[ "MIT" ]
3
2020-06-11T07:17:20.000Z
2021-02-25T06:53:17.000Z
src/rootheader.h
BenjaminMichaelis/EscapeCOVID
97c2d7a19e04bbe2d54d4b3f7ff5cdb3fb0637ea
[ "MIT" ]
1
2020-06-22T16:06:00.000Z
2020-06-22T16:06:00.000Z
#ifndef ROOTHEADER_H #define ROOTHEADER_H #include <SFML/Graphics.hpp> #include <iostream> #include <time.h> using namespace std; using namespace sf; const int PLAYER_W = 15; const int PLAYER_H = 26; // base dimension for virus sprite: const int VIRUS_SIZE = 20; // base dimension for the effective game-window: const int FRAME_WIDTH = 425; const int FRAME_LENGTH = 425; // default starting location for the player sprite: const int PLAYER_DEFAULT_X = 213; const int PLAYER_DEFAULT_Y = 213; // default moving speed: const int DEFAULT_SPEED = 5; //WindowColors const int COLORRED = 127; const int COLORGREEN = 127; const int COLORBLUE = 127; const int COLORALPHA = 127; // execute a game instance: void gameInstance(); #endif
18.425
51
0.750339
b29968663c6cb0b85db197a90a36701660a5525b
6,553
h
C
src/sim/Streamer/StreamerOutputCache.h
attila-sim/attila-sim
a64b57240b4e10dc4df7f21eff0232b28df09532
[ "BSD-3-Clause" ]
23
2016-01-14T04:47:13.000Z
2022-01-13T14:02:08.000Z
src/sim/Streamer/StreamerOutputCache.h
attila-sim/attila-sim
a64b57240b4e10dc4df7f21eff0232b28df09532
[ "BSD-3-Clause" ]
2
2018-03-25T14:39:20.000Z
2022-03-18T05:11:21.000Z
src/sim/Streamer/StreamerOutputCache.h
attila-sim/attila-sim
a64b57240b4e10dc4df7f21eff0232b28df09532
[ "BSD-3-Clause" ]
17
2016-02-13T05:35:35.000Z
2022-03-24T16:05:40.000Z
/************************************************************************** * * Copyright (c) 2002 - 2011 by Computer Architecture Department, * Universitat Politecnica de Catalunya. * All rights reserved. * * The contents of this file may not be disclosed to third parties, * copied or duplicated in any form, in whole or in part, without the * prior permission of the authors, Computer Architecture Department * and Universitat Politecnica de Catalunya. * * $RCSfile: StreamerOutputCache.h,v $ * $Revision: 1.7 $ * $Author: vmoya $ * $Date: 2008-02-22 18:32:54 $ * * Streamer Output Cache class definition file. * */ /** * * @file StreamerOutputCache.h * * This file contains the definition of the Streamer Output Cache * box. * */ #ifndef _STREAMEROUTPUTCACHE_ #define _STREAMEROUTPUTCACHE_ namespace gpu3d { class StreamerOutputCache; } // namespace gpu3d; #include "GPUTypes.h" #include "Box.h" #include "Streamer.h" #include "StreamerCommand.h" #include "StreamerControlCommand.h" namespace gpu3d { /** * * This class implements the Streamer Output Cache box. * * The Streamer Output Cache receives new input indexes from * the Streamer Fetch and look for them in the output cache. * Then sends the new index, a hit/miss flag and the output * memory line allocated for the index to the Streamer Commit * and Streamer Loader. * * This class inherits from the Box class that offers basic * simulation support. * */ class StreamerOutputCache : public Box { private: /* Streamer Output Cache signals. */ Signal *streamerCommand; /**< Command signal from the Streamer main box. */ Signal *streamerFetchNewIndex; /**< New Index signal from the Streamer Fetch. */ Signal *streamerCommitNewIndex; /**< New Index signal to the Streamer Commit. */ Signal **streamerLoaderNewIndex;/**< New Index signal to the Streamer Loader Units. */ Signal *streamerCommitDeAlloc; /**< Deallocation signal from the Streamer Commit. */ Signal *streamerOCUpdateWrite; /**< Streamer Output Cache update signal to the Streamer Output Cache. */ Signal *streamerOCUpdateRead; /**< Streamer Output Cache update signal from the Streamer Output Cache. */ /* Streamer Output Cache parameters. */ u32bit indicesCycle; /**< Indices received per cycle from Streamer Fetch. */ u32bit outputMemorySize; /**< Size in lines (outputs) of the output memory. */ u32bit verticesCycle; /**< Vertices per cycle commited and sent to Primitive Assembly by Streamer Commit. */ u32bit streamerLoaderUnits; /**< Number of Streamer Loader Units. */ u32bit slIndicesCycle; /**< Indices consumed each cycle per Streamer Loader Unit. */ /* Streamer Output Cache state. */ StreamerState state; /**< State of the streamer output cache. */ StreamerCommand *lastStreamCom; /**< Last streamer command received. For signal tracing. */ StreamerControlCommand **indexReqQ; /**< Array storing the indices requested in the current cycle by Streamer Fetch. */ u32bit indicesRequested; /**< Number of indices requested to the cache in the current cycle. */ u32bit **missOutputMLines; /**< Array storing the output cache line allocated for index misses already processed in the current cycle. */ u32bit solvedMisses; /**< Number of misses already solved (excluded repeated misses). */ /* Streamer Output Cache structures. */ u32bit *outputCacheTagsIndex; /**< Output cache tags (index). */ u32bit *outputCacheTagsInstance; /**< Output cache tags (instance index). */ bool *outputCacheValidBit; /**< Output cache valid bit. */ u32bit *outputMemoryFreeList; /**< List of free output memory lines. */ u32bit freeOutputMemoryLines; /**< Number of free output memory lines. */ u32bit nextFreeOMLine; /**< Pointer to the next free output memory line in the output memory free list. */ u32bit **unconfirmedOMLineDeAllocs; /**< Array of deallocated output memory lines from Streamer Commit pending of confirmation. */ u32bit *unconfirmedDeAllocCounters; /**< Number of deallocated output memory lines from Streamer Commit pending of confirmation. */ bool *deAllocConfirmed; /**< Array of confirmation status of deallocated lines. */ /* Statistics. */ GPUStatistics::Statistic *hits; /**< Number of hits in the Streamer Output Cache. */ GPUStatistics::Statistic *misses; /**< Number of misses in the Streamer Output Cache. */ GPUStatistics::Statistic *indices; /**< Number of indices sent to Streamer Output Cache. */ /* Private functions. */ /** * * Processes a streamer command. * * @param streamComm The streamer command to process. * */ void processStreamerCommand(StreamerCommand *streamCom); /** * * Searches in the output cache tag table for an index. * * @param index The index to search. * @param instance The instance index corresponding to the index to search. * @param omLine Reference to an u32bit variable where to store * the output memory line where the index output is stored * if the index was found. * * @return TRUE if the index was found in the tag table, * FALSE otherwise. * */ bool outputCacheSearch(u32bit index, u32bit instance, u32bit &omLine); public: /** * * Streamer Output Cache box constructor. * * @param idxCycle Indices received per cycle from Streamer Fetch. * @param omSize The output memory size in lines. * @param vertCycle Vertices per cycle that Streamer Commit can commit and send to Primitive Assembly. * @param sLoaderUnits Number of Streamer Loader Units. * @param slIdxCycle Indices consumed each cycle per Streamer Loader Unit. * @param name The box name. * @param parent The box parent box. * * @return An initialized Streamer Output Cache object. * */ StreamerOutputCache(u32bit idxCycle, u32bit omSize, u32bit vertCycle, u32bit sLoaderUnits, u32bit slIdxCycle, char *name, Box *parent); /** * * Simulation rutine for the Streamer Output Cache box. * * @param cycle Cycle to simulate. * * */ void clock(u64bit cycle); }; } // namespace gpu3d #endif
36.814607
152
0.662292
c9a833ed2d78a870c141d204bbd963bfe080e913
876
h
C
client/defs.h
thouis/tankhunt
f04ba5b594120c9115b66f37746bcd67450b8ea5
[ "Info-ZIP" ]
1
2019-12-02T13:54:44.000Z
2019-12-02T13:54:44.000Z
client/defs.h
thouis/tankhunt
f04ba5b594120c9115b66f37746bcd67450b8ea5
[ "Info-ZIP" ]
null
null
null
client/defs.h
thouis/tankhunt
f04ba5b594120c9115b66f37746bcd67450b8ea5
[ "Info-ZIP" ]
null
null
null
/* defs.h - #defines for the client */ #ifndef DEFS_H #define DEFS_H /* width of the window */ #define WIN_WIDTH 901 #define HALF_WIDTH 450 /* height of the window */ #define WIN_HEIGHT 901 #define HALF_HEIGHT 450 /* how many pixels wide and high is a box */ #define BOX_SIZE 300 /* * maximum number of players the client can handle being on the screen * at one time */ #define MAX_PLAYERS 50 /* * maximum number of bullets the client can handle being on the screen * at one time */ #define MAX_BULLETS 200 /* default sevrer the client connects to */ #define DEFAULT_SERVER "lance" /* default port the client tries to connect to */ #define DEFAULT_PORT 3333 /* maximum size we expect a server packet to be */ #define MAX_PACKET_SIZE 5000 /* what environment variable do we store the keymap in? */ #define KEY_MAP_VARIABLE "TANK_HUNT_MAP" #endif DEFS_H
20.857143
70
0.728311
f97284edd30a3ae58d5a40449fff38cc5231ecde
1,029
c
C
util/compiler.c
yorickdewid/Lavril
4ed8f1138a5fab3c0a7b0f066647aab04861833c
[ "MIT" ]
null
null
null
util/compiler.c
yorickdewid/Lavril
4ed8f1138a5fab3c0a7b0f066647aab04861833c
[ "MIT" ]
null
null
null
util/compiler.c
yorickdewid/Lavril
4ed8f1138a5fab3c0a7b0f066647aab04861833c
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdarg.h> #if defined(_MSC_VER) && defined(_DEBUG) #include <crtdbg.h> #include <conio.h> #endif #include <lavril.h> #ifdef LVUNICODE #define scfprintf fwprintf #define scvprintf vfwprintf #else #define scfprintf fprintf #define scvprintf vfprintf #endif void print_func(VMHANDLE LV_UNUSED_ARG(v), const LVChar *s, ...) { va_list vl; va_start(vl, s); scvprintf(stdout, s, vl); va_end(vl); } void error_func(VMHANDLE LV_UNUSED_ARG(v), const LVChar *s, ...) { va_list vl; va_start(vl, s); scvprintf(stderr, s, vl); va_end(vl); } const char *get_file_out(char *filename) { strcat(filename, "c"); return filename; } int main(int argc, char *argv[]) { VMHANDLE v; LVInteger retval = 0; v = lv_open(1024); lv_setprintfunc(v, print_func, error_func); lv_pushroottable(v); lv_registererrorhandlers(v); if (LV_SUCCEEDED(lv_loadfile(v, argv[1], LVTrue))) { lv_writeclosuretofile(v, get_file_out(argv[1])); } lv_close(v); return retval; }
18.375
66
0.709427
bf9072754d35eabd68baf82d621241c5a176a579
1,462
h
C
GVRf/Framework/framework/src/main/jni/objects/components/bone.h
sidia-dev-team/GearVRf
d93d62d49e5fc5b55dc00a485db92ec8fe004db1
[ "Apache-2.0" ]
474
2015-03-27T17:14:43.000Z
2022-03-30T23:10:38.000Z
GVRf/Framework/framework/src/main/jni/objects/components/bone.h
sidia-dev-team/GearVRf
d93d62d49e5fc5b55dc00a485db92ec8fe004db1
[ "Apache-2.0" ]
1,677
2015-03-28T02:00:21.000Z
2019-10-21T13:28:44.000Z
GVRf/Framework/framework/src/main/jni/objects/components/bone.h
sidia-dev-team/GearVRf
d93d62d49e5fc5b55dc00a485db92ec8fe004db1
[ "Apache-2.0" ]
260
2015-03-27T23:55:12.000Z
2022-03-18T03:46:41.000Z
/*************************************************************************** * Bone for skeletal animation. ***************************************************************************/ #ifndef BONE_H_ #define BONE_H_ #include <string> #include <vector> #include "glm/glm.hpp" #include "glm/gtc/matrix_transform.hpp" #include "objects/components/component.h" #include "util/gvr_log.h" namespace gvr { class Bone: public Component { public: Bone(); virtual ~Bone(); void setName(const char *name); void setOffsetMatrix(glm::mat4 &mat) { offsetMatrix_ = mat; } glm::mat4 getOffsetMatrix() { return offsetMatrix_; } void setFinalTransformMatrixPtr(glm::mat4 *ptr) { finalTransformMatrixPtr_ = ptr; } void setFinalTransformMatrix(glm::mat4 &mat) { *finalTransformMatrixPtr_ = mat; } glm::mat4 &getFinalTransformMatrix() { if (finalTransformMatrixPtr_) { return *finalTransformMatrixPtr_; } return identityMatrix_; } static long long getComponentType() { return COMPONENT_TYPE_BONE; } private: Bone(const Bone& bone) = delete; Bone(Bone&& bone) = delete; Bone& operator=(const Bone& bone) = delete; Bone& operator=(Bone&& bone) = delete; private: static glm::mat4 identityMatrix_; std::string name_; glm::mat4 offsetMatrix_; glm::mat4 *finalTransformMatrixPtr_; }; } #endif
21.188406
77
0.579343
b5ddefb1c7c95fb6cae61a78f25cc74c8b1b3cbb
1,569
h
C
Raven.CppClient/SetIndexesLockOperation.h
mlawsonca/ravendb-cpp-client
c3a3d4960c8b810156547f62fa7aeb14a121bf74
[ "MIT" ]
3
2019-04-24T02:34:53.000Z
2019-08-01T08:22:26.000Z
Raven.CppClient/SetIndexesLockOperation.h
mlawsonca/ravendb-cpp-client
c3a3d4960c8b810156547f62fa7aeb14a121bf74
[ "MIT" ]
2
2019-03-21T09:00:02.000Z
2021-02-28T23:49:26.000Z
Raven.CppClient/SetIndexesLockOperation.h
mlawsonca/ravendb-cpp-client
c3a3d4960c8b810156547f62fa7aeb14a121bf74
[ "MIT" ]
3
2019-03-04T11:58:54.000Z
2021-03-01T00:25:49.000Z
#pragma once #include "IVoidMaintenanceOperation.h" #include "IndexLockMode.h" namespace ravendb::client::documents::operations::indexes { namespace set_indexes_lock_op { struct Parameters { std::vector<std::string> index_names{}; documents::indexes::IndexLockMode mode = documents::indexes::IndexLockMode::UNSET; }; void to_json(nlohmann::json& j, const Parameters& p); } class SetIndexesLockOperation : public IVoidMaintenanceOperation { private: const set_indexes_lock_op::Parameters _parameters; public: ~SetIndexesLockOperation() override = default; SetIndexesLockOperation(std::string index_name, documents::indexes::IndexLockMode mode); explicit SetIndexesLockOperation(set_indexes_lock_op::Parameters parameters); std::unique_ptr<http::VoidRavenCommandBase> get_command( std::shared_ptr<conventions::DocumentConventions> conventions) const override; private: class SetIndexLockCommand : public http::VoidRavenCommand { private: const std::string _parameters_json_str; public: ~SetIndexLockCommand() override = default; explicit SetIndexLockCommand(const set_indexes_lock_op::Parameters& parameters); void create_request(impl::CurlHandlesHolder::CurlReference& curl_ref, std::shared_ptr<const http::ServerNode> node, std::optional<std::string>& url_ref) override; }; static bool index_is_auto(const std::string& index_name); // Check for auto-indexes - we do not set lock for auto-indexes static void filter_auto_indexes(const set_indexes_lock_op::Parameters& parameters); }; }
28.527273
118
0.773741
84ab8b97e260777d2e7318f49608d13b5d489379
3,438
h
C
include/ardpolyfills/Print.h
platisd/group-09
a905c8c6409c0a3d73f53884e167571d8f482667
[ "Apache-2.0" ]
4
2020-06-02T16:01:10.000Z
2021-10-17T22:23:26.000Z
include/ardpolyfills/Print.h
platisd/group-09
a905c8c6409c0a3d73f53884e167571d8f482667
[ "Apache-2.0" ]
76
2020-04-03T09:15:45.000Z
2020-12-17T16:55:14.000Z
include/ardpolyfills/Print.h
platisd/group-09
a905c8c6409c0a3d73f53884e167571d8f482667
[ "Apache-2.0" ]
1
2020-06-02T15:52:31.000Z
2020-06-02T15:52:31.000Z
/* * Print.h * Copyright 2020 ItJustWorksTM * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef Print_h #define Print_h #include <cstddef> #include <cstdint> #include <cstring> #include <iterator> #include "SMCE__dll.hxx" #include "WString.h" class SMCE__DLL_RT_API Print { int write_error = 0; protected: constexpr void setWriteError(int err = 1) noexcept { write_error = err; } public: Print() noexcept = default; [[nodiscard]] constexpr int getWriteError() noexcept { return write_error; } constexpr void clearWriteError() noexcept { setWriteError(0); } virtual std::size_t write(std::uint8_t) = 0; inline virtual std::size_t write(const uint8_t* buffer, std::size_t size) { const auto beg = buffer; while (size-- && write(*buffer++)) ; return std::distance(beg, buffer); } inline std::size_t write(const char* str) { if (!str) return 0; return write(str, std::strlen(str)); } inline std::size_t write(const char* buffer, size_t size) { return write(reinterpret_cast<const std::uint8_t*>(buffer), size); } // default to zero, meaning "a single write may block" // should be overriden by subclasses with buffering inline virtual int availableForWrite() { return 0; } // template <std::size_t N> // std::size_t print(const char (&lit)[N]) { return write(lit, N); } inline std::size_t print(const String& s) { return write(s.c_str(), s.length()); } inline std::size_t print(const char* czstr) { return write(czstr); } inline std::size_t print(char c) { return write(c); } template <class Int, class = std::enable_if_t<std::is_integral<Int>::value>> inline std::size_t print(Int val, StringBaseConv base = DEC) { return print(String(val, base)); } // inline std::size_t print(double val, int prec = 2) { return print(String(val, prec)); } // std::size_t print(const struct Printable&); // FIXME: implement base Printable template <std::size_t N> std::size_t println(const char (&lit)[N]) { return write(lit, N) + println(); } inline std::size_t println(const String& s) { return print(s) + println(); } inline std::size_t println(const char* czstr) { return write(czstr) + println(); } inline std::size_t println(char c) { return write(c) + println(); } template <class Int, class = std::enable_if_t<std::is_integral<Int>::value>> std::size_t println(Int val, StringBaseConv base = DEC) { return print(val, base) + println(); } // inline std::size_t println(double val, int prec = 2) { return print(val, prec) + println(); } // inline std::size_t println(const Printable& p) { return print(p) + println(); } inline std::size_t println() { return print('\r') + print('\n'); } inline virtual void flush() {} // Empty implementation for backward compatibility }; #endif // Print_h
40.928571
143
0.666085
57b212cdd0c8130e2ea7ebf127dbc931de72b85d
520
h
C
WXWeibo/AppDelegate.h
jiandanshiyong/ZK_weibo
20e83c81a0de341006c37d9060148bfabf0e9e69
[ "MIT" ]
null
null
null
WXWeibo/AppDelegate.h
jiandanshiyong/ZK_weibo
20e83c81a0de341006c37d9060148bfabf0e9e69
[ "MIT" ]
null
null
null
WXWeibo/AppDelegate.h
jiandanshiyong/ZK_weibo
20e83c81a0de341006c37d9060148bfabf0e9e69
[ "MIT" ]
null
null
null
// // AppDelegate.h // WXWeibo // // Created by 张凯 on 14/2/13. // Copyright © 2014年 www.zhangkai2014bj.com. All rights reserved. // #import <UIKit/UIKit.h> #import "DDMenuController.h" #import "MainViewController.h" @class SinaWeibo; @interface AppDelegate : UIResponder <UIApplicationDelegate> @property (strong, nonatomic) UIWindow *window; @property(nonatomic,retain)SinaWeibo *sinaweibo; @property(nonatomic,retain)MainViewController *mainCtrl; @property(nonatomic, retain)DDMenuController *menuCtrl; @end
21.666667
66
0.761538
b9141876e573cd4923abc47e41e7391f629c2084
2,718
h
C
cow/src/components/file_sink.h
halleyzhao/alios-mm
bef2a6de0c207a5ae9bf4f63de2e562df864aa3e
[ "Apache-2.0" ]
null
null
null
cow/src/components/file_sink.h
halleyzhao/alios-mm
bef2a6de0c207a5ae9bf4f63de2e562df864aa3e
[ "Apache-2.0" ]
null
null
null
cow/src/components/file_sink.h
halleyzhao/alios-mm
bef2a6de0c207a5ae9bf4f63de2e562df864aa3e
[ "Apache-2.0" ]
null
null
null
/** * Copyright (C) 2017 Alibaba Group Holding Limited. All Rights Reserved. * * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef file_sink_h #define file_sink_h #include <string> #include <multimedia/mm_cpp_utils.h> #include <multimedia/component.h> namespace YUNOS_MM { //#define DUMP_FILE_SINK_DATA //#define WRITE_AMR_FILE_HEADER class MediaBuffer; class MediaMeta; class FileSink : public SinkComponent { public: FileSink(const char *mimeType = NULL, bool isEncoder = false); virtual const char * name() const; COMPONENT_VERSION; virtual WriterSP getWriter(MediaType mediaType); virtual mm_status_t addSource(Component * component, MediaType mediaType) {return MM_ERROR_IVALID_OPERATION;} virtual mm_status_t prepare(); virtual mm_status_t start(); virtual mm_status_t stop(); virtual mm_status_t seek(int msec, int seekSequence) { return MM_ERROR_SUCCESS;} virtual mm_status_t reset(); virtual mm_status_t flush(); virtual mm_status_t setParameter(const MediaMetaSP & meta); virtual int64_t getCurrentPosition(); protected: virtual ~FileSink(); private: static std::string getMediaFileName(const char*url, const char*prefix, const char*extension); mm_status_t writeSingleFile(uint8_t *buffer,int32_t bufferSize); class FileSinkWriter : public Writer { public: FileSinkWriter(FileSink *sink) : mSink(sink) { } virtual ~FileSinkWriter(){} virtual mm_status_t write(const MediaBufferSP &buffer); virtual mm_status_t setMetaData(const MediaMetaSP & metaData); private: FileSink *mSink; DECLARE_LOGTAG() }; enum WriteModeType { WMT_Record = 0, WMT_Image }; WriterSP mWriter; Lock mLock; int mFd; std::string mUrl; std::string mFilePath; WriteModeType mWriteMode; int mFileIdx; uint32_t mFrameCount; const char*mPrefix; const char*mExtension; int64_t mCurrentPosition; MediaMetaSP mMediaMeta; private: MM_DISALLOW_COPY(FileSink); DECLARE_LOGTAG() }; typedef MMSharedPtr<FileSink> FileSinkSP; } // end of namespace YUNOS_MM #endif//file_sink_h
25.641509
114
0.714496
571241e2e2a08f011228d20b8ef58bcf928bf5c3
4,513
c
C
src/dbus.c
mswiger/seogi
e5c268ae8265b09a1817b3f28276dad9f38ab190
[ "MIT" ]
null
null
null
src/dbus.c
mswiger/seogi
e5c268ae8265b09a1817b3f28276dad9f38ab190
[ "MIT" ]
2
2022-01-06T11:00:24.000Z
2022-03-21T06:06:17.000Z
src/dbus.c
mswiger/seogi
e5c268ae8265b09a1817b3f28276dad9f38ab190
[ "MIT" ]
null
null
null
#include <errno.h> #include <stdlib.h> #include <stdio.h> #include <systemd/sd-bus.h> #include "dbus.h" static const char *seogi_service = "dev.swiger.Seogi"; static const char *seogi_seat_manager_path = "/dev/swiger/Seogi/SeatManager"; static const char *seogi_seat_interface = "dev.swiger.Seogi.Seat"; static int find_seat_by_path(const char *path, struct seogi_state *state, struct seogi_seat **found_seat) { char *seat_name = NULL; int ret = 0; if ((ret = sd_bus_path_decode(path, seogi_seat_manager_path, &seat_name)) < 1) { return ret; } struct seogi_seat *seat; bool found = false; wl_list_for_each(seat, &state->seats, link) { if (strcmp(seat_name, seat->name) == 0) { found = true; *found_seat = seat; break; } } free(seat_name); if (!found) { return EINVAL; } return 1; } static int toggle_seat(sd_bus_message *msg, void *userdata, sd_bus_error *ret_error) { struct seogi_state *state = userdata; struct seogi_seat *seat; const char *path = sd_bus_message_get_path(msg); int ret = 0; if ((ret = find_seat_by_path(path, state, &seat)) < 1) { return ret; } seogi_toggle_seat(seat); return sd_bus_reply_method_return(msg, ""); } static int enable_seat(sd_bus_message *msg, void *userdata, sd_bus_error *ret_error) { struct seogi_state *state = userdata; struct seogi_seat *seat; const char *path = sd_bus_message_get_path(msg); int ret = 0; if ((ret = find_seat_by_path(path, state, &seat)) < 1) { return ret; } seogi_enable_seat(seat); return sd_bus_reply_method_return(msg, ""); } static int disable_seat(sd_bus_message *msg, void *userdata, sd_bus_error *ret_error) { struct seogi_state *state = userdata; struct seogi_seat *seat; const char *path = sd_bus_message_get_path(msg); int ret = 0; if ((ret = find_seat_by_path(path, state, &seat)) < 1) { return ret; } seogi_disable_seat(seat); return sd_bus_reply_method_return(msg, ""); } static int get_status_property( sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *ret_error ) { struct seogi_state *state = userdata; struct seogi_seat *seat; int ret = 0; if ((ret = find_seat_by_path(path, state, &seat)) < 1) { return ret; } sd_bus_message_append(reply, "b", seat->enabled); return 1; } static const sd_bus_vtable seogi_seat_vtable[] = { SD_BUS_VTABLE_START(0), SD_BUS_METHOD("Disable", "", "", disable_seat, 0), SD_BUS_METHOD("Enable", "", "", enable_seat, 0), SD_BUS_METHOD("Toggle", "", "", toggle_seat, 0), SD_BUS_PROPERTY("Status", "b", get_status_property, 0, SD_BUS_VTABLE_PROPERTY_EMITS_CHANGE), SD_BUS_VTABLE_END, }; bool seogi_init_dbus(struct seogi_state *state) { int ret; if ((ret = sd_bus_open_user(&state->bus)) < 0) { fprintf(stderr, "sd_bus_open failed: %d\n", ret); return false; } if ((ret = sd_bus_request_name(state->bus, seogi_service, 0)) < 0) { fprintf(stderr, "sd_bus_request_name failed: %d\n", ret); return false; } if ((ret = sd_bus_add_object_manager(state->bus, NULL, seogi_seat_manager_path)) < 0) { fprintf(stderr, "sd_bus_add_object_manager failed: %d\n", ret); return false; } state->display = wl_display_connect(NULL); if (state->display == NULL) { fprintf(stderr, "failed to connect to Wayland display\n"); return false; } return true; } void seogi_shutdown_dbus(struct seogi_state *state) { sd_bus_unref(state->bus); } bool seogi_create_dbus_seat(struct seogi_seat *seat) { int ret; char *seat_path = NULL; ret = sd_bus_path_encode(seogi_seat_manager_path, seat->name, &seat_path); if (ret < 0) { fprintf(stderr, "sd_bus_path_encode failed: %d\n", ret); return false; } struct seogi_state *state = seat->state; ret = sd_bus_add_object_vtable(state->bus, NULL, seat_path, seogi_seat_interface, seogi_seat_vtable, state); free(seat_path); if (ret < 0) { fprintf(stderr, "sd_bus_add_object_vtable failed: %d\n", ret); } return true; } bool seogi_emit_seat_status_changed(struct seogi_seat *seat) { int ret; char *seat_path = NULL; if ((ret = sd_bus_path_encode(seogi_seat_manager_path, seat->name, &seat_path)) < 0) { fprintf(stderr, "sd_bus_path_encode failed: %d\n", ret); return false; } sd_bus_emit_properties_changed(seat->state->bus, seat_path, seogi_seat_interface, "Status", NULL); free(seat_path); return true; }
25.642045
110
0.692666
cb564a3eb9eb0f9123b3b66413415b79064ac01f
3,561
h
C
usr/libexec/fud/AUServiceShim.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
2
2021-11-02T09:23:27.000Z
2022-03-28T08:21:57.000Z
usr/libexec/fud/AUServiceShim.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
null
null
null
usr/libexec/fud/AUServiceShim.h
lechium/iOS1351Headers
6bed3dada5ffc20366b27f7f2300a24a48a6284e
[ "MIT" ]
1
2022-03-28T08:21:59.000Z
2022-03-28T08:21:59.000Z
// // Generated by classdumpios 1.0.1 (64 bit) (iOS port by DreamDevLost)(Debug version compiled Sep 26 2020 13:48:20). // // Copyright (C) 1997-2019 Steve Nygard. // #import <objc/NSObject.h> #import "AUDaemonProtocol-Protocol.h" #import "FudPersonalizationPlugin-Protocol.h" #import "FudPlugin-Protocol.h" #import "FudQueryPlugin-Protocol.h" @class NSString, NSXPCConnection; @protocol FudPluginDelegate; __attribute__((visibility("hidden"))) @interface AUServiceShim : NSObject <FudPlugin, FudQueryPlugin, FudPersonalizationPlugin, AUDaemonProtocol> { int _currentState; // 8 = 0x8 NSString *_deviceClass; // 16 = 0x10 id <FudPluginDelegate> _delegate; // 24 = 0x18 NSString *_xpcServiceName; // 32 = 0x20 NSXPCConnection *_xpcServiceConn; // 40 = 0x28 } @property(nonatomic) NSXPCConnection *xpcServiceConn; // @synthesize xpcServiceConn=_xpcServiceConn; @property(nonatomic) NSString *xpcServiceName; // @synthesize xpcServiceName=_xpcServiceName; @property(nonatomic) id <FudPluginDelegate> delegate; // @synthesize delegate=_delegate; @property(nonatomic) NSString *deviceClass; // @synthesize deviceClass=_deviceClass; @property(nonatomic) int currentState; // @synthesize currentState=_currentState; - (id)initWithCoder:(id)arg1; // IMP=0x0000000100003cbc - (void)encodeWithCoder:(id)arg1; // IMP=0x0000000100003cb8 - (void)accessoryDisconnected:(id)arg1; // IMP=0x0000000100003cb4 - (void)logv:(int)arg1 format:(id)arg2 arguments:(struct __va_list_tag *)arg3; // IMP=0x0000000100003cb0 - (void)log:(int)arg1 format:(id)arg2; // IMP=0x0000000100003cac - (void)reportAnalytics:(id)arg1 info:(id)arg2; // IMP=0x0000000100003c9c - (void)progress:(double)arg1; // IMP=0x0000000100003c8c - (void)personalizationRequest:(id)arg1; // IMP=0x0000000100003c7c - (void)personalizationResponse:(id)arg1 response:(id)arg2 status:(id)arg3; // IMP=0x0000000100003b88 - (void)didFinish:(_Bool)arg1 info:(id)arg2 error:(id)arg3; // IMP=0x0000000100003b18 - (void)didApply:(_Bool)arg1 info:(id)arg2 error:(id)arg3; // IMP=0x0000000100003aa0 - (void)didPrepare:(_Bool)arg1 info:(id)arg2 error:(id)arg3; // IMP=0x0000000100003a28 - (void)didDownload:(_Bool)arg1 info:(id)arg2 error:(id)arg3; // IMP=0x00000001000039b0 - (void)didFind:(_Bool)arg1 info:(id)arg2 updateAvailable:(_Bool)arg3 needsDownload:(_Bool)arg4 error:(id)arg5; // IMP=0x0000000100003900 - (void)didBootstrap:(_Bool)arg1 info:(id)arg2 error:(id)arg3; // IMP=0x000000010000386c - (void)progress:(double)arg1 info:(id)arg2; // IMP=0x0000000100003854 - (void)dealloc; // IMP=0x0000000100003808 - (void)closeXPCConnection; // IMP=0x00000001000037cc - (void)queryDeviceList:(id *)arg1; // IMP=0x00000001000035f0 - (void)finishWithOptions:(id)arg1; // IMP=0x0000000100003428 - (void)applyFirmwareWithOptions:(id)arg1; // IMP=0x0000000100003260 - (void)prepareFirmwareWithOptions:(id)arg1; // IMP=0x000000010000308c - (void)downloadFirmwareWithOptions:(id)arg1; // IMP=0x0000000100002eb8 - (void)findFirmwareWithOptions:(id)arg1 remote:(_Bool)arg2; // IMP=0x0000000100002ccc - (void)bootstrapWithOptions:(id)arg1; // IMP=0x0000000100002a5c - (void)connectToServer; // IMP=0x00000001000026c8 - (void)handleServiceDisconnect; // IMP=0x00000001000025d8 - (id)initWithDeviceClass:(id)arg1 delegate:(id)arg2 info:(id *)arg3 options:(id)arg4; // IMP=0x00000001000020f8 // Remaining properties @property(readonly, copy) NSString *debugDescription; @property(readonly, copy) NSString *description; @property(readonly) unsigned long long hash; @property(readonly) Class superclass; @end
51.608696
137
0.768604
bedfd3c1f569dc9b86d56b7bd9752015d55ed272
50,919
c
C
GEMTools/src/gt_template_utils.c
MarcosFernandez/gemtools
b17c4b973e57bbceafe72b6f81b2d4395eaa3b4a
[ "CNRI-Python" ]
14
2015-01-06T20:25:01.000Z
2021-06-17T20:35:34.000Z
GEMTools/src/gt_template_utils.c
MarcosFernandez/gemtools
b17c4b973e57bbceafe72b6f81b2d4395eaa3b4a
[ "CNRI-Python" ]
20
2015-01-23T15:02:35.000Z
2020-05-17T03:25:35.000Z
GEMTools/src/gt_template_utils.c
MarcosFernandez/gemtools
b17c4b973e57bbceafe72b6f81b2d4395eaa3b4a
[ "CNRI-Python" ]
7
2015-11-09T18:30:14.000Z
2020-04-08T13:53:30.000Z
/* * PROJECT: GEM-Tools library * FILE: gt_template_utils.h * DATE: 19/07/2012 * AUTHOR(S): Santiago Marco-Sola <santiagomsola@gmail.com> * DESCRIPTION: // TODO */ #include "gt_template_utils.h" /* * Template Pair Info Setup * PE read => template.GT_ATTR_ID_TAG_PAIR = 0, template.end1.GT_ATTR_ID_TAG_PAIR = 1, template.end2.GT_ATTR_ID_TAG_PAIR = 2 * SE read => template.GT_ATTR_ID_TAG_PAIR = X, template.end1.GT_ATTR_ID_TAG_PAIR = X * alignment.GT_ATTR_ID_TAG_PAIR = X * All of them have the same CASAVA and EXTRA_TAG info */ GT_INLINE void gt_template_setup_pair_attributes_to_alignments(gt_template* const template,const bool copy_tags) { GT_TEMPLATE_CHECK(template); const uint64_t num_blocks = gt_template_get_num_blocks(template); int64_t i, p; // Setup all alignments' tags + attr for (i=0;i<num_blocks;i++) { gt_alignment* const alignment = gt_template_get_block(template,i); // Copy all attributes gt_attributes_copy(alignment->attributes,template->attributes); if (copy_tags) gt_string_copy(alignment->tag,template->tag); p = (num_blocks>1) ? i+1 : *((int64_t*)gt_attributes_get(template->attributes,GT_ATTR_ID_TAG_PAIR)); gt_attributes_add(alignment->attributes,GT_ATTR_ID_TAG_PAIR,&p,int64_t); } // Clear template's pair info if (num_blocks > 1) { p = 0; gt_attributes_add(template->attributes,GT_ATTR_ID_TAG_PAIR,&p,int64_t); } } GT_INLINE uint64_t gt_template_get_read_proportion(gt_template* const template,const float proportion) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_get_read_proportion(alignment,proportion); } GT_TEMPLATE_END_REDUCTION; const uint64_t read_length_end1 = gt_string_get_length(gt_template_get_end1(template)->read); const uint64_t read_length_end2 = gt_string_get_length(gt_template_get_end2(template)->read); return gt_get_integer_proportion(proportion,read_length_end1+read_length_end2); } /* * Template's MMaps operators (Update global state: counters, ...) */ GT_INLINE void gt_template_alias_dup_mmap_members( int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*),gt_template* const template, gt_map** const mmap,gt_map** const uniq_mmaps) { GT_NULL_CHECK(gt_map_cmp_fx); GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(uniq_mmaps); // Resolve mmap const uint64_t num_blocks = gt_template_get_num_blocks(template); uint64_t i; for (i=0;i<num_blocks;++i) { GT_NULL_CHECK(mmap[i]); uniq_mmaps[i] = gt_alignment_put_map(gt_map_cmp_fx,gt_template_get_block(template,i),mmap[i],false); } } GT_INLINE gt_map** gt_template_raw_put_mmap( int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*),gt_template* const template, gt_map** const mmap,gt_mmap_attributes* const mmap_attributes) { GT_NULL_CHECK(gt_map_cmp_fx); GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(mmap_attributes); // Resolve mmap aliasing/insertion gt_map** uniq_mmaps = gt_calloc(gt_template_get_num_blocks(template),gt_map*,false); gt_template_alias_dup_mmap_members(gt_map_cmp_fx,template,mmap,uniq_mmaps); // Raw mmap insertion gt_template_add_mmap_array(template,uniq_mmaps,mmap_attributes); gt_map** const template_mmap = gt_template_get_mmap_array(template,gt_template_get_num_mmaps(template)-1,NULL); gt_free(uniq_mmaps); // Free auxiliary vector return template_mmap; } #include "gt_output_map.h" GT_INLINE gt_map** gt_template_put_mmap( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t),int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*), gt_template* const template,gt_map** const mmap,gt_mmap_attributes* const mmap_attr,const bool replace_duplicated) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_NULL_CHECK(gt_map_cmp_fx); GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(mmap_attr); // Check mmap duplicates gt_map** found_mmap; gt_mmap_attributes* found_mmap_attributes=0; uint64_t found_mmap_pos=0; bool is_duplicated = gt_expect_false(gt_template_find_mmap_fx(gt_mmap_cmp_fx, template,mmap,&found_mmap_pos,&found_mmap,&found_mmap_attributes)); gt_map** template_mmap; if (!is_duplicated || replace_duplicated) { // TODO: Chose which to replace (like alignment) // Resolve mmap aliasing/insertion gt_map** uniq_mmaps = gt_calloc(gt_template_get_num_blocks(template),gt_map*,false); gt_template_alias_dup_mmap_members(gt_map_cmp_fx,template,mmap,uniq_mmaps); // Insert mmap if (!is_duplicated) { // Add new mmap gt_template_inc_counter(template,mmap_attr->distance); gt_template_add_mmap_array(template,uniq_mmaps,mmap_attr); template_mmap=gt_template_get_mmap_array(template,gt_template_get_num_mmaps(template)-1,NULL); } else { // Replace mmap gt_template_dec_counter(template,found_mmap_attributes->distance); // Remove old mmap gt_template_set_mmap_array(template,found_mmap_pos,uniq_mmaps,mmap_attr); // Replace old mmap gt_template_inc_counter(template,mmap_attr->distance); template_mmap=gt_template_get_mmap_array(template,found_mmap_pos,NULL); } gt_free(uniq_mmaps); // Free auxiliary vector } else { // Delete mmap GT_MMAP_ITERATE_ENDS(mmap,gt_template_get_num_blocks(template),map,end_pos) { gt_map_delete(map); } template_mmap=gt_template_get_mmap_array(template,found_mmap_pos,NULL); } return template_mmap; } GT_INLINE void gt_template_insert_mmap( gt_template* const template,gt_map** const mmap,gt_mmap_attributes* const mmap_attributes, bool check_duplicates) { GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(mmap_attributes); if(check_duplicates){ gt_template_insert_mmap_fx(gt_mmap_cmp,template,mmap,mmap_attributes); }else{ const uint64_t num_blocks = gt_template_get_num_blocks(template); uint64_t i; for (i=0;i<num_blocks;++i) { GT_NULL_CHECK(mmap[i]); gt_alignment* alignment = gt_template_get_block(template,i); gt_alignment_inc_counter(alignment,gt_map_get_global_distance(mmap[i])); gt_alignment_add_map(alignment,mmap[i]); } gt_template_inc_counter(template,mmap_attributes->distance); gt_template_add_mmap_array(template,mmap,mmap_attributes); } } GT_INLINE void gt_template_insert_mmap_fx( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t), gt_template* const template,gt_map** const mmap,gt_mmap_attributes* const mmap_attributes) { GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(mmap_attributes); gt_template_put_mmap(gt_mmap_cmp_fx,gt_map_cmp,template,mmap,mmap_attributes,true); // TODO: Why replace, why? } GT_INLINE void gt_template_insert_mmap_gtvector( gt_template* const template,gt_vector* const mmap,gt_mmap_attributes* const mmap_attributes) { GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(mmap_attributes); gt_template_insert_mmap_gtvector_fx(gt_mmap_cmp,template,mmap,mmap_attributes); } GT_INLINE void gt_template_insert_mmap_gtvector_fx( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t), gt_template* const template,gt_vector* const mmap,gt_mmap_attributes* const mmap_attributes) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(mmap_attributes); gt_check(gt_vector_get_used(mmap)!=gt_template_get_num_blocks(template),TEMPLATE_ADD_BAD_NUM_BLOCKS); gt_template_insert_mmap_fx(gt_mmap_cmp_fx,template,gt_vector_get_mem(mmap,gt_map*),mmap_attributes); } GT_INLINE bool gt_template_find_mmap_fx( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t), gt_template* const template,gt_map** const mmap, uint64_t* const found_mmap_pos,gt_map*** const found_mmap,gt_mmap_attributes** const found_mmap_attributes) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); GT_NULL_CHECK(found_mmap_pos); GT_NULL_CHECK(found_mmap); // Search for the mmap const uint64_t num_blocks = gt_template_get_num_blocks(template); uint64_t pos = 0; if(template->alg_dictionary == NULL || template->alg_dictionary->refs_dictionary == NULL){ GT_TEMPLATE_ITERATE_MMAP__ATTR_(template,template_mmap,mmap_attribute) { if (gt_mmap_cmp_fx(template_mmap,mmap,num_blocks)==0) { *found_mmap_pos = pos; *found_mmap = template_mmap; if (found_mmap_attributes) *found_mmap_attributes = mmap_attribute; return true; } ++pos; } }else{ // indexed search only through other templates // with the first map on the same chromosome char* seq_name = gt_map_get_seq_name(mmap[0]); if(!gt_shash_is_contained(template->alg_dictionary->refs_dictionary, seq_name)){ return false; } gt_vector* dict_elements = gt_shash_get(template->alg_dictionary->refs_dictionary, seq_name, gt_vector); GT_VECTOR_ITERATE(dict_elements, e, c, gt_template_dictionary_map_element*){ gt_map** template_mmap = (*e)->mmap; if (gt_mmap_cmp_fx(template_mmap,mmap,num_blocks)==0) { *found_mmap_pos = pos; *found_mmap = template_mmap; if (found_mmap_attributes) *found_mmap_attributes = (*e)->mmap_attrs; return true; } ++pos; } } return false; } GT_INLINE bool gt_template_is_mmap_contained(gt_template* const template,gt_map** const mmap) { GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); gt_map** found_mmap; uint64_t found_mmap_pos; return gt_template_find_mmap_fx(gt_mmap_cmp,template,mmap, &found_mmap_pos,&found_mmap,NULL); } GT_INLINE bool gt_template_is_mmap_contained_fx( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t), gt_template* const template,gt_map** const mmap) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_TEMPLATE_CHECK(template); GT_NULL_CHECK(mmap); gt_map** found_mmap; uint64_t found_mmap_pos; return gt_template_find_mmap_fx(gt_mmap_cmp_fx,template,mmap, &found_mmap_pos,&found_mmap,NULL); } GT_INLINE void gt_template_reduce_mmaps(gt_template* const template,const uint64_t max_num_matches) { GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { gt_alignment_reduce_maps(alignment,max_num_matches); } GT_TEMPLATE_END_REDUCTION__RETURN; const uint64_t num_matches = gt_template_get_num_mmaps(template); if (max_num_matches < num_matches) { gt_vector_set_used(template->mmaps,max_num_matches); gt_template_recalculate_counters(template); } } /* * Insert size should be and estimate of the original fragment size that was sequenced. We can get this from the following: * * position of rightmost read + no. bases in rightmost read - position of leftmost read * * If the read has been trimmed from the start of the read then we can't get the original size, but this is a relatively * rare event. Trimming from the end of the read does not effect the calculation as the rightmost read will be on the * negative strand so trimming x bases from the end of the read will shift the mapped position of the read by x. * * Split mappings require special handling in that we need to consider the number of bases read + the distance between the * last block in each mapping as follows: * * Position of last block of rightmost read + no. bases in rightmost read - (position of last block of leftmost read + no. bases) * in all other blocks of leftmost read * * if start_x is non-zero then *start_x will be set to the start position of the left block before the insert * */ GT_INLINE int64_t gt_template_get_insert_size(gt_map** const mmap,gt_status* gt_error,uint64_t* start_x,gt_string** ctg) { // Get last block of each map gt_map *block[2]={0,0}; uint64_t length[2]={0,0}; int64_t x=0; *gt_error=GT_TEMPLATE_INSERT_SIZE_OK; GT_MAP_ITERATE(mmap[0],map_it) { block[0]=map_it; length[0]+=gt_map_get_base_length(block[0]); } GT_MAP_ITERATE(mmap[1],map_it2) { block[1]=map_it2; length[1]+=gt_map_get_base_length(block[1]); } if(gt_string_equals(block[0]->seq_name,block[1]->seq_name)) { if(block[0]->strand!=block[1]->strand) { if(block[0]->strand==FORWARD) { x=1+block[1]->position+length[1]-(block[0]->position+length[0]-gt_map_get_base_length(block[0])); if(start_x) *start_x=block[0]->position; } else { x=1+block[0]->position+length[0]-(block[1]->position+length[1]-gt_map_get_base_length(block[1])); if(start_x) *start_x=block[1]->position; } if(ctg) *ctg=block[0]->seq_name; } else { *gt_error=GT_TEMPLATE_INSERT_SIZE_SAME_STRAND; } } else { *gt_error=GT_TEMPLATE_INSERT_SIZE_DIFFERENT_CONTIGS; } return x; } /* * Template's Counters operators */ GT_INLINE bool gt_template_is_mapped(gt_template* const template) { GT_TEMPLATE_CHECK(template); const bool unique_flag = gt_template_get_not_unique_flag(template); return unique_flag || gt_template_is_thresholded_mapped(template,UINT64_MAX); } GT_INLINE bool gt_template_is_thresholded_mapped(gt_template* const template,const uint64_t max_allowed_strata) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_is_thresholded_mapped(alignment,max_allowed_strata); } GT_TEMPLATE_END_REDUCTION; if (gt_template_get_not_unique_flag(template)) return true; if(gt_template_get_num_counters(template) == 0) return false; gt_vector* vector = gt_template_get_counters_vector(template); GT_VECTOR_ITERATE(vector,counter,counter_pos,uint64_t) { if (counter_pos>max_allowed_strata) return false; else if (*counter!=0) return true; } return false; } GT_INLINE void gt_template_recalculate_counters(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { gt_alignment_recalculate_counters(alignment); } GT_TEMPLATE_END_REDUCTION__RETURN; // Clear previous counters gt_vector_clear(gt_template_get_counters_vector(template)); // Recalculate counters const uint64_t num_blocks = gt_template_get_num_blocks(template); GT_TEMPLATE_ITERATE_MMAP__ATTR_(template,mmap,mmap_attr) { uint64_t i, total_distance = 0; for (i=0;i<num_blocks;++i) { total_distance+=gt_map_get_global_distance(mmap[i]); } mmap_attr->distance=total_distance; gt_template_inc_counter(template,total_distance); } } GT_INLINE void gt_template_recalculate_counters_no_splits(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { gt_alignment_recalculate_counters_no_splits(alignment); } GT_TEMPLATE_END_REDUCTION__RETURN; // Clear previous counters gt_vector_clear(gt_template_get_counters_vector(template)); // Recalculate counters const uint64_t num_blocks = gt_template_get_num_blocks(template); GT_TEMPLATE_ITERATE_MMAP__ATTR_(template,mmap,mmap_attr) { uint64_t i, total_distance = 0; for (i=0;i<num_blocks;++i) { total_distance+=gt_map_get_no_split_distance(mmap[i]); } mmap_attr->distance=total_distance; gt_template_inc_counter(template,total_distance); } } GT_INLINE int64_t gt_template_get_min_matching_strata(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_get_min_matching_strata(alignment); } GT_TEMPLATE_END_REDUCTION; return gt_counters_get_min_matching_strata(gt_template_get_counters_vector(template)); } GT_INLINE int64_t gt_template_get_uniq_degree(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_get_uniq_degree(alignment); } GT_TEMPLATE_END_REDUCTION; return gt_counters_get_uniq_degree(gt_template_get_counters_vector(template)); } GT_INLINE bool gt_template_get_next_matching_strata( gt_template* const template,const uint64_t begin_strata, uint64_t* const next_matching_strata,uint64_t* const num_maps) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_get_next_matching_strata(alignment,begin_strata,next_matching_strata,num_maps); } GT_TEMPLATE_END_REDUCTION; return gt_counters_get_next_matching_strata(gt_template_get_counters_vector(template), begin_strata,next_matching_strata,num_maps); } /* * Sort maps by score _> (int (*)(const void *,const void *)) * i.e. (Sorting from smaller to bigger, <) := a-b * cmp(a,b) := -n if (a<b) * n if (a>b) * 0 if (a==b) */ typedef struct { gt_mmap_attributes attributes; uint64_t init_position; gt_map* end_1; gt_map* end_2; } gt_mmap_placeholder; int gt_mmap_cmp_distance__score(gt_mmap* const mmap_a,gt_mmap* const mmap_b) { // Sort by distance const int64_t distance_a = mmap_a->attributes.distance; const int64_t distance_b = mmap_b->attributes.distance; if (distance_a != distance_b) return distance_a-distance_b; // Sort by score (here we cannot do the trick as gt_score fills the whole uint64_t range) const uint64_t score_a = mmap_a->attributes.gt_score; const uint64_t score_b = mmap_b->attributes.gt_score; return (score_a > score_b) ? -1 : (score_a < score_b ? 1 : 0); } /* * Template's Maps Sorting */ GT_INLINE void gt_template_sort_by_distance__score(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_sort_by_distance__score(alignment); } GT_TEMPLATE_END_REDUCTION; // Sort const uint64_t num_mmap = gt_template_get_num_mmaps(template); qsort(gt_vector_get_mem(template->mmaps,gt_mmap),num_mmap,sizeof(gt_mmap), (int (*)(const void *,const void *))gt_mmap_cmp_distance__score); } GT_INLINE void gt_template_sort_by_distance__score_no_split(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_sort_by_distance__score_no_split(alignment); } GT_TEMPLATE_END_REDUCTION; // Sort const uint64_t num_mmap = gt_template_get_num_mmaps(template); qsort(gt_vector_get_mem(template->mmaps,gt_mmap),num_mmap,sizeof(gt_mmap), (int (*)(const void *,const void *))gt_mmap_cmp_distance__score); } /* * Template's MMaps Utils */ GT_INLINE uint64_t gt_template_sum_mismatch_qualities(gt_template* const template,gt_map** const mmap) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_sum_mismatch_qualities(alignment,mmap[0]); } GT_TEMPLATE_END_REDUCTION; return gt_alignment_sum_mismatch_qualities(gt_template_get_block(template,0),mmap[0]) + gt_alignment_sum_mismatch_qualities(gt_template_get_block(template,1),mmap[1]); } GT_INLINE uint64_t gt_template_get_max_mismatch_quality(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { return gt_alignment_get_max_mismatch_quality(alignment); } GT_TEMPLATE_END_REDUCTION; uint64_t max_qual = 0; GT_TEMPLATE_ITERATE_MMAP_(template,mmap) { const uint64_t q = gt_template_sum_mismatch_qualities(template,mmap); if (q > max_qual) max_qual = q; } return max_qual; } /* * Template Set operators */ GT_INLINE void gt_template_merge_template_mmaps(gt_template* const template_dst,gt_template* const template_src) { GT_TEMPLATE_CHECK(template_dst); GT_TEMPLATE_CHECK(template_src); GT_TEMPLATE_COMMON_CONSISTENCY_ERROR(template_dst,template_src); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_src,alignment_src) { GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_dst,alignment_dst) { gt_alignment_merge_alignment_maps(alignment_dst,alignment_src); } GT_TEMPLATE_END_REDUCTION; } GT_TEMPLATE_END_REDUCTION__RETURN; // Merge mmaps gt_template_merge_template_mmaps_fx(gt_mmap_cmp,gt_map_cmp,template_dst,template_src); } GT_INLINE void gt_template_merge_template_mmaps_fx( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t),int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*), gt_template* const template_dst,gt_template* const template_src) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_NULL_CHECK(gt_map_cmp_fx); GT_TEMPLATE_COMMON_CONSISTENCY_ERROR(template_dst,template_src); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_src,alignment_src) { GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_dst,alignment_dst) { gt_alignment_merge_alignment_maps_fx(gt_map_cmp_fx,alignment_dst,alignment_src); } GT_TEMPLATE_END_REDUCTION; } GT_TEMPLATE_END_REDUCTION__RETURN; // Merge mmaps bool use_hash = gt_template_get_num_mmaps(template_src) > 100 || gt_template_get_num_mmaps(template_dst) > 100; if(use_hash){ template_dst->alg_dictionary = gt_template_dictionary_new(template_dst); gt_template_dictionary_add_ref(template_dst->alg_dictionary, template_dst); } GT_TEMPLATE_CHECK(template_dst); GT_TEMPLATE_CHECK(template_src); GT_TEMPLATE_ITERATE_MMAP__ATTR(template_src,mmap,mmap_attr) { gt_map** mmap_copy = gt_mmap_array_copy(mmap,__mmap_num_blocks); gt_template_put_mmap(gt_mmap_cmp_fx,gt_map_cmp_fx,template_dst,mmap_copy,mmap_attr,true); gt_free(mmap_copy); // Free array handler } gt_template_set_mcs(template_dst,GT_MIN(gt_template_get_mcs(template_dst),gt_template_get_mcs(template_src))); if(use_hash){ gt_template_dictionary_delete(template_dst->alg_dictionary); template_dst->alg_dictionary = NULL; } } GT_INLINE gt_template* gt_template_union_template_mmaps_v( const uint64_t num_src_templates,gt_template* const template_src,va_list v_args) { GT_ZERO_CHECK(num_src_templates); // Create new template gt_template* const template_union = gt_template_dup(template_src,false,false); gt_template_merge_template_mmaps(template_union,template_src); // Merge template sources into template_union uint64_t num_tmp_merged = 1; while (num_tmp_merged < num_src_templates) { gt_template* template_target = va_arg(v_args,gt_template*); GT_TEMPLATE_COMMON_CONSISTENCY_ERROR(template_union,template_target); GT_TEMPLATE_CHECK(template_target); gt_template_merge_template_mmaps(template_union,template_target); ++num_tmp_merged; } return template_union; } GT_INLINE gt_template* gt_template_union_template_mmaps_va( const uint64_t num_src_templates,gt_template* const template_src,...) { GT_ZERO_CHECK(num_src_templates); GT_TEMPLATE_CHECK(template_src); va_list v_args; va_start(v_args,template_src); gt_template* const template_union = gt_template_union_template_mmaps_v(num_src_templates,template_src,v_args); va_end(v_args); return template_union; } GT_INLINE gt_template* gt_template_union_template_mmaps_a( gt_template** const templates,const uint64_t num_src_templates) { GT_ZERO_CHECK(num_src_templates); // Create new template gt_template* const template_union = gt_template_dup(templates[0],false,false); gt_template_merge_template_mmaps(template_union,templates[0]); // Merge template sources into template_union uint64_t i; for (i=1;i<num_src_templates;++i) { GT_TEMPLATE_COMMON_CONSISTENCY_ERROR(template_union,templates[i]); GT_TEMPLATE_CHECK(templates[i]); gt_template_merge_template_mmaps(template_union,templates[i]); } return template_union; } GT_INLINE gt_template* gt_template_union_template_mmaps_fx_v( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t),int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*), const uint64_t num_src_templates,gt_template* const template_src,va_list v_args) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_ZERO_CHECK(num_src_templates); // Create new template gt_template* const template_union = gt_template_dup(template_src,false,false); gt_template_merge_template_mmaps_fx(gt_mmap_cmp_fx,gt_map_cmp_fx,template_union,template_src); // Merge template sources into template_union uint64_t num_tmp_merged = 1; while (num_tmp_merged < num_src_templates) { gt_template* template_target = va_arg(v_args,gt_template*); GT_TEMPLATE_COMMON_CONSISTENCY_ERROR(template_union,template_target); GT_TEMPLATE_CHECK(template_target); gt_template_merge_template_mmaps_fx(gt_mmap_cmp_fx,gt_map_cmp_fx,template_union,template_target); ++num_tmp_merged; } return template_union; } GT_INLINE gt_template* gt_template_union_template_mmaps_fx_va( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t),int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*), const uint64_t num_src_templates,gt_template* const template_src,...) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_ZERO_CHECK(num_src_templates); GT_TEMPLATE_CHECK(template_src); va_list v_args; va_start(v_args,template_src); gt_template* const template_union = gt_template_union_template_mmaps_fx_v(gt_mmap_cmp_fx,gt_map_cmp_fx,num_src_templates,template_src,v_args); va_end(v_args); return template_union; } GT_INLINE gt_template* gt_template_subtract_template_mmaps_fx( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t),int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*), gt_template* const template_minuend,gt_template* const template_subtrahend) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_NULL_CHECK(gt_map_cmp_fx); GT_TEMPLATE_COMMON_CONSISTENCY_ERROR(template_minuend,template_subtrahend); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_minuend,alignment_minuend) { GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_subtrahend,alignment_subtrahend) { gt_alignment* const alignment_difference = gt_alignment_subtract_alignment_maps_fx(gt_map_cmp_fx,alignment_minuend,alignment_subtrahend); gt_template* const template_difference = gt_template_new(); gt_template_add_block(template_difference,alignment_difference); return template_difference; } GT_TEMPLATE_END_REDUCTION; } GT_TEMPLATE_END_REDUCTION; // Subtract GT_TEMPLATE_CHECK(template_minuend); GT_TEMPLATE_CHECK(template_subtrahend); gt_template* const template_difference = gt_template_dup(template_minuend,false,false); uint64_t found_mmap_pos; gt_map** found_mmap; gt_mmap_attributes* found_mmap_attr; GT_TEMPLATE_ITERATE_MMAP__ATTR(template_minuend,mmap,mmap_attr) { if (!gt_template_find_mmap_fx(gt_mmap_cmp_fx,template_subtrahend,mmap,&found_mmap_pos,&found_mmap,&found_mmap_attr)) { gt_map** mmap_copy = gt_mmap_array_copy(mmap,__mmap_num_blocks); gt_template_put_mmap(gt_mmap_cmp_fx,gt_map_cmp_fx,template_difference,mmap_copy,mmap_attr,false); gt_free(mmap_copy); } } return template_difference; } GT_INLINE gt_template* gt_template_subtract_template_mmaps( gt_template* const template_minuend,gt_template* const template_subtrahend) { GT_TEMPLATE_CHECK(template_minuend); GT_TEMPLATE_CHECK(template_subtrahend); return gt_template_subtract_template_mmaps_fx(gt_mmap_cmp,gt_map_cmp,template_minuend,template_subtrahend); } GT_INLINE gt_template* gt_template_intersect_template_mmaps_fx( int64_t (*gt_mmap_cmp_fx)(gt_map**,gt_map**,uint64_t),int64_t (*gt_map_cmp_fx)(gt_map*,gt_map*), gt_template* const template_A,gt_template* const template_B) { GT_NULL_CHECK(gt_mmap_cmp_fx); GT_NULL_CHECK(gt_map_cmp_fx); GT_TEMPLATE_COMMON_CONSISTENCY_ERROR(template_A,template_B); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_A,alignment_A) { GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template_B,alignment_B) { gt_alignment* const alignment_intersection = gt_alignment_intersect_alignment_maps_fx(gt_map_cmp_fx,alignment_A,alignment_B); gt_template* const template_intersection = gt_template_new(); gt_template_add_block(template_intersection,alignment_intersection); return template_intersection; } GT_TEMPLATE_END_REDUCTION; } GT_TEMPLATE_END_REDUCTION; // Intersect GT_TEMPLATE_CHECK(template_A); GT_TEMPLATE_CHECK(template_B); gt_template* const template_intersection = gt_template_dup(template_A,false,false); uint64_t found_mmap_pos; gt_map** found_mmap; gt_mmap_attributes* found_mmap_attr; GT_TEMPLATE_ITERATE_MMAP__ATTR(template_A,mmap,mmap_attr) { if (gt_template_find_mmap_fx(gt_mmap_cmp_fx,template_B,mmap,&found_mmap_pos,&found_mmap,&found_mmap_attr)) { gt_map** mmap_copy = gt_mmap_array_copy(mmap,__mmap_num_blocks); gt_template_put_mmap(gt_mmap_cmp_fx,gt_map_cmp_fx,template_intersection,mmap_copy,mmap_attr,false); gt_free(mmap_copy); } } return template_intersection; } GT_INLINE gt_template* gt_template_intersect_template_mmaps( gt_template* const template_A,gt_template* const template_B) { GT_TEMPLATE_CHECK(template_A); GT_TEMPLATE_CHECK(template_B); return gt_template_intersect_template_mmaps_fx(gt_mmap_cmp,gt_map_cmp,template_A,template_B); } /* * Template realignment */ GT_INLINE void gt_template_recover_mismatches(gt_template* const template,gt_sequence_archive* const sequence_archive) { GT_TEMPLATE_CHECK(template); GT_SEQUENCE_ARCHIVE_CHECK(sequence_archive); GT_TEMPLATE_ITERATE_ALIGNMENT(template,alignment) { gt_alignment_recover_mismatches(alignment,sequence_archive); } if (gt_template_get_num_blocks(template)>1) gt_template_recalculate_counters(template); } GT_INLINE void gt_template_realign_hamming(gt_template* const template,gt_sequence_archive* const sequence_archive) { GT_TEMPLATE_CHECK(template); GT_SEQUENCE_ARCHIVE_CHECK(sequence_archive); GT_TEMPLATE_ITERATE_ALIGNMENT(template,alignment) { gt_alignment_realign_hamming(alignment,sequence_archive); } if (gt_template_get_num_blocks(template)>1) gt_template_recalculate_counters(template); } GT_INLINE void gt_template_realign_levenshtein(gt_template* const template,gt_sequence_archive* const sequence_archive) { GT_TEMPLATE_CHECK(template); GT_SEQUENCE_ARCHIVE_CHECK(sequence_archive); GT_TEMPLATE_ITERATE_ALIGNMENT(template,alignment) { gt_alignment_realign_levenshtein(alignment,sequence_archive); } if (gt_template_get_num_blocks(template)>1) gt_template_recalculate_counters(template); } GT_INLINE void gt_template_realign_weighted( gt_template* const template,gt_sequence_archive* const sequence_archive,int32_t (*gt_weigh_fx)(char*,char*)) { GT_TEMPLATE_CHECK(template); GT_SEQUENCE_ARCHIVE_CHECK(sequence_archive); GT_NULL_CHECK(gt_weigh_fx); GT_TEMPLATE_ITERATE_ALIGNMENT(template,alignment) { gt_alignment_realign_weighted(alignment,sequence_archive,gt_weigh_fx); } if (gt_template_get_num_blocks(template)>1) gt_template_recalculate_counters(template); } /* * Template trimming */ GT_INLINE void gt_template_hard_trim(gt_template* const template,const uint64_t left,const uint64_t right) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_ITERATE_ALIGNMENT(template,alignment) { gt_alignment_hard_trim(alignment,left,right); } if (gt_template_is_paired_end(template)) gt_template_recalculate_counters(template); } GT_INLINE void gt_template_restore_trim(gt_template* const template) { GT_TEMPLATE_CHECK(template); GT_TEMPLATE_ITERATE_ALIGNMENT(template,alignment) { gt_alignment_restore_trim(alignment); } if (gt_template_is_paired_end(template)) gt_template_recalculate_counters(template); } ///* // * Template trimming // */ //GT_INLINE void gt_template_trim(gt_template* const template,uint64_t const left,uint64_t const right,uint64_t const min_length,const bool set_extra) { // GT_TEMPLATE_CHECK(template); // GT_TEMPLATE_ITERATE_ALIGNMENT(template,alignment) { // gt_alignment_hard_trim(alignment,left,right,min_length,set_extra); // } // if (set_extra) { // TODO: Why? // gt_alignment* first = gt_template_get_block(template,0); // // Transfer extra attribute // gt_string* alignment_extra = gt_attributes_get(first->attributes,GT_ATTR_ID_TAG_EXTRA); // if (gt_attributes_is_contained(template->attributes,GT_ATTR_ID_TAG_EXTRA)) { // gt_string* old = gt_attributes_get(template->attributes,GT_ATTR_ID_TAG_EXTRA); // gt_string_copy(old,alignment_extra); // } else { // gt_string* const extra = gt_string_new(8 + (2*left) + (2*right)); // gt_string_copy(extra,alignment_extra); // gt_attributes_add_string(template->attributes,GT_ATTR_ID_TAG_EXTRA,extra); // } // } //} /* * Template/Alignment Placeholder (mmap/map) */ GT_INLINE gt_map_placeholder* gt_map_placeholder_new() { gt_map_placeholder* const map_placeholder = gt_alloc(gt_map_placeholder); gt_map_placeholder_clear(map_placeholder); return map_placeholder; } GT_INLINE void gt_map_placeholder_delete(gt_map_placeholder* const map_placeholder) { GT_NULL_CHECK(map_placeholder); gt_free(map_placeholder); } GT_INLINE void gt_map_placeholder_clear(gt_map_placeholder* const map_placeholder) { GT_NULL_CHECK(map_placeholder); memset(map_placeholder,0,sizeof(map_placeholder)); } GT_INLINE void gt_map_placeholder_set_sam_fields(gt_map_placeholder* const map_placeholder, const bool not_passing_QC,const bool PCR_duplicate,const uint32_t hard_trim_left,const uint32_t hard_trim_right) { GT_NULL_CHECK(map_placeholder); map_placeholder->not_passing_QC = not_passing_QC; map_placeholder->PCR_duplicate = PCR_duplicate; map_placeholder->hard_trim_left = hard_trim_left; map_placeholder->hard_trim_right = hard_trim_right; } /* * Compare Template/Alignment Placeholders _> (int (*)(const void *,const void *)) * i.e. (Sorting from smaller to bigger, <) := a-b * cmp(a,b) := -n if (a<b) * n if (a>b) * 0 if (a==b) */ #define GT_MAP_PLACEHOLDER_CMP_CHECK_BOUNDARY_CONDITIONS(ph_map_a,ph_map_b) \ /* Boundary conditions (Different type, same map, unmapped) */ \ if (ph_map_a->type!=ph_map_b->type) return ((int)ph_map_a->type - (int)ph_map_b->type); /* Check different type */ \ if (ph_map_a->map==ph_map_b->map) return 0; /* Check same map */ \ if (ph_map_a->map==NULL || ph_map_b->map==NULL) return (ph_map_a->map==NULL) ? 1 : -1; /* Check unmapped */ int gt_map_placeholder_cmp_coordinates(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { // NOTE: Doesn't check chromosome // Boundary conditions (same map, unmapped) if (ph_map_a->map==ph_map_b->map) return 0; /* Check same map */ \ if (ph_map_a->map==NULL || ph_map_b->map==NULL) return (ph_map_a->map==NULL) ? 1 : -1; /* Check unmapped */ // Here, different map with same type and both mapped const int64_t coordinate_a = gt_map_get_global_coordinate(ph_map_a->map); const int64_t coordinate_b = gt_map_get_global_coordinate(ph_map_b->map); return coordinate_a-coordinate_b; } int gt_map_placeholder_cmp_map_distance(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { // TODO return 0; } int gt_map_placeholder_cmp_map_phred_scores(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { /* * Compare phred scores ( -10*log(Pr{mapping position is wrong},10) ) * - 0, 255 values are not allowed * - 1..254 = bad_score..good_score */ GT_MAP_PLACEHOLDER_CMP_CHECK_BOUNDARY_CONDITIONS(ph_map_a,ph_map_b); // Here, different map with same type and both mapped const int score_a = ph_map_a->map->phred_score; const int score_b = ph_map_b->map->phred_score; // No scored if (score_a==GT_MAP_NO_PHRED_SCORE || score_b==GT_MAP_NO_PHRED_SCORE) return score_a-score_b; // Regular compare (including case (score_a==0 || score_b==0)) return score_b-score_a; } int gt_map_placeholder_cmp_map_gt_scores_ascending(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { GT_MAP_PLACEHOLDER_CMP_CHECK_BOUNDARY_CONDITIONS(ph_map_a,ph_map_b); // Here, different map with same type and both mapped const uint64_t score_a = ph_map_a->map->gt_score; const uint64_t score_b = ph_map_b->map->gt_score; return (score_a<score_b) ? -1 : ( (score_a>score_b) ? 1 : 0); } int gt_map_placeholder_cmp_map_gt_scores_descending(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { GT_MAP_PLACEHOLDER_CMP_CHECK_BOUNDARY_CONDITIONS(ph_map_a,ph_map_b); // Here, different map with same type and both mapped const uint64_t score_a = ph_map_a->map->gt_score; const uint64_t score_b = ph_map_b->map->gt_score; return (score_a<score_b) ? 1 : ( (score_a>score_b) ? -1 : 0); } int gt_map_placeholder_cmp_mmap_phred_scores(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { // TODO return 0; } int gt_map_placeholder_cmp_mmap_gt_scores_ascending(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { // TODO return 0; } int gt_map_placeholder_cmp_mmap_gt_scores_descending(gt_map_placeholder* const ph_map_a,gt_map_placeholder* const ph_map_b) { // TODO return 0; } /* * Template/Alignment Placeholder (mmap/map) * * Fills the placeholder's vector @mmap_placeholder with all the mmaps from template * - If @include_mate_placeholder is set, inserts a placeholder for the mate * ({ph.paired_end.paired_end_position==1}). i.e. As for SAM output like operations * - If @split_segments is set, individual segments are inserted into @mmap_placeholder (taking into account quimeras/segments) * - If @primary_mmap_end1_pos is not null, sets it to the position in the array of the primary/best mmap(end/1) placeholder * Sorts w.r.t @gt_ph_cmp_fx sorting. If @gt_ph_cmp_fx is null, then is set to the first one added. * - If @primary_mmap_end2_pos is not null, sets it to the position in the array of the primary/best mmap(end/2) placeholder * Sorts w.r.t @gt_ph_cmp_fx sorting. If @gt_ph_cmp_fx is null, then is set to the first one added. * If @include_mate_placeholder is not set, then @primary_mmap_end1_pos==@primary_mmap_end2_pos * - If @placeholder_template is not null, then its values are used as defaults (not_passing_QC,PCR_duplicate,...) */ #define GT_MAP_PLACEHOLDER_SET_BEST_PH(best_mmap_ph,best_mmap_ph_position,mmap_ph,mmap_ph_position) \ best_mmap_ph = mmap_ph; \ best_mmap_ph_position = mmap_ph_position #define GT_MAP_PLACEHOLDER_CMP_BEST_PH(best_mmap_ph,best_mmap_ph_position,mmap_ph,mmap_ph_position) { \ if (gt_expect_false(best_mmap_ph_position==UINT64_MAX)) { \ GT_MAP_PLACEHOLDER_SET_BEST_PH(best_mmap_ph,best_mmap_ph_position,mmap_ph,mmap_ph_position); \ } else if (gt_ph_cmp_fx!=NULL) { \ if (gt_ph_cmp_fx(&best_mmap_ph,&mmap_ph)>0) { \ GT_MAP_PLACEHOLDER_SET_BEST_PH(best_mmap_ph,best_mmap_ph_position,mmap_ph,mmap_ph_position); \ } \ } \ } GT_INLINE void gt_map_placeholder_add_mmap( gt_map* const map_endA,gt_map* const map_endB,gt_string* const read_endA,const uint64_t paired_end_position, gt_vector* const mmap_placeholder,const bool split_segments, int (*gt_ph_cmp_fx)(gt_map_placeholder* const,gt_map_placeholder* const),const bool cmp_with_best, gt_map_placeholder* const best_mmap_ph,uint64_t* const best_mmap_ph_position, gt_map_placeholder* const mmap_ph) { uint64_t num_placeholders = gt_vector_get_used(mmap_placeholder); // Note that (map_endA!=NULL) || (map_endB!=NULL) must hold mmap_ph->paired_end.paired_end_position = paired_end_position; if (map_endA==NULL) { /* * End/1 Unmapped * MAP => Don't unfold quimeras (never needed) * SAM => Don't unfold quimeras (Is unmapped, so unfold is not required) */ mmap_ph->type = GT_MMAP_PLACEHOLDER_UNPAIRED; mmap_ph->map = NULL; mmap_ph->paired_end.mate = map_endB; // SAM doen't care of this (as it's unmapped). But MAP does. mmap_ph->hard_trim_left = 0; mmap_ph->hard_trim_right = 0; gt_vector_insert(mmap_placeholder,*mmap_ph,gt_map_placeholder); // Pick primary alignment if (cmp_with_best) GT_MAP_PLACEHOLDER_CMP_BEST_PH(*best_mmap_ph,*best_mmap_ph_position,*mmap_ph,num_placeholders); } else { /* * End/1 Mapped */ if (map_endB==NULL) { /* * End/2 Unmapped */ mmap_ph->type = GT_MMAP_PLACEHOLDER_UNPAIRED; GT_MAP_SEGMENT_ITERATOR(map_endA,map_segment_iterator_end1) { mmap_ph->map = gt_map_segment_iterator_get_map(&map_segment_iterator_end1); mmap_ph->paired_end.mate = NULL; mmap_ph->hard_trim_left = (split_segments) ? gt_map_segment_iterator_get_accumulated_offset(&map_segment_iterator_end1) : 0; mmap_ph->hard_trim_right = (split_segments) ? gt_map_segment_iterator_get_remaining_bases(&map_segment_iterator_end1,read_endA) : 0; gt_vector_insert(mmap_placeholder,*mmap_ph,gt_map_placeholder); // Pick primary alignment if (cmp_with_best) GT_MAP_PLACEHOLDER_CMP_BEST_PH(*best_mmap_ph,*best_mmap_ph_position,*mmap_ph,num_placeholders); ++num_placeholders; if (!split_segments) break; // Break if quimeras are not supposed to be unfolded } } else { /* * End/2 Mapped */ mmap_ph->type = GT_MMAP_PLACEHOLDER_PAIRED; GT_MAP_SEGMENT_ITERATOR(map_endA,map_segment_iterator_end1) { GT_MAP_SEGMENT_ITERATOR(map_endB,map_segment_iterator_end2) { mmap_ph->map = gt_map_segment_iterator_get_map(&map_segment_iterator_end1); mmap_ph->paired_end.mate = gt_map_segment_iterator_get_map(&map_segment_iterator_end2); mmap_ph->hard_trim_left = (split_segments) ? gt_map_segment_iterator_get_accumulated_offset(&map_segment_iterator_end1) : 0; mmap_ph->hard_trim_right = (split_segments) ? gt_map_segment_iterator_get_remaining_bases(&map_segment_iterator_end1,read_endA) : 0; gt_vector_insert(mmap_placeholder,*mmap_ph,gt_map_placeholder); // Pick primary alignment if (cmp_with_best) GT_MAP_PLACEHOLDER_CMP_BEST_PH(*best_mmap_ph,*best_mmap_ph_position,*mmap_ph,num_placeholders); ++num_placeholders; if (!split_segments) break; // Break if quimeras are not supposed to be unfolded } if (!split_segments) break; // Break if quimeras are not supposed to be unfolded } } } } GT_INLINE void gt_map_placeholder_build_from_template( gt_template* const template,gt_vector* const mmap_placeholder, const bool include_mate_placeholder,const bool split_segments,const uint64_t max_num_maps, int (*gt_ph_cmp_fx)(gt_map_placeholder* const,gt_map_placeholder* const), uint64_t* const primary_mmap_end1_pos,uint64_t* const primary_mmap_end2_pos, gt_map_placeholder* const placeholder_template) { GT_TEMPLATE_CHECK(template); GT_VECTOR_CHECK(mmap_placeholder); GT_TEMPLATE_IF_REDUCES_TO_ALINGMENT(template,alignment) { placeholder_template->single_end.template = template; gt_map_placeholder_build_from_alignment(alignment,mmap_placeholder,split_segments,max_num_maps, gt_ph_cmp_fx,primary_mmap_end1_pos,placeholder_template); if (primary_mmap_end1_pos!=NULL && primary_mmap_end2_pos!=NULL) *primary_mmap_end2_pos=*primary_mmap_end1_pos; } GT_TEMPLATE_END_REDUCTION__RETURN; // Prepare placeholder template gt_map_placeholder mmap_ph; if (placeholder_template!=NULL) mmap_ph=*placeholder_template; mmap_ph.paired_end.template = template; mmap_ph.secondary_alignment = true; // Gather initial data const uint64_t num_initial_placeholders = gt_vector_get_used(mmap_placeholder); gt_string* const read[2] = {gt_template_get_end1(template)->read,gt_template_get_end2(template)->read}; // Add mmaps uint64_t num_mmaps_added = 0; gt_map_placeholder best_mmap_ph_end1, best_mmap_ph_end2; uint64_t best_mmap_ph_end1_pos = UINT64_MAX, best_mmap_ph_end2_pos = UINT64_MAX; if (gt_template_get_num_mmaps(template)==0) { // Unmmapped // Include unampped mmap mmap_ph.paired_end.mmap_attributes = NULL; gt_map_placeholder_add_mmap(NULL,NULL,read[0],0, mmap_placeholder,split_segments,gt_ph_cmp_fx,primary_mmap_end1_pos!=NULL, &best_mmap_ph_end1,&best_mmap_ph_end1_pos,&mmap_ph); // End/1 if (include_mate_placeholder) { gt_map_placeholder_add_mmap(NULL,NULL,read[0],1, mmap_placeholder,split_segments,gt_ph_cmp_fx,primary_mmap_end2_pos!=NULL, &best_mmap_ph_end2,&best_mmap_ph_end2_pos,&mmap_ph); // End/2 } } else { // Include mmaps bool end1_record_included = false, end2_record_included = false; GT_TEMPLATE_ITERATE_MMAP__ATTR_(template,mmap,mmap_attr) { mmap_ph.paired_end.mmap_attributes = mmap_attr; if (include_mate_placeholder) { if (mmap[0]!=NULL) { end1_record_included = true; gt_map_placeholder_add_mmap(mmap[0],mmap[1],read[0],0, mmap_placeholder,split_segments,gt_ph_cmp_fx,primary_mmap_end1_pos!=NULL, &best_mmap_ph_end1,&best_mmap_ph_end1_pos,&mmap_ph); // End/1 } if (mmap[1]!=NULL) { end2_record_included = true; gt_map_placeholder_add_mmap(mmap[1],mmap[0],read[1],1, mmap_placeholder,split_segments,gt_ph_cmp_fx,primary_mmap_end2_pos!=NULL, &best_mmap_ph_end2,&best_mmap_ph_end2_pos,&mmap_ph); // End/2 } } else { gt_map_placeholder_add_mmap(mmap[0],mmap[1],read[0],0, mmap_placeholder,split_segments,gt_ph_cmp_fx,primary_mmap_end1_pos!=NULL, &best_mmap_ph_end1,&best_mmap_ph_end1_pos,&mmap_ph); // End/1 } if (++num_mmaps_added > max_num_maps) break; } // Check if at least we have a record per each end if (include_mate_placeholder) { if (!end1_record_included) { gt_map_placeholder_add_mmap(NULL,NULL,read[0],0, mmap_placeholder,split_segments,gt_ph_cmp_fx,primary_mmap_end1_pos!=NULL, &best_mmap_ph_end1,&best_mmap_ph_end1_pos,&mmap_ph); // End/1 } if (!end2_record_included) { gt_map_placeholder_add_mmap(NULL,NULL,read[1],1, mmap_placeholder,split_segments,gt_ph_cmp_fx,primary_mmap_end2_pos!=NULL, &best_mmap_ph_end2,&best_mmap_ph_end2_pos,&mmap_ph); // End/2 } } } // Set primary alignment if (primary_mmap_end1_pos!=NULL) { *primary_mmap_end1_pos = best_mmap_ph_end1_pos; gt_vector_get_elm(mmap_placeholder,best_mmap_ph_end1_pos,gt_map_placeholder)->secondary_alignment = false; GT_SWAP(*(gt_vector_get_elm(mmap_placeholder,best_mmap_ph_end1_pos,gt_map_placeholder)), *(gt_vector_get_elm(mmap_placeholder,num_initial_placeholders,gt_map_placeholder))); } if (primary_mmap_end2_pos!=NULL) { if (include_mate_placeholder) { *primary_mmap_end2_pos = best_mmap_ph_end2_pos; gt_vector_get_elm(mmap_placeholder,best_mmap_ph_end2_pos,gt_map_placeholder)->secondary_alignment = false; GT_SWAP(*(gt_vector_get_elm(mmap_placeholder,best_mmap_ph_end2_pos,gt_map_placeholder)), *(gt_vector_get_elm(mmap_placeholder,num_initial_placeholders+1,gt_map_placeholder))); // Courtesy } else { if (primary_mmap_end1_pos!=NULL) *primary_mmap_end2_pos = *primary_mmap_end1_pos; } } } /* * Fills the placeholder's vector @mmap_placeholder with all the maps from alignment * - If @split_segments is set, individual segments are inserted into @mmap_placeholder (taking into account quimeras/segments) * - If @primary_map_position is not null, sets it to the position in the array of the primary/best alignment placeholder * Sorts w.r.t @gt_ph_cmp_fx sorting. If @gt_ph_cmp_fx is null, then is set to the first one added. * If @include_mate_placeholder is not set, then @primary_mmap_end1_pos==@primary_mmap_end2_pos * - If @placeholder_template is not null, then its values are used as defaults (not_passing_QC,PCR_duplicate,...) */ GT_INLINE void gt_map_placeholder_add_map( gt_map* const map,gt_string* const read, gt_vector* const mmap_placeholder,const bool split_segments, int (*gt_ph_cmp_fx)(gt_map_placeholder* const,gt_map_placeholder* const),const bool cmp_with_best, gt_map_placeholder* const best_mmap_ph,uint64_t* const best_mmap_ph_position, gt_map_placeholder* const mmap_ph) { uint64_t num_placeholders = gt_vector_get_used(mmap_placeholder); mmap_ph->type = GT_MAP_PLACEHOLDER; if (map==NULL) { // Unmapped mmap_ph->map = NULL; mmap_ph->hard_trim_left = 0; mmap_ph->hard_trim_right = 0; gt_vector_insert(mmap_placeholder,*mmap_ph,gt_map_placeholder); // Pick primary alignment if (cmp_with_best) GT_MAP_PLACEHOLDER_CMP_BEST_PH(*best_mmap_ph,*best_mmap_ph_position,*mmap_ph,num_placeholders); } else { GT_MAP_SEGMENT_ITERATOR(map,map_segment_iterator) { mmap_ph->map = gt_map_segment_iterator_get_map(&map_segment_iterator); mmap_ph->hard_trim_left = (split_segments) ? gt_map_segment_iterator_get_accumulated_offset(&map_segment_iterator) : 0; mmap_ph->hard_trim_right = (split_segments) ? gt_map_segment_iterator_get_remaining_bases(&map_segment_iterator,read) : 0; gt_vector_insert(mmap_placeholder,*mmap_ph,gt_map_placeholder); // Pick primary alignment if (best_mmap_ph_position!=NULL) { GT_MAP_PLACEHOLDER_CMP_BEST_PH(*best_mmap_ph,*best_mmap_ph_position,*mmap_ph,num_placeholders); } ++num_placeholders; // Break if quimeras are not supposed to be unfolded if (!split_segments) break; } } } GT_INLINE void gt_map_placeholder_build_from_alignment( gt_alignment* const alignment,gt_vector* const mmap_placeholder,const bool split_segments,const uint64_t max_num_maps, int (*gt_ph_cmp_fx)(gt_map_placeholder* const,gt_map_placeholder* const),uint64_t* const primary_map_position, gt_map_placeholder* const placeholder_template) { GT_ALIGNMENT_CHECK(alignment); GT_VECTOR_CHECK(mmap_placeholder); // Prepare placeholder template gt_map_placeholder mmap_ph; if (placeholder_template!=NULL) mmap_ph=*placeholder_template; const uint64_t num_maps = gt_alignment_get_num_maps(alignment); const uint64_t num_initial_placeholders = gt_vector_get_used(mmap_placeholder); mmap_ph.single_end.alignment = alignment; mmap_ph.secondary_alignment = true; // Add maps uint64_t num_mmaps_added = 0; gt_map_placeholder best_mmap_ph; uint64_t best_mmap_ph_pos = UINT64_MAX; if (num_maps==0) { // Include unmapped gt_map_placeholder_add_map(NULL,alignment->read,mmap_placeholder,split_segments, gt_ph_cmp_fx,primary_map_position!=NULL,&best_mmap_ph,&best_mmap_ph_pos,&mmap_ph); } else { // Include maps GT_ALIGNMENT_ITERATE(alignment,map) { gt_map_placeholder_add_map(map,alignment->read,mmap_placeholder,split_segments, gt_ph_cmp_fx,primary_map_position!=NULL,&best_mmap_ph,&best_mmap_ph_pos,&mmap_ph); if (++num_mmaps_added > max_num_maps) break; } } // Set primary alignment if (primary_map_position!=NULL) { *primary_map_position = best_mmap_ph_pos; gt_vector_get_elm(mmap_placeholder,best_mmap_ph_pos,gt_map_placeholder)->secondary_alignment = false; GT_SWAP(*(gt_vector_get_elm(mmap_placeholder,best_mmap_ph_pos,gt_map_placeholder)), *(gt_vector_get_elm(mmap_placeholder,num_initial_placeholders,gt_map_placeholder))); // Courtesy } }
47.060074
152
0.776154
7d03f4aec49f2199851353e3fb987bf12f4504be
599
h
C
PrivateFrameworks/CalendarUI/RemindMeCheckbox.h
phatblat/macOSPrivateFrameworks
9047371eb80f925642c8a7c4f1e00095aec66044
[ "MIT" ]
17
2018-11-13T04:02:58.000Z
2022-01-20T09:27:13.000Z
PrivateFrameworks/CalendarUI/RemindMeCheckbox.h
phatblat/macOSPrivateFrameworks
9047371eb80f925642c8a7c4f1e00095aec66044
[ "MIT" ]
3
2018-04-06T02:02:27.000Z
2018-10-02T01:12:10.000Z
PrivateFrameworks/CalendarUI/RemindMeCheckbox.h
phatblat/macOSPrivateFrameworks
9047371eb80f925642c8a7c4f1e00095aec66044
[ "MIT" ]
1
2018-09-28T13:54:23.000Z
2018-09-28T13:54:23.000Z
// // Generated by class-dump 3.5 (64 bit). // // class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard. // #import <CalendarUI/RemindMeView.h> @class NSButton, NSLayoutConstraint; @interface RemindMeCheckbox : RemindMeView { NSButton *_checkbox; NSLayoutConstraint *_bottomPadding; } @property(retain) NSLayoutConstraint *bottomPadding; // @synthesize bottomPadding=_bottomPadding; @property(retain) NSButton *checkbox; // @synthesize checkbox=_checkbox; - (void).cxx_destruct; - (id)initWithGadget:(id)arg1 andLabel:(id)arg2 andSelector:(SEL)arg3; @end
24.958333
97
0.739566
febb4ed95ba0293d5a197537095ad7704597d802
428
c
C
src/shift.c
gtxc/libgt
7f32659fa0428dcdb225a0ffbf0b6482583330d6
[ "MIT" ]
null
null
null
src/shift.c
gtxc/libgt
7f32659fa0428dcdb225a0ffbf0b6482583330d6
[ "MIT" ]
null
null
null
src/shift.c
gtxc/libgt
7f32659fa0428dcdb225a0ffbf0b6482583330d6
[ "MIT" ]
null
null
null
/* * Created by gt on 1/6/22 - 7:00 AM. * Copyright (c) 2022 GTXC. All rights reserved. */ #include <stdio.h> #include <ctype.h> void rate(int n, int atten) { unsigned char adch_tmp = n >> (atten / 2); adch_tmp = atten % 2 ? adch_tmp : adch_tmp + (adch_tmp >> 1); printf("atten:%3i, result: %i\n", atten, adch_tmp); } int main() { for (int i = 1; i < 12; ++i) { rate(100, i); } return 0; }
20.380952
65
0.553738
7d549b382d794d3ac6d1f4f28c0665decf14dc94
236
h
C
server_side/thread.h
JulienFerte/Lib-a-Lot
9603c3e6afa7c4dac9990ee3a5322c88049d531f
[ "CC-BY-4.0" ]
null
null
null
server_side/thread.h
JulienFerte/Lib-a-Lot
9603c3e6afa7c4dac9990ee3a5322c88049d531f
[ "CC-BY-4.0" ]
null
null
null
server_side/thread.h
JulienFerte/Lib-a-Lot
9603c3e6afa7c4dac9990ee3a5322c88049d531f
[ "CC-BY-4.0" ]
null
null
null
#ifndef THREAD_H #define THREAD_H #include "h_header.h" #define THREAD_NOT_LAUNCHED 0 #define THREAD_RUNNING 1 #define THREAD_WAITING_JOIN 2 //*** Setting the flag of termination void tells_finished( void* ); #endif // THREAD_H
16.857143
37
0.758475
ccaed87cf181efe9e843197aa7d728c6541d8b21
474
c
C
xinu2019/xinu/device/sdmc/sdmcwrite.c
fengxiaohu/xinu_version_compare
fc4c5ad661917f5feab4eaeada0a8eac83f51de9
[ "Apache-2.0" ]
null
null
null
xinu2019/xinu/device/sdmc/sdmcwrite.c
fengxiaohu/xinu_version_compare
fc4c5ad661917f5feab4eaeada0a8eac83f51de9
[ "Apache-2.0" ]
null
null
null
xinu2019/xinu/device/sdmc/sdmcwrite.c
fengxiaohu/xinu_version_compare
fc4c5ad661917f5feab4eaeada0a8eac83f51de9
[ "Apache-2.0" ]
null
null
null
/* sdmcwrite.c - sdmcwrite */ #include <xinu.h> #include <sdmc.h> /*------------------------------------------------------------------------ * sdmcwrite - Write a buffer to an SD memory card *------------------------------------------------------------------------ */ devcall sdmcwrite ( struct dentry *devptr, /* entry in device switch table */ char *buff, /* buffer to hold disk block */ int32 blk /* block number of disk block */ ) { return OK; }
23.7
74
0.432489
b6d20314bdbb870c9e72593f4422f1a8cffe95a1
6,411
c
C
main.c
mattn/ttyrec2gif
7e96c6420d63cc345a0eb8d79d817bdf31ddaa26
[ "MIT" ]
15
2017-07-21T17:03:16.000Z
2021-07-08T18:25:11.000Z
main.c
mattn/ttyrec2gif
7e96c6420d63cc345a0eb8d79d817bdf31ddaa26
[ "MIT" ]
null
null
null
main.c
mattn/ttyrec2gif
7e96c6420d63cc345a0eb8d79d817bdf31ddaa26
[ "MIT" ]
2
2017-07-21T23:27:49.000Z
2019-02-24T01:11:29.000Z
#include <stdio.h> #include <stdlib.h> #include <memory.h> #include <unistd.h> #include <gd.h> #include <gdfontl.h> #include "vterm.h" #define SWAP_ENDIAN(val) ((unsigned int) ( \ (((unsigned int) (val) & (unsigned int) 0x000000ffU) << 24) | \ (((unsigned int) (val) & (unsigned int) 0x0000ff00U) << 8) | \ (((unsigned int) (val) & (unsigned int) 0x00ff0000U) >> 8) | \ (((unsigned int) (val) & (unsigned int) 0xff000000U) >> 24))) static char *f = "VL-Gothic-Regular"; static double fs = 8.0; static int brect[8] = {0}; static int w = 80, h = 24, dx, dy; typedef struct header { int diff; int len; } Header; static int is_little_endian() { static int retval = -1; if (retval == -1) { int n = 1; char *p = (char *)&n; char x[] = {1, 0, 0, 0}; retval = memcmp(p, x, 4) == 0 ? 1 : 0; } return retval; } static int convert_to_little_endian(int x) { if (is_little_endian()) return x; return SWAP_ENDIAN(x); } static int read_header(FILE *fp, Header *h) { static unsigned long old = 0; unsigned long cur; int buf[3]; if (fread(buf, sizeof(int), 3, fp) == 0) { return 0; } cur = convert_to_little_endian(buf[0]) * 1000000 + convert_to_little_endian(buf[1]); h->diff = old == 0 ? 0 : cur - old; h->len = convert_to_little_endian(buf[2]); old = cur; return 1; } static int ttyread(FILE *fp, Header *h, char **buf) { if (read_header(fp, h) == 0) return 0; *buf = malloc(h->len); if (*buf == NULL) perror("malloc"); if (fread(*buf, 1, h->len, fp) == 0) perror("fread"); return 1; } static int utf_char2bytes(int c, char *buf) { if (c < 0x80) { buf[0] = c; return 1; } if (c < 0x800) { buf[0] = 0xc0 + ((unsigned)c >> 6); buf[1] = 0x80 + (c & 0x3f); return 2; } if (c < 0x10000) { buf[0] = 0xe0 + ((unsigned)c >> 12); buf[1] = 0x80 + (((unsigned)c >> 6) & 0x3f); buf[2] = 0x80 + (c & 0x3f); return 3; } if (c < 0x200000) { buf[0] = 0xf0 + ((unsigned)c >> 18); buf[1] = 0x80 + (((unsigned)c >> 12) & 0x3f); buf[2] = 0x80 + (((unsigned)c >> 6) & 0x3f); buf[3] = 0x80 + (c & 0x3f); return 4; } if (c < 0x4000000) { buf[0] = 0xf8 + ((unsigned)c >> 24); buf[1] = 0x80 + (((unsigned)c >> 18) & 0x3f); buf[2] = 0x80 + (((unsigned)c >> 12) & 0x3f); buf[3] = 0x80 + (((unsigned)c >> 6) & 0x3f); buf[4] = 0x80 + (c & 0x3f); return 5; } buf[0] = 0xfc + ((unsigned)c >> 30); buf[1] = 0x80 + (((unsigned)c >> 24) & 0x3f); buf[2] = 0x80 + (((unsigned)c >> 18) & 0x3f); buf[3] = 0x80 + (((unsigned)c >> 12) & 0x3f); buf[4] = 0x80 + (((unsigned)c >> 6) & 0x3f); buf[5] = 0x80 + (c & 0x3f); return 6; } static void usage(void) { printf("Usage: ttyrec2gif [OPTION] [FILE]\n"); printf(" -o FILE Set output file \n"); printf(" -f FONT Set font file \n"); exit(EXIT_FAILURE); } static void write_schene(FILE* out, VTerm* vt, int duration) { int color; VTermScreen* screen; VTermPos pos; VTermScreenCell cell; gdImagePtr fimg; screen = vterm_obtain_screen(vt); /* render terminal */ fimg = gdImageCreateTrueColor(w * dx, h * dy); for (pos.row = 0; pos.row < 24; pos.row++) { for (pos.col = 0; pos.col < 80; pos.col++) { char b[7] = {0}; vterm_screen_get_cell(screen, pos, &cell); if (cell.chars[0] == 0) continue; b[utf_char2bytes((int) *cell.chars, b)] = 0; color = gdImageColorResolve( fimg, cell.bg.red, cell.bg.green, cell.bg.blue); gdImageFilledRectangle( fimg, pos.col * dx, pos.row * dy, (pos.col + cell.width) * dx, (pos.row + cell.width) * dy, color); color = gdImageColorResolve( fimg, cell.fg.red, cell.fg.green, cell.fg.blue); puts(gdImageStringFT( fimg, NULL, color, f, fs, 0.0, pos.col * dx - brect[6], pos.row * dy - brect[7], b)); pos.col += cell.width - 1; } } /* render cursor */ vterm_state_get_cursorpos(vterm_obtain_state(vt), &pos); vterm_screen_get_cell(screen, pos, &cell); color = gdImageColorResolve(fimg, 255, 255, 255); gdImageFilledRectangle( fimg, pos.col * dx, pos.row * dy, (pos.col + cell.width) * dx, (pos.row + 1) * dy, color); /* add frame with delay */ gdImageTrueColorToPalette(fimg, 1, gdMaxColors); gdImageGifAnimAdd(fimg, out, 1, 0, 0, duration, gdDisposalNone, NULL); gdImageDestroy(fimg); } int main(int argc, char* argv[]) { char *buf; Header header; VTerm* vt; VTermScreen* screen; char* fname = "animated.gif"; FILE* in = NULL; FILE* out = NULL; gdImagePtr img; while (1) { int ch = getopt(argc, argv, "o:f:w:h:"); if (ch == EOF) break; switch (ch) { case 'o': if (optarg == NULL) usage(); fname = optarg; break; case 'f': if (optarg == NULL) usage(); f = optarg; break; case 'w': if (optarg == NULL) usage(); w = atoi(optarg); break; case 'h': if (optarg == NULL) usage(); h = atoi(optarg); break; default: usage(); } } if (optind >= argc) usage(); in = fopen(argv[optind], "rb"); if (!in) { perror("fopen"); return EXIT_FAILURE; } out = fopen(fname, "wb"); if (!out) { perror("fopen"); fclose(in); return EXIT_FAILURE; } /* calculate cell size */ gdImageStringFT(NULL, brect, 0, f, fs, 0.0, 0, 0, "\u25a0"); dx = (brect[4] - brect[6]) / 2; dy = brect[1] - brect[7]; img = gdImageCreate(w * dx, h * dy); if (!img) { perror("gdImageCreate"); fclose(in); fclose(out); return EXIT_FAILURE; } /* setup terminal */ vt = vterm_new(24, 80); vterm_set_utf8(vt, 1); screen = vterm_obtain_screen(vt); vterm_screen_enable_altscreen(screen, 1); vterm_screen_reset(screen, 1); gdImageGifAnimBegin(img, out, 0, -1); while (ttyread(in, &header, &buf) != 0) { /* write screen */ write_schene(out, vt, header.diff/10000); /* write to terminal */ vterm_input_write(vt, buf, header.len); free(buf); } gdImageGifAnimEnd(out); gdImageDestroy(img); vterm_free(vt); fclose(in); fclose(out); return EXIT_SUCCESS; } /* vim:set et: */
23.144404
72
0.545313
bf0c4f98544faa8603aed9ee8ae88ac88b2bba76
1,775
h
C
inc/Shape.h
davidsami/RayRay
921eb36953735911f5c255ceab6121245615462c
[ "MIT" ]
null
null
null
inc/Shape.h
davidsami/RayRay
921eb36953735911f5c255ceab6121245615462c
[ "MIT" ]
null
null
null
inc/Shape.h
davidsami/RayRay
921eb36953735911f5c255ceab6121245615462c
[ "MIT" ]
null
null
null
// David Sami 2015 #ifndef SHAPE_H #define SHAPE_H #include "BoundingBox.h" #include "Intersectable.h" #include "Material.h" #include "Math.h" #include "Colour.h" class Shape: Intersectable { public: Shape(Colour aColour, Material aMaterial, Math::Transform aTransform): mColour(aColour), mMaterial(aMaterial), mTransform(aTransform) { } Shape(): mColour(Colour(0,0,0)), mMaterial(Material()), mTransform(Math::Transform()) { } bool Intersect(const Math::Ray& aRay, double* aIntersection){ bool doesIntersect = false; // Check the bounding box first, then call CheckIntersect from subclass if(mBox.DoesIntersect(aRay)){ doesIntersect = CheckIntersect(aRay, aIntersection); } return doesIntersect; } bool DoesIntersect(const Math::Ray& aRay){ double temp; return Intersect(aRay, &temp); } virtual Math::Normal GetNormal(const Math::Point& aPoint) = 0; void SetColour(Colour aColour){ mColour = aColour; OnColourChange(); } void SetMaterial(Material aMaterial){ mMaterial = aMaterial; OnMaterialChange(); } void SetTransform(Math::Transform aTransform){ mTransform = aTransform; OnTransformChange(); } Colour GetColour(){ return mColour; } Material GetMaterial(){ return mMaterial; } protected: Colour mColour; Material mMaterial; Math::Transform mTransform; virtual void OnColourChange() {} virtual void OnMaterialChange() {} virtual void OnTransformChange() {} BoundingBox mBox; virtual bool CheckIntersect(const Math::Ray& aRay, double* aIntersection) = 0; }; #endif
23.986486
82
0.636056
bf93ead79908eafc7351f46dea5ea78203fdd09b
19,280
h
C
src/qmf/org/apache/qpid/broker/Broker.h
gcsideal/debian-qpid-cpp
e4d034036f29408f940805f5505ae62ce89650cc
[ "Apache-2.0" ]
null
null
null
src/qmf/org/apache/qpid/broker/Broker.h
gcsideal/debian-qpid-cpp
e4d034036f29408f940805f5505ae62ce89650cc
[ "Apache-2.0" ]
null
null
null
src/qmf/org/apache/qpid/broker/Broker.h
gcsideal/debian-qpid-cpp
e4d034036f29408f940805f5505ae62ce89650cc
[ "Apache-2.0" ]
null
null
null
#ifndef _MANAGEMENT_ORG_APACHE_QPID_BROKER_BROKER_ #define _MANAGEMENT_ORG_APACHE_QPID_BROKER_BROKER_ // // Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // // This source file was created by a code generator. // Please do not edit. #include "qpid/management/ManagementObject.h" #include "qmf/BrokerImportExport.h" namespace qpid { namespace management { class ManagementAgent; } } namespace qmf { namespace org { namespace apache { namespace qpid { namespace broker { QPID_BROKER_CLASS_EXTERN class Broker : public ::qpid::management::ManagementObject { private: static std::string packageName; static std::string className; static uint8_t md5Sum[MD5_LEN]; uint8_t presenceMask[1]; static const uint8_t presenceByte_dataDir = 0; static const uint8_t presenceMask_dataDir = 1; // Properties std::string name; ::qpid::management::ObjectId systemRef; uint16_t port; uint16_t workerThreads; uint16_t connBacklog; uint32_t stagingThreshold; bool mgmtPublish; uint16_t mgmtPubInterval; std::string version; std::string dataDir; // Statistics uint64_t uptime; // Per-Thread Statistics public: struct PerThreadStats { uint64_t queueCount; uint64_t msgTotalEnqueues; uint64_t msgTotalDequeues; uint64_t byteTotalEnqueues; uint64_t byteTotalDequeues; uint64_t msgDepth; uint64_t byteDepth; uint64_t msgPersistEnqueues; uint64_t msgPersistDequeues; uint64_t bytePersistEnqueues; uint64_t bytePersistDequeues; uint64_t msgTxnEnqueues; uint64_t msgTxnDequeues; uint64_t byteTxnEnqueues; uint64_t byteTxnDequeues; uint64_t msgFtdEnqueues; uint64_t msgFtdDequeues; uint64_t byteFtdEnqueues; uint64_t byteFtdDequeues; uint64_t msgFtdDepth; uint64_t byteFtdDepth; uint64_t releases; uint64_t acquires; uint64_t discardsNoRoute; uint64_t discardsTtl; uint64_t discardsRing; uint64_t discardsLvq; uint64_t discardsOverflow; uint64_t discardsSubscriber; uint64_t discardsPurge; uint64_t reroutes; uint64_t abandoned; uint64_t abandonedViaAlt; }; private: struct PerThreadStats** perThreadStatsArray; inline struct PerThreadStats* getThreadStats() { int idx = getThreadIndex(); struct PerThreadStats* threadStats = perThreadStatsArray[idx]; if (threadStats == 0) { threadStats = new(PerThreadStats); perThreadStatsArray[idx] = threadStats; threadStats->queueCount = 0; threadStats->msgTotalEnqueues = 0; threadStats->msgTotalDequeues = 0; threadStats->byteTotalEnqueues = 0; threadStats->byteTotalDequeues = 0; threadStats->msgDepth = 0; threadStats->byteDepth = 0; threadStats->msgPersistEnqueues = 0; threadStats->msgPersistDequeues = 0; threadStats->bytePersistEnqueues = 0; threadStats->bytePersistDequeues = 0; threadStats->msgTxnEnqueues = 0; threadStats->msgTxnDequeues = 0; threadStats->byteTxnEnqueues = 0; threadStats->byteTxnDequeues = 0; threadStats->msgFtdEnqueues = 0; threadStats->msgFtdDequeues = 0; threadStats->byteFtdEnqueues = 0; threadStats->byteFtdDequeues = 0; threadStats->msgFtdDepth = 0; threadStats->byteFtdDepth = 0; threadStats->releases = 0; threadStats->acquires = 0; threadStats->discardsNoRoute = 0; threadStats->discardsTtl = 0; threadStats->discardsRing = 0; threadStats->discardsLvq = 0; threadStats->discardsOverflow = 0; threadStats->discardsSubscriber = 0; threadStats->discardsPurge = 0; threadStats->reroutes = 0; threadStats->abandoned = 0; threadStats->abandonedViaAlt = 0; } return threadStats; } void aggregatePerThreadStats(struct PerThreadStats*) const; public: QPID_BROKER_EXTERN static void writeSchema(std::string& schema); QPID_BROKER_EXTERN void mapEncodeValues(::qpid::types::Variant::Map& map, bool includeProperties=true, bool includeStatistics=true); QPID_BROKER_EXTERN void mapDecodeValues(const ::qpid::types::Variant::Map& map); QPID_BROKER_EXTERN void doMethod(std::string& methodName, const ::qpid::types::Variant::Map& inMap, ::qpid::types::Variant::Map& outMap, const std::string& userId); QPID_BROKER_EXTERN std::string getKey() const; QPID_BROKER_EXTERN uint32_t writePropertiesSize() const; QPID_BROKER_EXTERN void readProperties(const std::string& buf); QPID_BROKER_EXTERN void writeProperties(std::string& buf) const; QPID_BROKER_EXTERN void writeStatistics(std::string& buf, bool skipHeaders = false); QPID_BROKER_EXTERN void doMethod(std::string& methodName, const std::string& inBuf, std::string& outBuf, const std::string& userId); writeSchemaCall_t getWriteSchemaCall() { return writeSchema; } QPID_BROKER_EXTERN Broker( ::qpid::management::ManagementAgent* agent, ::qpid::management::Manageable* coreObject, ::qpid::management::Manageable* _parent, const std::string& _name); QPID_BROKER_EXTERN ~Broker(); QPID_BROKER_EXTERN static void registerSelf( ::qpid::management::ManagementAgent* agent); std::string& getPackageName() const { return packageName; } std::string& getClassName() const { return className; } uint8_t* getMd5Sum() const { return md5Sum; } // Method IDs QPID_BROKER_EXTERN static const uint32_t METHOD_ECHO = 1; QPID_BROKER_EXTERN static const uint32_t METHOD_CONNECT = 2; QPID_BROKER_EXTERN static const uint32_t METHOD_QUEUEMOVEMESSAGES = 3; QPID_BROKER_EXTERN static const uint32_t METHOD_SETLOGLEVEL = 4; QPID_BROKER_EXTERN static const uint32_t METHOD_GETLOGLEVEL = 5; QPID_BROKER_EXTERN static const uint32_t METHOD_GETTIMESTAMPCONFIG = 6; QPID_BROKER_EXTERN static const uint32_t METHOD_SETTIMESTAMPCONFIG = 7; QPID_BROKER_EXTERN static const uint32_t METHOD_CREATE = 8; QPID_BROKER_EXTERN static const uint32_t METHOD_DELETE = 9; QPID_BROKER_EXTERN static const uint32_t METHOD_QUERY = 10; // Accessor Methods inline void set_systemRef (const ::qpid::management::ObjectId& val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); systemRef = val; configChanged = true; } inline const ::qpid::management::ObjectId& get_systemRef() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return systemRef; } inline void set_port (uint16_t val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); port = val; configChanged = true; } inline uint16_t get_port() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return port; } inline void set_workerThreads (uint16_t val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); workerThreads = val; configChanged = true; } inline uint16_t get_workerThreads() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return workerThreads; } inline void set_connBacklog (uint16_t val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); connBacklog = val; configChanged = true; } inline uint16_t get_connBacklog() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return connBacklog; } inline void set_stagingThreshold (uint32_t val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); stagingThreshold = val; configChanged = true; } inline uint32_t get_stagingThreshold() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return stagingThreshold; } inline void set_mgmtPublish (bool val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); mgmtPublish = val; configChanged = true; } inline bool get_mgmtPublish() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return mgmtPublish; } inline void set_mgmtPubInterval (uint16_t val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); mgmtPubInterval = val; configChanged = true; } inline uint16_t get_mgmtPubInterval() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return mgmtPubInterval; } inline void set_version (const std::string& val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); version = val; configChanged = true; } inline const std::string& get_version() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return version; } inline void set_dataDir (const std::string& val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); dataDir = val; presenceMask[presenceByte_dataDir] |= presenceMask_dataDir; configChanged = true; } inline const std::string& get_dataDir() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return dataDir; } inline void clr_dataDir() { presenceMask[presenceByte_dataDir] &= ~presenceMask_dataDir; configChanged = true; } inline bool isSet_dataDir() { return (presenceMask[presenceByte_dataDir] & presenceMask_dataDir) != 0; } inline void set_uptime (uint64_t val) { ::qpid::management::Mutex::ScopedLock mutex(accessLock); uptime = val; instChanged = true; } inline uint64_t get_uptime() { ::qpid::management::Mutex::ScopedLock mutex(accessLock); return uptime; } inline void inc_queueCount (uint64_t by = 1) { getThreadStats()->queueCount += by; instChanged = true; } inline void dec_queueCount (uint64_t by = 1) { getThreadStats()->queueCount -= by; instChanged = true; } inline void inc_msgTotalEnqueues (uint64_t by = 1) { getThreadStats()->msgTotalEnqueues += by; instChanged = true; } inline void dec_msgTotalEnqueues (uint64_t by = 1) { getThreadStats()->msgTotalEnqueues -= by; instChanged = true; } inline void inc_msgTotalDequeues (uint64_t by = 1) { getThreadStats()->msgTotalDequeues += by; instChanged = true; } inline void dec_msgTotalDequeues (uint64_t by = 1) { getThreadStats()->msgTotalDequeues -= by; instChanged = true; } inline void inc_byteTotalEnqueues (uint64_t by = 1) { getThreadStats()->byteTotalEnqueues += by; instChanged = true; } inline void dec_byteTotalEnqueues (uint64_t by = 1) { getThreadStats()->byteTotalEnqueues -= by; instChanged = true; } inline void inc_byteTotalDequeues (uint64_t by = 1) { getThreadStats()->byteTotalDequeues += by; instChanged = true; } inline void dec_byteTotalDequeues (uint64_t by = 1) { getThreadStats()->byteTotalDequeues -= by; instChanged = true; } inline void inc_msgPersistEnqueues (uint64_t by = 1) { getThreadStats()->msgPersistEnqueues += by; instChanged = true; } inline void dec_msgPersistEnqueues (uint64_t by = 1) { getThreadStats()->msgPersistEnqueues -= by; instChanged = true; } inline void inc_msgPersistDequeues (uint64_t by = 1) { getThreadStats()->msgPersistDequeues += by; instChanged = true; } inline void dec_msgPersistDequeues (uint64_t by = 1) { getThreadStats()->msgPersistDequeues -= by; instChanged = true; } inline void inc_bytePersistEnqueues (uint64_t by = 1) { getThreadStats()->bytePersistEnqueues += by; instChanged = true; } inline void dec_bytePersistEnqueues (uint64_t by = 1) { getThreadStats()->bytePersistEnqueues -= by; instChanged = true; } inline void inc_bytePersistDequeues (uint64_t by = 1) { getThreadStats()->bytePersistDequeues += by; instChanged = true; } inline void dec_bytePersistDequeues (uint64_t by = 1) { getThreadStats()->bytePersistDequeues -= by; instChanged = true; } inline void inc_msgTxnEnqueues (uint64_t by = 1) { getThreadStats()->msgTxnEnqueues += by; instChanged = true; } inline void dec_msgTxnEnqueues (uint64_t by = 1) { getThreadStats()->msgTxnEnqueues -= by; instChanged = true; } inline void inc_msgTxnDequeues (uint64_t by = 1) { getThreadStats()->msgTxnDequeues += by; instChanged = true; } inline void dec_msgTxnDequeues (uint64_t by = 1) { getThreadStats()->msgTxnDequeues -= by; instChanged = true; } inline void inc_byteTxnEnqueues (uint64_t by = 1) { getThreadStats()->byteTxnEnqueues += by; instChanged = true; } inline void dec_byteTxnEnqueues (uint64_t by = 1) { getThreadStats()->byteTxnEnqueues -= by; instChanged = true; } inline void inc_byteTxnDequeues (uint64_t by = 1) { getThreadStats()->byteTxnDequeues += by; instChanged = true; } inline void dec_byteTxnDequeues (uint64_t by = 1) { getThreadStats()->byteTxnDequeues -= by; instChanged = true; } inline void inc_msgFtdEnqueues (uint64_t by = 1) { getThreadStats()->msgFtdEnqueues += by; instChanged = true; } inline void dec_msgFtdEnqueues (uint64_t by = 1) { getThreadStats()->msgFtdEnqueues -= by; instChanged = true; } inline void inc_msgFtdDequeues (uint64_t by = 1) { getThreadStats()->msgFtdDequeues += by; instChanged = true; } inline void dec_msgFtdDequeues (uint64_t by = 1) { getThreadStats()->msgFtdDequeues -= by; instChanged = true; } inline void inc_byteFtdEnqueues (uint64_t by = 1) { getThreadStats()->byteFtdEnqueues += by; instChanged = true; } inline void dec_byteFtdEnqueues (uint64_t by = 1) { getThreadStats()->byteFtdEnqueues -= by; instChanged = true; } inline void inc_byteFtdDequeues (uint64_t by = 1) { getThreadStats()->byteFtdDequeues += by; instChanged = true; } inline void dec_byteFtdDequeues (uint64_t by = 1) { getThreadStats()->byteFtdDequeues -= by; instChanged = true; } inline void inc_releases (uint64_t by = 1) { getThreadStats()->releases += by; instChanged = true; } inline void dec_releases (uint64_t by = 1) { getThreadStats()->releases -= by; instChanged = true; } inline void inc_acquires (uint64_t by = 1) { getThreadStats()->acquires += by; instChanged = true; } inline void dec_acquires (uint64_t by = 1) { getThreadStats()->acquires -= by; instChanged = true; } inline void inc_discardsNoRoute (uint64_t by = 1) { getThreadStats()->discardsNoRoute += by; instChanged = true; } inline void dec_discardsNoRoute (uint64_t by = 1) { getThreadStats()->discardsNoRoute -= by; instChanged = true; } inline void inc_discardsTtl (uint64_t by = 1) { getThreadStats()->discardsTtl += by; instChanged = true; } inline void dec_discardsTtl (uint64_t by = 1) { getThreadStats()->discardsTtl -= by; instChanged = true; } inline void inc_discardsRing (uint64_t by = 1) { getThreadStats()->discardsRing += by; instChanged = true; } inline void dec_discardsRing (uint64_t by = 1) { getThreadStats()->discardsRing -= by; instChanged = true; } inline void inc_discardsLvq (uint64_t by = 1) { getThreadStats()->discardsLvq += by; instChanged = true; } inline void dec_discardsLvq (uint64_t by = 1) { getThreadStats()->discardsLvq -= by; instChanged = true; } inline void inc_discardsOverflow (uint64_t by = 1) { getThreadStats()->discardsOverflow += by; instChanged = true; } inline void dec_discardsOverflow (uint64_t by = 1) { getThreadStats()->discardsOverflow -= by; instChanged = true; } inline void inc_discardsSubscriber (uint64_t by = 1) { getThreadStats()->discardsSubscriber += by; instChanged = true; } inline void dec_discardsSubscriber (uint64_t by = 1) { getThreadStats()->discardsSubscriber -= by; instChanged = true; } inline void inc_discardsPurge (uint64_t by = 1) { getThreadStats()->discardsPurge += by; instChanged = true; } inline void dec_discardsPurge (uint64_t by = 1) { getThreadStats()->discardsPurge -= by; instChanged = true; } inline void inc_reroutes (uint64_t by = 1) { getThreadStats()->reroutes += by; instChanged = true; } inline void dec_reroutes (uint64_t by = 1) { getThreadStats()->reroutes -= by; instChanged = true; } inline void inc_abandoned (uint64_t by = 1) { getThreadStats()->abandoned += by; instChanged = true; } inline void dec_abandoned (uint64_t by = 1) { getThreadStats()->abandoned -= by; instChanged = true; } inline void inc_abandonedViaAlt (uint64_t by = 1) { getThreadStats()->abandonedViaAlt += by; instChanged = true; } inline void dec_abandonedViaAlt (uint64_t by = 1) { getThreadStats()->abandonedViaAlt -= by; instChanged = true; } struct PerThreadStats* getStatistics() { return getThreadStats(); } void statisticsUpdated() { instChanged = true; } }; }}}}} #endif /*!_MANAGEMENT_BROKER_*/
34.676259
119
0.637085
db9810bb410d415d940741f6e58b4e75c3e9673b
2,140
c
C
src/parsing/utl/utl_fprutchn.c
Ashmouth/ProjetCA
2b199eaca5b2ec4cff5083e1fdf095c7cd650b39
[ "MIT" ]
2
2017-09-11T19:13:06.000Z
2020-01-20T09:05:40.000Z
src/parsing/utl/utl_fprutchn.c
Ashmouth/ProjetCA
2b199eaca5b2ec4cff5083e1fdf095c7cd650b39
[ "MIT" ]
null
null
null
src/parsing/utl/utl_fprutchn.c
Ashmouth/ProjetCA
2b199eaca5b2ec4cff5083e1fdf095c7cd650b39
[ "MIT" ]
3
2017-02-08T18:01:56.000Z
2018-10-04T21:30:08.000Z
/* ###--------------------------------------------------------------### */ /* file : utl_fprutchn.c */ /* date : Apr 19 2004 */ /* version : v200 */ /* authors : Pirouz Bazagan Sabet */ /* description : Utility function */ /* ###--------------------------------------------------------------### */ #include <stdlib.h> #include <stdio.h> #include UTL_H /* ###--------------------------------------------------------------### */ /* function : utl_fprutchn */ /* description : print a list of structures and return the number of */ /* characters printed */ /* called func. : none */ /* ###--------------------------------------------------------------### */ unsigned int utl_fprutchn (fp, format, pt_chn, func) FILE *fp ; char *format ; struct utchn *pt_chn ; char *(*func) (); { unsigned int idx = 0; char *str ; char *head ; char *midd ; char *tail ; char *m_hd ; char *m_tl ; char m_md ; if (utl_SplitFormat (format, &head, &midd, &tail) != 0) { idx += fprintf (fp, head); if (func != NULL) { while (pt_chn != NULL) { str = (*func ) (pt_chn->DATA ); idx += fprintf (fp, midd, str); pt_chn = pt_chn->NEXT; } } else { m_md = utl_SplitFlatFormat (midd, &m_hd, &m_tl); while (pt_chn != NULL) { idx += fprintf (fp, m_hd); if (m_md == 's') idx += fprintf (fp, "%s" ,(char *) pt_chn->DATA.VPNT); if (m_md == 'u') idx += fprintf (fp, "%u" , pt_chn->DATA.UINT); if (m_md == 'x') idx += fprintf (fp, "0x%.8x", pt_chn->DATA.UINT); if (m_md == 'd') idx += fprintf (fp, "%d" , pt_chn->DATA.SINT); if (m_md == 'c') idx += fprintf (fp, "%c" , pt_chn->DATA.CHAR); if (m_md == 'e') idx += fprintf (fp, "%e" , pt_chn->DATA.FLOT); idx += fprintf (fp, m_tl); pt_chn = pt_chn->NEXT; } } idx += fprintf (fp, tail); } return (idx); }
28.533333
80
0.399065
b964f43f3a966effeead709794a9b549095dd86a
351
h
C
bit_array.h
0xc6/drumbot
1682bd5c81748233dbd8a96e1a86b8f9eb024058
[ "MIT" ]
null
null
null
bit_array.h
0xc6/drumbot
1682bd5c81748233dbd8a96e1a86b8f9eb024058
[ "MIT" ]
null
null
null
bit_array.h
0xc6/drumbot
1682bd5c81748233dbd8a96e1a86b8f9eb024058
[ "MIT" ]
null
null
null
/* * bit_array.h * * Created on: 19.02.2013 * Author: cgries */ #ifndef BIT_ARRAY_H_ #define BIT_ARRAY_H_ extern void bit_arr_clear(uint8_t*, uint8_t); extern void bit_arr_set(uint8_t*, uint8_t, uint8_t); extern uint8_t bit_arr_get(const uint8_t*, const uint8_t); extern void bit_arr_toggle(uint8_t*, uint8_t); #endif /* BIT_ARRAY_H_ */
20.647059
58
0.732194
018b9e5f6e4f405e82b68be7661c1b5b4bbe2673
32,893
c
C
Firmware/Inverter_firmware/rtcs/source/ppp/pppfsm.c
gingazov2010/Indemsys-Frequency_Inverter
58ecce428a9cda0c2694979b16f98862bd3b0c65
[ "MIT" ]
30
2022-01-04T12:10:33.000Z
2022-03-30T09:03:48.000Z
Firmware/Inverter_firmware/rtcs/source/ppp/pppfsm.c
nelveroi/Frequency_Inverter
db9ab280ef096efce4c367bf71676b2da668031d
[ "MIT" ]
1
2022-01-05T08:44:01.000Z
2022-01-05T08:44:01.000Z
Firmware/Inverter_firmware/rtcs/source/ppp/pppfsm.c
nelveroi/Frequency_Inverter
db9ab280ef096efce4c367bf71676b2da668031d
[ "MIT" ]
9
2022-01-04T11:44:25.000Z
2022-03-15T04:03:05.000Z
/**HEADER******************************************************************** * * Copyright (c) 2008 Freescale Semiconductor; * All Rights Reserved * * Copyright (c) 2004-2008 Embedded Access Inc.; * All Rights Reserved * * Copyright (c) 1989-2008 ARC International; * All Rights Reserved * *************************************************************************** * * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * ************************************************************************** * * $FileName: pppfsm.c$ * $Version : 3.8.7.0$ * $Date : Aug-22-2012$ * * Comments: * * This file contains the implementation for the * {Link, IP} Control Protocol Finite State Machine. * *END************************************************************************/ /* ** fsm.c - {Link, IP} Control Protocol Finite State Machine. ** ** Copyright (c) 1989 Carnegie Mellon University. ** All rights reserved. ** ** Redistribution and use in source and binary forms are permitted ** provided that the above copyright notice and this paragraph are ** duplicated in all such forms and that any documentation, ** advertising materials, and other materials related to such ** distribution and use acknowledge that the software was developed ** by Carnegie Mellon University. The name of the ** University may not be used to endorse or promote products derived ** from this software without specific prior written permission. ** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR ** IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED ** WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ #include <ppp.h> #include "ppp_prv.h" static void PPPFSM_buildheader(PPPFSM_CFG_PTR, PCB_PTR, uchar, boolean, uint_32); static void PPPFSM_timeout(pointer, PCB_PTR, boolean); static void PPPFSM_recvconfreq(PPPFSM_CFG_PTR, _ppp_handle); static void PPPFSM_recvconfack(PPPFSM_CFG_PTR); static void PPPFSM_recvconfnak(PPPFSM_CFG_PTR, boolean(_CODE_PTR_)(PPPFSM_CFG_PTR)); static void PPPFSM_recvtermreq(PPPFSM_CFG_PTR); static void PPPFSM_recvtermack(PPPFSM_CFG_PTR); static void PPPFSM_recvcoderej(PPPFSM_CFG_PTR); static void PPPFSM_sendconfrep(PPPFSM_CFG_PTR, uint_32); static void PPPFSM_sendtermack(PPPFSM_CFG_PTR, boolean); static void PPPFSM_sendcoderej(PPPFSM_CFG_PTR); static void PPPFSM_sendconfreq(PPPFSM_CFG_PTR, PCB_PTR); static void PPPFSM_sendtermreq(PPPFSM_CFG_PTR, PCB_PTR); /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_init * Returned Value : error code * Comments : * Called by application. Initializes the Finite State Machine. * *END*-----------------------------------------------------------------*/ uint_32 PPPFSM_init ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ _ppp_handle handle, /* [IN] - the PPP state structure */ PPPFSM_CALL_PTR call_ptr, /* [IN] - Protocol-specific call table */ pointer param /* [IN] - Parameter for protocol-specific calls */ ) { /* Body */ #if RTCSCFG_ENABLE_IP4 PPP_memzero(fsm, sizeof(PPPFSM_CFG)); fsm->HANDLE = handle; fsm->CALL = call_ptr; fsm->PRIVATE = param; fsm->STATE = PPP_STATE_INITIAL; fsm->CURID = RTCS_rand() & 0xFF; /* Initialize the mutex */ if (PPP_mutex_init(&fsm->MUTEX)) { return RTCSERR_PPP_INIT_MUTEX_FAILED; } /* Endif */ return PPP_OK; #else return RTCSERR_IP_IS_DISABLED; #endif /* RTCSCFG_ENABLE_IP4 */ } /* Endbody */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_destroy * Returned Value : error code * Comments : * Called by application. Destroys the Finite State Machine. * Assumes the Finite State Machine has been initialized. * *END*-----------------------------------------------------------------*/ uint_32 PPPFSM_destroy ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ #if RTCSCFG_ENABLE_IP4 uint_32 error = PPP_OK; PPP_mutex_lock(&fsm->MUTEX); if (fsm->STATE > PPP_STATE_CLOSED) { error = RTCSERR_PPP_FSM_ACTIVE; } else { fsm->STATE = PPP_STATE_INITIAL; } /* Endif */ PPP_mutex_unlock(&fsm->MUTEX); if (!error) { PPP_mutex_destroy(&fsm->MUTEX); } /* Endif */ return error; #else return RTCSERR_IP_IS_DISABLED; #endif /* RTCSCFG_ENABLE_IP4 */ } /* Endbody */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_lowerup * Returned Value : void * Comments : * Lower layer is up. * *END*-----------------------------------------------------------------*/ void PPPFSM_lowerup ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ #if RTCSCFG_ENABLE_IP4 PPP_mutex_lock(&fsm->MUTEX); switch(fsm->STATE) { case PPP_STATE_INITIAL: fsm->STATE = PPP_STATE_CLOSED; break; case PPP_STATE_STARTING: if (fsm->OPTIONS & PPP_OPT_SILENT) { fsm->STATE = PPP_STATE_STOPPED; } else { PPPFSM_sendconfreq(fsm, NULL); fsm->STATE = PPP_STATE_REQ_SENT; }/* Endif */ break; } /* Endswitch */ PPP_mutex_unlock(&fsm->MUTEX); #endif /* RTCSCFG_ENABLE_IP4 */ } /* Endbody */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_lowerdown * Returned Value : void * Comments : * Cancel all timeouts and inform upper layers. Lower layer is * down. * *END*-----------------------------------------------------------------*/ void PPPFSM_lowerdown ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ #if RTCSCFG_ENABLE_IP4 PPP_CFG_PTR ppp_ptr = fsm->HANDLE; PPP_mutex_lock(&fsm->MUTEX); switch(fsm->STATE) { case PPP_STATE_CLOSED: fsm->STATE = PPP_STATE_INITIAL; break; case PPP_STATE_STOPPED: fsm->STATE = PPP_STATE_STARTING; break; case PPP_STATE_CLOSING: fsm->STATE = PPP_STATE_INITIAL; PPP_send_stop(ppp_ptr, fsm->CALL->PROTOCOL); break; case PPP_STATE_STOPPING: case PPP_STATE_REQ_SENT: case PPP_STATE_ACK_RCVD: case PPP_STATE_ACK_SENT: fsm->STATE = PPP_STATE_STARTING; PPP_send_stop(ppp_ptr, fsm->CALL->PROTOCOL); break; case PPP_STATE_OPENED: if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ fsm->STATE = PPP_STATE_STARTING; break; } /* Endswitch */ PPP_mutex_unlock(&fsm->MUTEX); #endif /* RTCSCFG_ENABLE_IP4 */ } /* Endbody */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_open * Returned Value : void * Comments : * Called by application. Begin negotiating the link. * *END*-----------------------------------------------------------------*/ void PPPFSM_open ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ uint_32 options /* [IN] - Startup options */ ) { /* Body */ #if RTCSCFG_ENABLE_IP4 PPP_mutex_lock(&fsm->MUTEX); fsm->OPTIONS = options; switch (fsm->STATE) { case PPP_STATE_INITIAL: fsm->STATE = PPP_STATE_STARTING; break; case PPP_STATE_CLOSED: if (options & PPP_OPT_SILENT) { fsm->STATE = PPP_STATE_STOPPED; } else { /* Send an initial Configure-Request */ PPPFSM_sendconfreq(fsm, NULL); fsm->STATE = PPP_STATE_REQ_SENT; } /* Endif */ break; case PPP_STATE_CLOSING: fsm->STATE = PPP_STATE_STOPPING; /* fall through */ case PPP_STATE_STOPPING: case PPP_STATE_STOPPED: if (options & PPP_OPT_RESTART) { PPPFSM_sendconfreq(fsm, NULL); fsm->STATE = PPP_STATE_REQ_SENT; } /* Endif */ break; case PPP_STATE_OPENED: if (options & PPP_OPT_RESTART) { if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ PPPFSM_sendconfreq(fsm, NULL); fsm->STATE = PPP_STATE_REQ_SENT; } /* Endif */ break; } /* Endswitch */ PPP_mutex_unlock(&fsm->MUTEX); #endif /* RTCSCFG_ENABLE_IP4 */ } /* Endbody */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_close * Returned Value : void * Comments : * Called by application. Begin closing the link. * *END*-----------------------------------------------------------------*/ void PPPFSM_close ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ #if RTCSCFG_ENABLE_IP4 PPP_mutex_lock(&fsm->MUTEX); switch (fsm->STATE) { case PPP_STATE_STARTING: fsm->STATE = PPP_STATE_INITIAL; break; case PPP_STATE_STOPPED: fsm->STATE = PPP_STATE_CLOSED; break; case PPP_STATE_STOPPING: fsm->STATE = PPP_STATE_CLOSING; break; case PPP_STATE_OPENED: if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ /* fall through */ case PPP_STATE_REQ_SENT: case PPP_STATE_ACK_RCVD: case PPP_STATE_ACK_SENT: PPPFSM_sendtermreq(fsm, NULL); fsm->STATE = PPP_STATE_CLOSING; break; } /* Endswitch */ PPP_mutex_unlock(&fsm->MUTEX); #endif /* RTCSCFG_ENABLE_IP4 */ } /* Endbody */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_timeout * Returned Value : void * Comments : * Called by PPP_tx_task. Timeout expired. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_timeout ( pointer fsm_ptr, /* [IN/OUT] - State Machine */ PCB_PTR packet, /* [IN] - expired packet */ boolean hard /* [IN] - TRUE if this is a hard timeout (TO- event) */ ) { /* Body */ PPPFSM_CFG_PTR fsm = fsm_ptr; PPP_mutex_lock(&fsm->MUTEX); switch (fsm->STATE) { case PPP_STATE_CLOSING: case PPP_STATE_STOPPING: if (hard) { /* We've waited for an ack long enough */ fsm->STATE -= 2; /* Stopping/Closing -> Stopped/Closed */ } /* Endif */ break; case PPP_STATE_REQ_SENT: case PPP_STATE_ACK_RCVD: case PPP_STATE_ACK_SENT: if (hard) { fsm->STATE = PPP_STATE_STOPPED; } else if (fsm->STATE == PPP_STATE_ACK_RCVD) { fsm->STATE = PPP_STATE_REQ_SENT; } /* Endif */ break; } /* Endswitch */ PPP_mutex_unlock(&fsm->MUTEX); } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_input * Returned Value : void * Comments : * Called by PPP_rx_task. Parses a xCP packet. * Side effects : * Consumes (sends or frees) the packet. * *END*-----------------------------------------------------------------*/ void PPPFSM_input ( PCB_PTR pcb, /* [IN] - xCP packet */ pointer fsm_data /* [IN/OUT] - State Machine */ ) { /* Body */ #if RTCSCFG_ENABLE_IP4 PPPFSM_CFG_PTR fsm = fsm_data; uint_32_ptr stat; uchar_ptr inp; uint_16 pcblen, len; /* ** Parse header (code, id and length). ** If packet is too short, drop it. */ stat = NULL; fsm->PACKET = pcb; inp = pcb->FRAG[0].FRAGMENT + 2; /* skip the protocol field */ pcblen = pcb->FRAG[0].LENGTH - 2; PPP_mutex_lock(&fsm->MUTEX); if (pcblen < CP_HDR_LEN) { stat = &fsm->ST_CP_SHORT; } else { fsm->CODE = *inp++; fsm->ID = *inp++; len = *inp++ << 8; len += *inp++; if (len < CP_HDR_LEN) { stat = &fsm->ST_CP_SHORT; } else if (len > pcblen) { stat = &fsm->ST_CP_SHORT; } else if (fsm->STATE < PPP_STATE_CLOSED) { stat = &fsm->ST_CP_DOWN; } /* Endif */ } /* Endif */ if (stat) { PPP_mutex_unlock(&fsm->MUTEX); ++*stat; PCB_free(pcb); return; } /* Endif */ fsm->LENGTH = len - CP_HDR_LEN; fsm->DATA = inp; /* ** Action depends on code. */ switch (fsm->CODE) { case CP_CODE_CONF_REQ: PPPFSM_recvconfreq(fsm, fsm->HANDLE); break; case CP_CODE_CONF_ACK: PPPFSM_recvconfack(fsm); break; case CP_CODE_CONF_NAK: PPPFSM_recvconfnak(fsm, fsm->CALL->recvnak); break; case CP_CODE_CONF_REJ: PPPFSM_recvconfnak(fsm, fsm->CALL->recvrej); break; case CP_CODE_TERM_REQ: PPPFSM_recvtermreq(fsm); break; case CP_CODE_TERM_ACK: PPPFSM_recvtermack(fsm); break; case CP_CODE_CODE_REJ: PPPFSM_recvcoderej(fsm); break; default: if (!fsm->CALL->recvcode || !fsm->CALL->recvcode(fsm)) { PPPFSM_sendcoderej(fsm); } /* Endif */ break; } /* Endswitch */ PPP_mutex_unlock(&fsm->MUTEX); #else PCB_free(pcb); #endif /* RTCSCFG_ENABLE_IP4 */ } /* Endbody */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_buildheader * Returned Value : void * Comments : * Called by PPPFSM_send*. Builds the CP header before sending * a packet. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_buildheader ( PPPFSM_CFG_PTR fsm, /* [IN] - State Machine */ PCB_PTR pcb, /* [IN] - packet */ uchar code, /* [IN] - packet code, 0 means use fsm->CODE */ boolean keepid, /* [IN] - packet id, FALSE mean use fsm->ID */ uint_32 size /* [IN] - length of packet data */ ) { /* Body */ uchar_ptr outp = pcb->FRAG[0].FRAGMENT + 2; if (!code) code = fsm->CODE; *outp++ = code; if (!keepid) { *outp = fsm->CURID; fsm->CURID = (fsm->CURID + 1) & 0xFF; } /* Endif */ outp++; size += CP_HDR_LEN; *outp++ = (size >> 8) & 0xFF; *outp++ = size & 0xFF; pcb->FRAG[0].LENGTH = size + 2; } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_recvconfreq * Returned Value : void * Comments : * Called by PPPFSM_Input. Parses a Configure-Request packet. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends or frees) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_recvconfreq ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ _ppp_handle handle /* [IN] - the PPP state structure */ ) { /* Body */ PPP_CFG_PTR ppp_ptr = handle; uint_32 size; switch (fsm->STATE) { case PPP_STATE_CLOSED: PPPFSM_sendtermack(fsm, FALSE); return; case PPP_STATE_CLOSING: case PPP_STATE_STOPPING: PCB_free(fsm->PACKET); return; case PPP_STATE_OPENED: /* Go down and restart negotiation */ if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ PPPFSM_sendconfreq(fsm, NULL); fsm->STATE = PPP_STATE_REQ_SENT; break; case PPP_STATE_STOPPED: /* Negotiation started by our peer */ PPPFSM_sendconfreq(fsm, NULL); fsm->STATE = PPP_STATE_REQ_SENT; break; } /* Endswitch */ /* ** Pass the requested configuration options ** to protocol-specific code for checking. ** ** !! Packet consumed here !! */ if (fsm->CALL->recvreq) { /* Check CI */ size = fsm->CALL->recvreq(fsm, fsm->NAKS >= _PPP_MAX_CONF_NAKS); PPPFSM_buildheader(fsm, fsm->PACKET, 0, TRUE, size); PPP_send_one(ppp_ptr, fsm->CALL->PROTOCOL, fsm->PACKET); } else if (fsm->LENGTH) { PPPFSM_sendconfrep(fsm, CP_CODE_CONF_REJ); } else { PPPFSM_sendconfrep(fsm, CP_CODE_CONF_ACK); } /* Endif */ if (fsm->CODE == CP_CODE_CONF_ACK) { if (fsm->STATE == PPP_STATE_ACK_RCVD) { /* Inform upper layers */ if (fsm->CALL->linkup) { if (!fsm->CALL->linkup(fsm)) { PPPFSM_sendtermreq(fsm, NULL); fsm->STATE = PPP_STATE_CLOSING; return; } /* Endif */ } /* Endif */ fsm->STATE = PPP_STATE_OPENED; PPP_send_stop(ppp_ptr, fsm->CALL->PROTOCOL); } else { fsm->STATE = PPP_STATE_ACK_SENT; } /* Endif */ fsm->NAKS = 0; } else { /* We sent a NAK or a REJ */ if (fsm->STATE != PPP_STATE_ACK_RCVD) { fsm->STATE = PPP_STATE_REQ_SENT; } /* Endif */ if (fsm->CODE == CP_CODE_CONF_NAK ) { ++fsm->NAKS; } /* Endif */ } /* Endif */ } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_recvconfack * Returned Value : void * Comments : * Called by PPPFSM_input. Parses a Configure-Ack packet. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends or frees) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_recvconfack ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ /* Verify the packet */ if (fsm->ID != fsm->REQID) { PCB_free(fsm->PACKET); return; } else if (fsm->CALL->recvack) { if (!fsm->CALL->recvack(fsm)) { ++fsm->ST_CP_BAD_ACK; PCB_free(fsm->PACKET); return; } /* Endif */ } else if (fsm->LENGTH) { ++fsm->ST_CP_BAD_ACK; PCB_free(fsm->PACKET); return; } /* Endif */ /* ** !! Packet consumed here !! */ switch (fsm->STATE) { case PPP_STATE_CLOSED: case PPP_STATE_STOPPED: PPPFSM_sendtermack(fsm, FALSE); break; case PPP_STATE_REQ_SENT: /* Restart retransmissions */ fsm->STATE = PPP_STATE_ACK_RCVD; PCB_free(fsm->PACKET); PPP_send_restart(fsm->HANDLE, fsm->CALL->PROTOCOL); break; case PPP_STATE_ACK_RCVD: PPPFSM_sendconfreq(fsm, fsm->PACKET); fsm->STATE = PPP_STATE_REQ_SENT; break; case PPP_STATE_ACK_SENT: /* Inform upper layers */ if (fsm->CALL->linkup) { if (!fsm->CALL->linkup(fsm)) { PPPFSM_sendtermreq(fsm, fsm->PACKET); fsm->STATE = PPP_STATE_CLOSING; return; } /* Endif */ } /* Endif */ fsm->STATE = PPP_STATE_OPENED; PCB_free(fsm->PACKET); PPP_send_stop(fsm->HANDLE, fsm->CALL->PROTOCOL); break; case PPP_STATE_OPENED: /* Restart negotiation */ if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ PPPFSM_sendconfreq(fsm, fsm->PACKET); fsm->STATE = PPP_STATE_REQ_SENT; break; default: PCB_free(fsm->PACKET); break; } /* Endswitch */ } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_recvconfnak * Returned Value : void * Comments : * Called by PPPFSM_input. Parses a Configure-Nak or * Configure-Reject packet. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends or frees) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_recvconfnak ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ boolean (_CODE_PTR_ call)(PPPFSM_CFG_PTR) /* [IN] - Protocol-specific callback for this packet */ ) { /* Body */ /* Verify the packet */ if (fsm->ID != fsm->REQID) { PCB_free(fsm->PACKET); return; } else if (!call || !call(fsm)) { if (fsm->CODE == CP_CODE_CONF_NAK) { ++fsm->ST_CP_BAD_NAK; } else { ++fsm->ST_CP_BAD_REJ; } /* Endif */ PCB_free(fsm->PACKET); return; } /* Endif */ /* ** !! Packet consumed here !! */ switch (fsm->STATE) { case PPP_STATE_CLOSED: case PPP_STATE_STOPPED: PPPFSM_sendtermack(fsm, FALSE); break; case PPP_STATE_REQ_SENT: case PPP_STATE_ACK_SENT: /* They didn't agree -- try another request */ PPPFSM_sendconfreq(fsm, fsm->PACKET); break; case PPP_STATE_ACK_RCVD: PPPFSM_sendconfreq(fsm, fsm->PACKET); fsm->STATE = PPP_STATE_REQ_SENT; break; case PPP_STATE_OPENED: /* Restart negotiation */ if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ PPPFSM_sendconfreq(fsm, fsm->PACKET); fsm->STATE = PPP_STATE_REQ_SENT; break; default: PCB_free(fsm->PACKET); break; } /* Endswitch */ } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_recvtermreq * Returned Value : void * Comments : * Called by PPPFSM_input. Parses a Terminate-Request packet. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_recvtermreq ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ /* ** !! Packet consumed here !! */ switch (fsm->STATE) { case PPP_STATE_ACK_RCVD: case PPP_STATE_ACK_SENT: fsm->STATE = PPP_STATE_REQ_SENT; PPPFSM_sendtermack(fsm, FALSE); break; case PPP_STATE_OPENED: /* Restart negotiation */ if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ PPPFSM_sendtermack(fsm, TRUE); fsm->STATE = PPP_STATE_STOPPING; break; default: PPPFSM_sendtermack(fsm, FALSE); break; } /* Endswitch */ } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_recvtermack * Returned Value : void * Comments : * Called by PPPFSM_input. Parses a Terminate-Ack packet. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends or frees) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_recvtermack ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ switch (fsm->STATE) { case PPP_STATE_CLOSING: case PPP_STATE_STOPPING: PCB_free(fsm->PACKET); PPP_send_stop(fsm->HANDLE, fsm->CALL->PROTOCOL); fsm->STATE -= 2; /* Stopping/Closing -> Stopped/Closed */ break; case PPP_STATE_ACK_RCVD: PCB_free(fsm->PACKET); fsm->STATE = PPP_STATE_REQ_SENT; break; case PPP_STATE_OPENED: if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ PPPFSM_sendconfreq(fsm, fsm->PACKET); fsm->STATE = PPP_STATE_REQ_SENT; break; default: PCB_free(fsm->PACKET); break; } /* Endswitch */ } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_recvcoderej * Returned Value : void * Comments : * Called by PPPFSM_input. Parses a Code-Reject packet. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends or frees) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_recvcoderej ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ if (fsm->LENGTH < CP_HDR_LEN) { ++fsm->ST_CP_SHORT; PCB_free(fsm->PACKET); return; } /* Endif */ /* ** Check if Code-Reject is catastrophic ** ** !! Packet consumed here !! */ if (!fsm->CALL->testcode || !fsm->CALL->testcode(fsm)) { if (fsm->STATE == PPP_STATE_ACK_RCVD) { fsm->STATE = PPP_STATE_REQ_SENT; } /* Endif */ PCB_free(fsm->PACKET); } else { switch (fsm->STATE) { case PPP_STATE_CLOSING: PCB_free(fsm->PACKET); PPP_send_stop(fsm->HANDLE, fsm->CALL->PROTOCOL); fsm->STATE = PPP_STATE_CLOSED; break; case PPP_STATE_STOPPING: case PPP_STATE_REQ_SENT: case PPP_STATE_ACK_RCVD: case PPP_STATE_ACK_SENT: PCB_free(fsm->PACKET); PPP_send_stop(fsm->HANDLE, fsm->CALL->PROTOCOL); fsm->STATE = PPP_STATE_STOPPED; break; case PPP_STATE_OPENED: if (fsm->CALL->linkdown) { fsm->CALL->linkdown(fsm); } /* Endif */ PPPFSM_sendtermreq(fsm, fsm->PACKET); fsm->STATE = PPP_STATE_STOPPING; break; default: PCB_free(fsm->PACKET); break; } /* Endswitch */ } /* Endif */ } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_sendconfrep * Returned Value : void * Comments : * Called by PPPFSM_input. Builds a 'code' packet from * the packet in fsm, and sends it. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends) it. * Sets fsm->CODE to 'code'. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_sendconfrep ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ uint_32 code /* [IN] - packet code for reply */ ) { /* Body */ fsm->CODE = fsm->PACKET->FRAG[0].FRAGMENT[2] = code; PPP_send_one(fsm->HANDLE, fsm->CALL->PROTOCOL, fsm->PACKET); } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_sendtermack * Returned Value : void * Comments : * Called by PPPFSM_input. Builds a Terminate-Ack packet from * the packet in fsm, and sends it. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_sendtermack ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ boolean delay /* [IN] - whether or not to Zero-Restart-Counter */ ) { /* Body */ PPPFSM_buildheader(fsm, fsm->PACKET, CP_CODE_TERM_ACK, TRUE, 0); if (delay) { PPP_send_rexmit(fsm->HANDLE, fsm->CALL->PROTOCOL, fsm->PACKET, 1, PPPFSM_timeout, fsm); } else { PPP_send_one(fsm->HANDLE, fsm->CALL->PROTOCOL, fsm->PACKET); } /* Endif */ } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_sendcoderej * Returned Value : void * Comments : * Called by PPPFSM_input. Builds a Code-Reject packet from * the packet in fsm, and sends it. * Side effects : * Assumes fsm->PACKET is valid, and consumes (sends) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_sendcoderej ( PPPFSM_CFG_PTR fsm /* [IN/OUT] - State Machine */ ) { /* Body */ PPP_CFG_PTR ppp_ptr = fsm->HANDLE; uchar_ptr packet, src, dst; uint_16 length = fsm->PACKET->FRAG[0].LENGTH - 2; uint_16 size = ppp_ptr->SEND_OPTIONS->MRU - CP_HDR_LEN; /* Truncate the packet if necessary, so as not to exceed the MTU */ if (length > size) { length = size; } /* Endif */ /* Make room for a Code-Reject header */ size = length; /* Copy the received packet to the data portion of the Code-Reject */ packet = fsm->PACKET->FRAG[0].FRAGMENT + 2; src = packet + length; dst = src + CP_HDR_LEN; while (length--) *--dst = *--src; /* Build a Code-Reject header */ PPPFSM_buildheader(fsm, fsm->PACKET, CP_CODE_CODE_REJ, FALSE, size); PPP_send_one(ppp_ptr, fsm->CALL->PROTOCOL, fsm->PACKET); } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_sendconfreq * Returned Value : void * Comments : * Called by PPPFSM_input. Builds a Configure-Request packet * and sends it. * Side effects : * Starts the retransmission timer with the new * Configure-Request packet. * If 'packet' is non-NULL, assumes it's valid, and consumes * (sends) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_sendconfreq ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ PCB_PTR packet /* [IN] - free packet */ ) { /* Body */ PPP_CFG_PTR ppp_ptr = fsm->HANDLE; uchar_ptr outp; uint_32 size; if (fsm->STATE <= PPP_STATE_STOPPING || fsm->STATE >= PPP_STATE_OPENED) { /* Not currently negotiating -- reset options */ if (fsm->CALL->resetreq) { fsm->CALL->resetreq(fsm); } /* Endif */ fsm->NAKS = 0; } /* Endif */ /* Stop the retransmission timer if necessary */ if (fsm->STATE > PPP_STATE_STOPPED && fsm->STATE < PPP_STATE_OPENED) { PPP_send_stop(ppp_ptr, fsm->CALL->PROTOCOL); } /* Endif */ /* Allocate a packet if necessary */ if (!packet) { packet = PPP_pcballoc(fsm->CALL->PROTOCOL, ppp_ptr->SEND_OPTIONS->MRU); if (!packet) { ++fsm->ST_CP_NOBUFS; /* Nonfatal error */ return; } /* Endif */ } /* Endif */ /* Build the request packet */ outp = packet->FRAG[0].FRAGMENT + 2; size = packet->FRAG[0].LENGTH - 2 - CP_HDR_LEN; if (fsm->CALL->buildreq) { size = fsm->CALL->buildreq(fsm, outp + CP_HDR_LEN, size); } /* Endif */ fsm->REQID = fsm->CURID; PPPFSM_buildheader(fsm, packet, CP_CODE_CONF_REQ, FALSE, size); /* Send the request */ PPP_send_rexmit(ppp_ptr, fsm->CALL->PROTOCOL, packet, _PPP_MAX_CONF_RETRIES, PPPFSM_timeout, fsm); } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /*FUNCTION*------------------------------------------------------------- * * Function Name : PPPFSM_sendtermreq * Returned Value : void * Comments : * Called by PPPFSM_input. Builds a Terminate-Request packet from * the packet in fsm, and sends it. * Side effects : * Starts the retransmission timer with the Terminate-Request * packet. * If 'packet' is non-NULL, assumes it's valid, and consumes * (sends) it. * *END*-----------------------------------------------------------------*/ #if RTCSCFG_ENABLE_IP4 static void PPPFSM_sendtermreq ( PPPFSM_CFG_PTR fsm, /* [IN/OUT] - State Machine */ PCB_PTR packet /* [IN] - free packet */ ) { /* Body */ PPP_CFG_PTR ppp_ptr = fsm->HANDLE; /* Stop the retransmission timer if necessary */ if (fsm->STATE > PPP_STATE_STOPPED && fsm->STATE < PPP_STATE_OPENED) { PPP_send_stop(ppp_ptr, fsm->CALL->PROTOCOL); } /* Endif */ /* Allocate a packet if necessary */ if (!packet) { packet = PPP_pcballoc(fsm->CALL->PROTOCOL, CP_HDR_LEN); if (!packet) { ++fsm->ST_CP_NOBUFS; /* Nonfatal error */ return; } /* Endif */ } /* Endif */ PPPFSM_buildheader(fsm, packet, CP_CODE_TERM_REQ, FALSE, 0); PPP_send_rexmit(ppp_ptr, fsm->CALL->PROTOCOL, packet, _PPP_MAX_TERM_RETRIES, PPPFSM_timeout, fsm); } /* Endbody */ #endif /* RTCSCFG_ENABLE_IP4 */ /* EOF */
26.022943
84
0.549995
a8e1b9f440aa7cd129488c3368d1ef26594fe255
9,353
c
C
lib/external/wolfssl/wolfcrypt/src/port/st/stsafe.c
Koneeee1/ms-tpm-20-ref
d99419bd30a4dad7ae5bfad3c1c0d5962c188913
[ "BSD-2-Clause" ]
1
2018-10-23T06:30:14.000Z
2018-10-23T06:30:14.000Z
third_party/wolfssl/wolfcrypt/src/port/st/stsafe.c
lovewitty/miniblink49
c8cb0b50636915d748235eea95a57e24805dc43e
[ "Apache-2.0" ]
null
null
null
third_party/wolfssl/wolfcrypt/src/port/st/stsafe.c
lovewitty/miniblink49
c8cb0b50636915d748235eea95a57e24805dc43e
[ "Apache-2.0" ]
null
null
null
/* stsafe.c * * Copyright (C) 2006-2018 wolfSSL Inc. * * This file is part of wolfSSL. * * wolfSSL is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * wolfSSL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ #include <wolfssl/wolfcrypt/port/st/stsafe.h> #include <wolfssl/wolfcrypt/logging.h> #ifdef WOLFSSL_STSAFEA100 int SSL_STSAFE_LoadDeviceCertificate(byte** pRawCertificate, word32* pRawCertificateLen) { int err; if (pRawCertificate == NULL || pRawCertificateLen == NULL) { return BAD_FUNC_ARG; } #ifdef USE_STSAFE_VERBOSE WOLFSSL_MSG("SSL_STSAFE_LoadDeviceCertificate"); #endif /* Try reading device certificate from ST-SAFE Zone 0 */ err = stsafe_interface_read_device_certificate_raw( pRawCertificate, pRawCertificateLen); if (err == 0) { #if 0 /* example for loading into WOLFSSL_CTX */ err = wolfSSL_CTX_use_certificate_buffer(ctx, *pRawCertificate, *pRawCertificateLen, SSL_FILETYPE_ASN1); if (err != WOLFSSL_SUCCESS) { /* failed */ } /* can free now */ XFREE(*pRawCertificate, NULL, DYNAMIC_TEMP_BUFFER); *pRawCertificate = NULL; #endif } return err; } #ifdef HAVE_PK_CALLBACKS /** * \brief Key Gen Callback (used by TLS server) */ int SSL_STSAFE_CreateKeyCb(WOLFSSL* ssl, ecc_key* key, word32 keySz, int ecc_curve, void* ctx) { int err; byte pubKeyRaw[STSAFE_MAX_PUBKEY_RAW_LEN]; StSafeA_KeySlotNumber slot; StSafeA_CurveId curve_id; (void)ssl; (void)ctx; #ifdef USE_STSAFE_VERBOSE WOLFSSL_MSG("CreateKeyCb: STSAFE"); #endif /* get curve */ curve_id = stsafe_get_ecc_curve_id(ecc_curve); /* generate new ephemeral key on device */ err = stsafe_interface_create_key(&slot, curve_id, (uint8_t*)&pubKeyRaw[0]); if (err != 0) { return err; } /* load generated public key into key, used by wolfSSL */ err = wc_ecc_import_unsigned(key, &pubKeyRaw[0], &pubKeyRaw[keySz], NULL, ecc_curve); return err; } /** * \brief Verify Peer Cert Callback. */ int SSL_STSAFE_VerifyPeerCertCb(WOLFSSL* ssl, const unsigned char* sig, unsigned int sigSz, const unsigned char* hash, unsigned int hashSz, const unsigned char* keyDer, unsigned int keySz, int* result, void* ctx) { int err; byte sigRS[STSAFE_MAX_SIG_LEN]; byte *r, *s; word32 r_len = STSAFE_MAX_SIG_LEN/2, s_len = STSAFE_MAX_SIG_LEN/2; byte pubKeyX[STSAFE_MAX_PUBKEY_RAW_LEN/2]; byte pubKeyY[STSAFE_MAX_PUBKEY_RAW_LEN/2]; word32 pubKeyX_len = sizeof(pubKeyX); word32 pubKeyY_len = sizeof(pubKeyY); ecc_key key; word32 inOutIdx = 0; StSafeA_CurveId curve_id; int ecc_curve; (void)ssl; (void)ctx; #ifdef USE_STSAFE_VERBOSE WOLFSSL_MSG("VerifyPeerCertCB: STSAFE"); #endif err = wc_ecc_init(&key); if (err != 0) { return err; } /* Decode the public key */ err = wc_EccPublicKeyDecode(keyDer, &inOutIdx, &key, keySz); if (err == 0) { /* Extract Raw X and Y coordinates of the public key */ err = wc_ecc_export_public_raw(&key, pubKeyX, &pubKeyX_len, pubKeyY, &pubKeyY_len); } if (err == 0) { int key_sz; /* determine curve */ ecc_curve = key.dp->id; curve_id = stsafe_get_ecc_curve_id(ecc_curve); key_sz = stsafe_get_key_size(curve_id); /* Extract R and S from signature */ XMEMSET(sigRS, 0, sizeof(sigRS)); r = &sigRS[0]; s = &sigRS[key_sz]; err = wc_ecc_sig_to_rs(sig, sigSz, r, &r_len, s, &s_len); (void)r_len; (void)s_len; } if (err == 0) { /* Verify signature */ err = stsafe_interface_verify(curve_id, (uint8_t*)hash, sigRS, pubKeyX, pubKeyY, result); } wc_ecc_free(&key); return err; } /** * \brief Sign Certificate Callback. */ int SSL_STSAFE_SignCertificateCb(WOLFSSL* ssl, const byte* in, word32 inSz, byte* out, word32* outSz, const byte* key, word32 keySz, void* ctx) { int err; byte digest[STSAFE_MAX_KEY_LEN]; byte sigRS[STSAFE_MAX_SIG_LEN]; byte *r, *s; StSafeA_CurveId curve_id; int key_sz; (void)ssl; (void)ctx; #ifdef USE_STSAFE_VERBOSE WOLFSSL_MSG("SignCertificateCb: STSAFE"); #endif curve_id = stsafe_get_curve_mode(); key_sz = stsafe_get_key_size(curve_id); /* Build input digest */ if (inSz > key_sz) inSz = key_sz; XMEMSET(&digest[0], 0, sizeof(digest)); XMEMCPY(&digest[key_sz - inSz], in, inSz); /* Sign using slot 0: Result is R then S */ /* Sign will always use the curve type in slot 0 (the TLS curve needs to match) */ XMEMSET(sigRS, 0, sizeof(sigRS)); err = stsafe_interface_sign(STSAFE_A_SLOT_0, curve_id, digest, sigRS); if (err != 0) { return err; } /* Convert R and S to signature */ r = &sigRS[0]; s = &sigRS[key_sz]; err = wc_ecc_rs_raw_to_sig((const byte*)r, key_sz, (const byte*)s, key_sz, out, outSz); if (err !=0) { #ifdef USE_STSAFE_VERBOSE WOLFSSL_MSG("Error converting RS to Signature"); #endif } return err; } /** * \brief Create pre master secret using peer's public key and self private key. */ int SSL_STSAFE_SharedSecretCb(WOLFSSL* ssl, ecc_key* otherKey, unsigned char* pubKeyDer, unsigned int* pubKeySz, unsigned char* out, unsigned int* outlen, int side, void* ctx) { int err; byte otherKeyX[STSAFE_MAX_KEY_LEN]; byte otherKeyY[STSAFE_MAX_KEY_LEN]; word32 otherKeyX_len = sizeof(otherKeyX); word32 otherKeyY_len = sizeof(otherKeyY); byte pubKeyRaw[STSAFE_MAX_PUBKEY_RAW_LEN]; StSafeA_KeySlotNumber slot; StSafeA_CurveId curve_id; ecc_key tmpKey; int ecc_curve; int key_sz; (void)ssl; (void)ctx; #ifdef USE_STSAFE_VERBOSE WOLFSSL_MSG("SharedSecretCb: STSAFE"); #endif err = wc_ecc_init(&tmpKey); if (err != 0) { return err; } /* set curve */ ecc_curve = otherKey->dp->id; curve_id = stsafe_get_ecc_curve_id(ecc_curve); key_sz = stsafe_get_key_size(curve_id); /* for client: create and export public key */ if (side == WOLFSSL_CLIENT_END) { /* Export otherKey raw X and Y */ err = wc_ecc_export_public_raw(otherKey, &otherKeyX[0], (word32*)&otherKeyX_len, &otherKeyY[0], (word32*)&otherKeyY_len); if (err != 0) { return err; } err = stsafe_interface_create_key(&slot, curve_id, (uint8_t*)&pubKeyRaw[0]); if (err != 0) { return err; } /* convert raw unsigned public key to X.963 format for TLS */ err = wc_ecc_init(&tmpKey); if (err == 0) { err = wc_ecc_import_unsigned(&tmpKey, &pubKeyRaw[0], &pubKeyRaw[key_sz], NULL, ecc_curve); if (err == 0) { err = wc_ecc_export_x963(&tmpKey, pubKeyDer, pubKeySz); } wc_ecc_free(&tmpKey); } } /* for server: import public key */ else if (side == WOLFSSL_SERVER_END) { /* import peer's key and export as raw unsigned for hardware */ err = wc_ecc_import_x963_ex(pubKeyDer, *pubKeySz, &tmpKey, ecc_curve); if (err == 0) { err = wc_ecc_export_public_raw(&tmpKey, otherKeyX, &otherKeyX_len, otherKeyY, &otherKeyY_len); } } else { err = BAD_FUNC_ARG; } wc_ecc_free(&tmpKey); if (err != 0) { return err; } /* Compute shared secret */ err = stsafe_interface_shared_secret(curve_id, &otherKeyX[0], &otherKeyY[0], out, (int32_t*)outlen); return err; } int SSL_STSAFE_SetupPkCallbacks(WOLFSSL_CTX* ctx) { wolfSSL_CTX_SetEccKeyGenCb(ctx, SSL_STSAFE_CreateKeyCb); wolfSSL_CTX_SetEccSignCb(ctx, SSL_STSAFE_SignCertificateCb); wolfSSL_CTX_SetEccVerifyCb(ctx, SSL_STSAFE_VerifyPeerCertCb); wolfSSL_CTX_SetEccSharedSecretCb(ctx, SSL_STSAFE_SharedSecretCb); wolfSSL_CTX_SetDevId(ctx, 0); /* enables wolfCrypt `wc_ecc_*` ST-Safe use */ return 0; } int SSL_STSAFE_SetupPkCallbackCtx(WOLFSSL* ssl, void* user_ctx) { wolfSSL_SetEccKeyGenCtx(ssl, user_ctx); wolfSSL_SetEccSharedSecretCtx(ssl, user_ctx); wolfSSL_SetEccSignCtx(ssl, user_ctx); wolfSSL_SetEccVerifyCtx(ssl, user_ctx); return 0; } #endif /* HAVE_PK_CALLBACKS */ #endif /* WOLFSSL_STSAFEA100 */
28.428571
86
0.630065
016c5a315745b113f8d70cba19ec51e2a411cd9c
108
h
C
usr/src/sys/arch/mvme88k/include/signal.h
sizeofvoid/ifconfigd
bdff4b2cec6d572c1450cb44f32c0bdab1b49e5f
[ "BSD-2-Clause" ]
2
2020-04-15T13:39:01.000Z
2020-08-28T01:27:00.000Z
usr/src/sys/arch/mvme88k/include/signal.h
sizeofvoid/ifconfigd
bdff4b2cec6d572c1450cb44f32c0bdab1b49e5f
[ "BSD-2-Clause" ]
null
null
null
usr/src/sys/arch/mvme88k/include/signal.h
sizeofvoid/ifconfigd
bdff4b2cec6d572c1450cb44f32c0bdab1b49e5f
[ "BSD-2-Clause" ]
1
2020-08-28T01:25:41.000Z
2020-08-28T01:25:41.000Z
/* $OpenBSD: signal.h,v 1.14 2004/04/26 14:31:11 miod Exp $ */ /* public domain */ #include <m88k/signal.h>
27
62
0.638889
f3eebae5d2131980af0fee31c7f0128677e3dc48
1,083
h
C
source/EventManager.h
Verch/mirror_sync
9b85ad9e0d52dea8cad7c720947c866f69d68243
[ "Apache-2.0" ]
null
null
null
source/EventManager.h
Verch/mirror_sync
9b85ad9e0d52dea8cad7c720947c866f69d68243
[ "Apache-2.0" ]
null
null
null
source/EventManager.h
Verch/mirror_sync
9b85ad9e0d52dea8cad7c720947c866f69d68243
[ "Apache-2.0" ]
null
null
null
#pragma once #include <vector> #include <string> #include "MyUtiles.h" class c_Vehicle; class cPed; enum eTypeGameObject { VEHICLE = 1, PLAYER = 2 }; class c_Event { public: c_Event(int iType, int AttachToID, float x, float y, float z); public: int m_iType; int m_AttachToID; float m_fPosX; float m_fPosY; float m_fPosZ; public: void update(float x, float y, float z) { m_fPosX = x; m_fPosY = y; m_fPosZ = z; } }; //------------------------------------------------------------------- class c_EventManager { public: c_EventManager() { Log("[c_EventManager::c_EventManager] Create!"); } void Event_push_back(c_Event GameEvent); int getCountEvent(); void DebugprintMatrixEvent(); void printEvent(std::vector<c_Event> Event, int index); void addEventVehiclePossitionsControl(c_Vehicle vehilce); void addEventPlayerActorPossitionsControl(cPed Ped); bool updateEventPlayerPossitions(cPed ped); private: std::vector<c_Event> m_Event; }; //-----------------------------------------------------------------------
15.041667
73
0.609418
fac0fd9c846cfc232b15a1f735676b0568235767
371
h
C
src/libPac/semaphore.h
D3fau4/Pac_Utils
ce7ca81d8c22c1df8c0ac5eb7ee5d2b448627460
[ "MIT" ]
13
2017-10-24T17:59:21.000Z
2022-03-19T12:47:42.000Z
src/libPac/semaphore.h
D3fau4/Pac_Utils
ce7ca81d8c22c1df8c0ac5eb7ee5d2b448627460
[ "MIT" ]
null
null
null
src/libPac/semaphore.h
D3fau4/Pac_Utils
ce7ca81d8c22c1df8c0ac5eb7ee5d2b448627460
[ "MIT" ]
3
2020-06-14T00:25:44.000Z
2022-03-19T12:47:34.000Z
#pragma once #include <mutex> #include <condition_variable> namespace lib_pac { class semaphore { std::mutex mutex; std::condition_variable cond; uint32_t count; public: explicit semaphore(uint32_t max); void notify(); void wait(); }; class critical_section { semaphore &sem; public: critical_section(semaphore& s); ~critical_section(); }; }
13.740741
35
0.703504
435f4a39d0e5a64db52fbf984e10032458ba269d
1,550
c
C
PartThree/col13/q13_2a.c
sujimodern/Programming-Pearls
354c6d4e3b7149b1b0fdac442610b7d3776f1131
[ "MIT" ]
null
null
null
PartThree/col13/q13_2a.c
sujimodern/Programming-Pearls
354c6d4e3b7149b1b0fdac442610b7d3776f1131
[ "MIT" ]
null
null
null
PartThree/col13/q13_2a.c
sujimodern/Programming-Pearls
354c6d4e3b7149b1b0fdac442610b7d3776f1131
[ "MIT" ]
null
null
null
#include <stdio.h> #include <stdlib.h> enum { room_for_sentinel = 1 }; typedef struct intset intset; struct intset { int* _set; size_t maxelements; size_t maxval; size_t size; }; intset* intset_new(size_t maxelements, size_t maxval) { intset* is = malloc(sizeof *is); *is = (intset){ ._set = malloc((maxelements + room_for_sentinel) * sizeof(int)), .maxelements = maxelements, .maxval = maxval, .size = 0, }; is->_set[0] = maxval; return is; } void intset_delete(intset is[static 1]) { free(is[0]._set); free(is); } size_t intset_size(intset is[static 1]) { return is[0].size; } void intset_insert(intset is[static 1], int t) { int i, j; for (i = 0; is[0]._set[i] < t; ++i); if (is[0]._set[i] == t) { return; } for (j = is[0].size; j >= i; --j) { is[0]._set[j+1] = is[0]._set[j]; } is[0]._set[i] = t; is[0].size += 1; } void intset_report(intset is[static 1], size_t len, int v[len]) { if (is[0].size > len) { return; } for (size_t i = 0; i < is[0].size; ++i) { v[i] = is[0]._set[i]; } } int main(int argc, char* argv[argc+1]) { size_t maxelem = 5; size_t maxval = 100; int* v = malloc(maxelem * sizeof *v); intset* is = intset_new(maxelem, maxval); intset_insert(is, 7); intset_insert(is, 3); intset_insert(is, 15); intset_insert(is, 15); intset_insert(is, 15); intset_insert(is, 8); intset_report(is, maxelem, v); for (size_t i = 0; i < intset_size(is); ++i) { printf("%lu: %d\n", i, v[i]); } intset_delete(is); return EXIT_SUCCESS; }
20.945946
68
0.6
1ac10be89a877a038edeb5362a438ebffa44c4b6
798
h
C
WizardWar/TimerSyncService.h
seanhess/wizardwar
43cfa4a9fddc29f17838ebd32247c9b21c4bae3d
[ "MIT" ]
101
2015-01-02T07:54:32.000Z
2021-12-05T15:44:53.000Z
WizardWar/TimerSyncService.h
ycaihua/wizardwar
43cfa4a9fddc29f17838ebd32247c9b21c4bae3d
[ "MIT" ]
null
null
null
WizardWar/TimerSyncService.h
ycaihua/wizardwar
43cfa4a9fddc29f17838ebd32247c9b21c4bae3d
[ "MIT" ]
44
2015-01-09T08:41:04.000Z
2021-01-15T03:08:55.000Z
// // TimerSyncService.h // WizardWar // // Created by Sean Hess on 5/29/13. // Copyright (c) 2013 The LAB. All rights reserved. // // NOTE: There is no way you should EVER connect to more than one match at a time. // make this global to error check for you // you MUST remember to call disconnect! #import <Foundation/Foundation.h> #import "Wizard.h" #import "GameTimerService.h" #import <Firebase/Firebase.h> @protocol TimerSyncDelegate -(void)gameIsSynchronized; @end @interface TimerSyncService : NSObject @property (nonatomic, weak) id<TimerSyncDelegate> delegate; @property (nonatomic, strong) Firebase * root; +(TimerSyncService*)shared; -(void)syncTimerWithMatchId:(NSString*)matchId player:(Wizard*)player isHost:(BOOL)isHost timer:(GameTimerService*)timer; -(void)disconnect; @end
28.5
121
0.753133
d185e25692d36148dd06f503d3288d27114f74e1
6,248
h
C
Base/PLCore/include/PLCore/Base/ClassReal.h
ktotheoz/pixellight
43a661e762034054b47766d7e38d94baf22d2038
[ "MIT" ]
83
2015-01-08T15:06:14.000Z
2021-07-20T17:07:00.000Z
Base/PLCore/include/PLCore/Base/ClassReal.h
PixelLightFoundation/pixellight
43a661e762034054b47766d7e38d94baf22d2038
[ "MIT" ]
27
2019-06-18T06:46:07.000Z
2020-02-02T11:11:28.000Z
Base/PLCore/include/PLCore/Base/ClassReal.h
naetherm/PixelLight
d7666f5b49020334cbb5debbee11030f34cced56
[ "MIT" ]
40
2015-02-25T18:24:34.000Z
2021-03-06T09:01:48.000Z
/*********************************************************\ * File: ClassReal.h * * * Copyright (C) 2002-2013 The PixelLight Team (http://www.pixellight.org/) * * This file is part of PixelLight. * * 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 without limitation the rights to use, copy, modify, merge, publish, * 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. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * 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. \*********************************************************/ #ifndef __PLCORE_CLASS_REAL_H__ #define __PLCORE_CLASS_REAL_H__ #pragma once //[-------------------------------------------------------] //[ Includes ] //[-------------------------------------------------------] #include "PLCore/Base/ClassImpl.h" //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] namespace PLCore { //[-------------------------------------------------------] //[ Classes ] //[-------------------------------------------------------] /** * @brief * Real 'Class' implementation * * @note * - The class instance is created and destroyed automatically by the RTTI system (see "pl_class"-macro) */ class ClassReal : public ClassImpl { //[-------------------------------------------------------] //[ Friends ] //[-------------------------------------------------------] friend class MemberDesc; friend class ClassManager; //[-------------------------------------------------------] //[ Protected virtual ClassImpl functions ] //[-------------------------------------------------------] protected: PLCORE_API virtual bool IsDummy() const override; PLCORE_API virtual void InitClass() const override; PLCORE_API virtual void DeInitClass() const override; PLCORE_API virtual const List<VarDesc*> &GetAttributes() const override; PLCORE_API virtual const VarDesc *GetAttribute(const String &sName) const override; PLCORE_API virtual const List<FuncDesc*> &GetMethods() const override; PLCORE_API virtual const FuncDesc *GetMethod(const String &sName) const override; PLCORE_API virtual const List<EventDesc*> &GetSignals() const override; PLCORE_API virtual const EventDesc *GetSignal(const String &sName) const override; PLCORE_API virtual const List<EventHandlerDesc*> &GetSlots() const override; PLCORE_API virtual const EventHandlerDesc *GetSlot(const String &sName) const override; PLCORE_API virtual bool HasConstructor() const override; PLCORE_API virtual bool HasDefaultConstructor() const override; PLCORE_API virtual const List<ConstructorDesc*> &GetConstructors() const override; PLCORE_API virtual const ConstructorDesc *GetConstructor(const String &sName) const override; PLCORE_API virtual Object *Create() const override; PLCORE_API virtual Object *Create(const DynParams &cParams) const override; PLCORE_API virtual Object *Create(const String &sName, const DynParams &cParams) const override; PLCORE_API virtual Object *Create(const String &sName, const String &sParams) const override; //[-------------------------------------------------------] //[ Protected functions ] //[-------------------------------------------------------] protected: /** * @brief * Constructor * * @param[in] nModuleID * ID of owner module * @param[in] sName * Name * @param[in] sDescription * Description * @param[in] sNamespace * Namespace * @param[in] sBaseClass * Base class */ PLCORE_API ClassReal(uint32 nModuleID, const String &sName, const String &sDescription, const String &sNamespace, const String &sBaseClass); /** * @brief * Destructor */ PLCORE_API virtual ~ClassReal(); //[-------------------------------------------------------] //[ Protected functions ] //[-------------------------------------------------------] protected: /** * @brief * Add member * * @param[in] pMemberDesc * Member descriptor */ PLCORE_API void AddMember(MemberDesc *pMemberDesc); //[-------------------------------------------------------] //[ Protected data ] //[-------------------------------------------------------] protected: // Own data (does not include data from base classes) List<MemberDesc*> m_lstOwnMembers; /**< List of members */ // Member lists (also including the members from base classes) mutable HashMap<String, MemberDesc*> m_mapMembers; /**< Hash map of names -> members */ mutable List<VarDesc*> m_lstAttributes; /**< List of attributes */ mutable List<FuncDesc*> m_lstMethods; /**< List of methods */ mutable List<EventDesc*> m_lstSignals; /**< List of signals */ mutable List<EventHandlerDesc*> m_lstSlots; /**< List of slots */ mutable List<ConstructorDesc*> m_lstConstructors; /**< List of constructors */ }; //[-------------------------------------------------------] //[ Namespace ] //[-------------------------------------------------------] } // PLCore #endif // __PLCORE_CLASS_REAL_H__
40.836601
142
0.544654
d0fb3f2f3b04e62c6d48f960ac4371e7c8ffbc5b
2,566
c
C
codebefore/2016.7.22.2.c
1980744819/ACM-code
a697242bc963e682e552e655e3d78527e044e854
[ "Apache-2.0" ]
null
null
null
codebefore/2016.7.22.2.c
1980744819/ACM-code
a697242bc963e682e552e655e3d78527e044e854
[ "Apache-2.0" ]
null
null
null
codebefore/2016.7.22.2.c
1980744819/ACM-code
a697242bc963e682e552e655e3d78527e044e854
[ "Apache-2.0" ]
null
null
null
#include<stdio.h> #include<string.h> #include<stdlib.h> #include<malloc.h> #include<math.h> char dictionary[10005][20]; char check_words[55][20]; int lend[10005]; int lenc[55]; int m,n; void check(int num){ int flag=0; int i,j; printf("%s",check_words[num]); for(i=0;i<m;i++){ if(strcmp(check_words[num],dictionary[i])==0){ printf(" is correct\n"); return; } } printf(":"); int sum; int time=0; int k; char ch[20]; int a; int f; for(i=0;i<m;i++){ if(lend[i]==lenc[num]-1){ for(j=0;j<lenc[num];j++){ f=0; for(k=0;k<j;k++){ ch[k]=check_words[num][k]; } for(k=j+1;k<lenc[num];k++){ ch[k-1]=check_words[num][k]; } for(k=0;k<lenc[num]-1;k++){ if(ch[k]!=dictionary[i][k]){ f=1; break; } } if(!f){ printf(" %s",dictionary[i]); break; } } } } for(i=0;i<m;i++){ if(lenc[num]==lend[i]){ sum=0; for(j=0;j<lenc[num];j++){ if(check_words[num][j]!=dictionary[i][j]){ sum++; } } if(sum==1){ printf(" %s",dictionary[i]); } } } for(i=0;i<m;i++){ if(lenc[num]==lend[i]-1){ for(j=0;j<lend[i];j++){ f=0; for(k=0;k<j;k++){ ch[k]=dictionary[i][k]; } for(k=j+1;k<lend[i];k++){ ch[k-1]=dictionary[i][k]; } for(k=0;k<lend[i]-1;k++){ if(ch[k]!=check_words[num][k]){ f=1; break; } } if(!f){ printf(" %s",dictionary[i]); break; } } } } printf("\n"); } int main(){ int i,j; char ch[20]; m=0; while(scanf("%s",dictionary[m])){ lend[m]=strlen(dictionary[m]); if(dictionary[m][0]=='#') break; m++; } n=0; while(scanf("%s",check_words[n])){ lenc[n]=strlen(check_words[n]); if(check_words[n][0]=='#') break; n++; } for(i=0;i<n;i++){ check(i); } return 0; }
22.508772
58
0.344505
191d1ddd22ed7b2835c810e3dce5cd4f51ac0450
7,763
h
C
contrib/epee/include/net/http_protocol_handler.h
mihailafix/test
98921747cf5dde0bebe1eec20bff43bb53ccff83
[ "BSD-3-Clause" ]
1
2018-08-10T11:58:02.000Z
2018-08-10T11:58:02.000Z
contrib/epee/include/net/http_protocol_handler.h
mihailafix/test
98921747cf5dde0bebe1eec20bff43bb53ccff83
[ "BSD-3-Clause" ]
null
null
null
contrib/epee/include/net/http_protocol_handler.h
mihailafix/test
98921747cf5dde0bebe1eec20bff43bb53ccff83
[ "BSD-3-Clause" ]
5
2018-06-26T11:19:29.000Z
2019-11-24T19:50:38.000Z
// Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // * Neither the name of the Andrey N. Sabelnikov nor the // names of its contributors may be used to endorse or promote products // derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // #ifndef _HTTP_SERVER_H_ #define _HTTP_SERVER_H_ #include <boost/optional/optional.hpp> #include <string> #include "net_utils_base.h" #include "to_nonconst_iterator.h" #include "http_auth.h" #include "http_base.h" #undef KOSON_DEFAULT_LOG_CATEGORY #define KOSON_DEFAULT_LOG_CATEGORY "net.http" namespace epee { namespace net_utils { namespace http { /************************************************************************/ /* */ /************************************************************************/ struct http_server_config { std::string m_folder; std::vector<std::string> m_access_control_origins; boost::optional<login> m_user; critical_section m_lock; }; /************************************************************************/ /* */ /************************************************************************/ template<class t_connection_context = net_utils::connection_context_base> class simple_http_connection_handler { public: typedef t_connection_context connection_context;//t_connection_context net_utils::connection_context_base connection_context; typedef http_server_config config_type; simple_http_connection_handler(i_service_endpoint* psnd_hndlr, config_type& config, t_connection_context& conn_context); virtual ~simple_http_connection_handler(){} bool release_protocol() { return true; } virtual bool thread_init() { return true; } virtual bool thread_deinit() { return true; } bool after_init_connection() { return true; } virtual bool handle_recv(const void* ptr, size_t cb); virtual bool handle_request(const http::http_request_info& query_info, http_response_info& response); private: enum machine_state{ http_state_retriving_comand_line, http_state_retriving_header, http_state_retriving_body, http_state_connection_close, http_state_error }; enum body_transfer_type{ http_body_transfer_chunked, http_body_transfer_measure,//mean "Content-Length" valid http_body_transfer_chunked_instead_measure, http_body_transfer_connection_close, http_body_transfer_multipart, http_body_transfer_undefined }; bool handle_buff_in(std::string& buf); bool analize_cached_request_header_and_invoke_state(size_t pos); bool handle_invoke_query_line(); bool parse_cached_header(http_header_info& body_info, const std::string& m_cache_to_process, size_t pos); std::string::size_type match_end_of_header(const std::string& buf); bool get_len_from_content_lenght(const std::string& str, size_t& len); bool handle_retriving_query_body(); bool handle_query_measure(); bool set_ready_state(); bool slash_to_back_slash(std::string& str); std::string get_file_mime_tipe(const std::string& path); std::string get_response_header(const http_response_info& response); //major function inline bool handle_request_and_send_response(const http::http_request_info& query_info); std::string get_not_found_response_body(const std::string& URI); std::string m_root_path; std::string m_cache; machine_state m_state; body_transfer_type m_body_transfer_type; bool m_is_stop_handling; http::http_request_info m_query_info; size_t m_len_summary, m_len_remain; config_type& m_config; bool m_want_close; size_t m_newlines; protected: i_service_endpoint* m_psnd_hndlr; t_connection_context& m_conn_context; }; template<class t_connection_context> struct i_http_server_handler { virtual ~i_http_server_handler(){} virtual bool handle_http_request(const http_request_info& query_info, http_response_info& response, t_connection_context& m_conn_context) = 0; virtual bool init_server_thread(){return true;} virtual bool deinit_server_thread(){return true;} }; template<class t_connection_context> struct custum_handler_config: public http_server_config { i_http_server_handler<t_connection_context>* m_phandler; std::function<void(size_t, uint8_t*)> rng; }; /************************************************************************/ /* */ /************************************************************************/ template<class t_connection_context = net_utils::connection_context_base> class http_custom_handler: public simple_http_connection_handler<t_connection_context> { public: typedef custum_handler_config<t_connection_context> config_type; http_custom_handler(i_service_endpoint* psnd_hndlr, config_type& config, t_connection_context& conn_context) : simple_http_connection_handler<t_connection_context>(psnd_hndlr, config, conn_context), m_config(config), m_auth(m_config.m_user ? http_server_auth{*m_config.m_user, config.rng} : http_server_auth{}) {} inline bool handle_request(const http_request_info& query_info, http_response_info& response) { CHECK_AND_ASSERT_MES(m_config.m_phandler, false, "m_config.m_phandler is NULL!!!!"); const auto auth_response = m_auth.get_response(query_info); if (auth_response) { response = std::move(*auth_response); return true; } //fill with default values response.m_mime_tipe = "text/plain"; response.m_response_code = 200; response.m_response_comment = "OK"; response.m_body.clear(); return m_config.m_phandler->handle_http_request(query_info, response, this->m_conn_context); } virtual bool thread_init() { return m_config.m_phandler->init_server_thread();; } virtual bool thread_deinit() { return m_config.m_phandler->deinit_server_thread(); } void handle_qued_callback() {} bool after_init_connection() { return true; } private: //simple_http_connection_handler::config_type m_stub_config; config_type& m_config; http_server_auth m_auth; }; } } } #include "http_protocol_handler.inl" #endif //_HTTP_SERVER_H_
33.606061
128
0.69316
659fa844504e7f1fa9f7122fd6d7a5e55f3da66e
186
h
C
zxdTestCore/test2.h
zxd2997910686/zxdTestLib
f6aed124a4a83c3870350e8b63f10e6b0e19f7fd
[ "MIT" ]
null
null
null
zxdTestCore/test2.h
zxd2997910686/zxdTestLib
f6aed124a4a83c3870350e8b63f10e6b0e19f7fd
[ "MIT" ]
null
null
null
zxdTestCore/test2.h
zxd2997910686/zxdTestLib
f6aed124a4a83c3870350e8b63f10e6b0e19f7fd
[ "MIT" ]
null
null
null
// // test2.h // zxdTestLib // // Created by zxd on 16/11/12. // Copyright © 2016年 zxd. All rights reserved. // #import <Foundation/Foundation.h> @interface test2 : NSObject @end
13.285714
47
0.655914
d66ec3dbf395c87f5bcbe77cba04a4fbc7ddb43a
81,530
h
C
sstmac/replacements/fixIntrinsics.h
jjwilke/sst-macro
d5139c0e2e6c0055bd2ef6dc9ac565a6ec1fd4d9
[ "BSD-Source-Code" ]
null
null
null
sstmac/replacements/fixIntrinsics.h
jjwilke/sst-macro
d5139c0e2e6c0055bd2ef6dc9ac565a6ec1fd4d9
[ "BSD-Source-Code" ]
null
null
null
sstmac/replacements/fixIntrinsics.h
jjwilke/sst-macro
d5139c0e2e6c0055bd2ef6dc9ac565a6ec1fd4d9
[ "BSD-Source-Code" ]
null
null
null
#ifndef sstmac_replacements_fix_intrinsics_h #define sstmac_replacements_fix_intrinsics_h #define __is_aggregate(x) true #define __has_unique_object_representations(x) true /** functions that are static in gcc and not static in clang change their names temporarily to get clang to not freak out */ #define __rdtsc __redirect_rdtsc #define _mm_getcsr __redirect_mm_getcsr #define _mm_sfence __redirect_mm_sfence #define _mm_setcsr __redirect__mm_setcsr #define _mm_clflush __redirect_mm_clflush #define _mm_lfence __redirect_mm_lfence #define _mm_pause __redirect_mm_pause #define _mm_mfence __redirect_mm_mfence /** these are void return intrinsics that clang doesn't know */ #define __builtin_ia32_storeups(...) #define __builtin_ia32_movntps(...) #define __builtin_ia32_storeupd256(...) #define __builtin_ia32_storeups256(...) #define __builtin_ia32_storedqu256(...) #define __builtin_ia32_movntdq256(...) #define __builtin_ia32_movntpd256(...) #define __builtin_ia32_movntps256(...) /** these are unary operator intrinsics that return the same type thing just return the input argument to satisfy clang during src-2-src */ #define __builtin_ia32_cvtps2pd(x) x #define __builtin_ia32_cvtdq2pd(x) x #define __builtin_ia32_pmovzxbw128(x) x #define __builtin_ia32_pmovzxbd128(x) x #define __builtin_ia32_pmovzxbq128(x) x #define __builtin_ia32_pmovzxwq128(x) x #define __builtin_ia32_pmovzxdq128(x) x #define __builtin_ia32_pmovzxwd128(x) x #define __builtin_ia32_cvtdq2pd256(x) get256() #define __builtin_ia32_cvtps2pd256(x) get256d() #define __builtin_ia32_pmovsxbw256(x) get256i() #define __builtin_ia32_pmovsxbd256(x) get256i() #define __builtin_ia32_pmovsxbq256(x) get256i() #define __builtin_ia32_pmovsxwq256(x) get256i() #define __builtin_ia32_pmovsxwd256(x) get256i() #define __builtin_ia32_pmovsxdq256(x) get256i() #define __builtin_ia32_pmovzxbw256(x) get256i() #define __builtin_ia32_pmovzxbd256(x) get256i() #define __builtin_ia32_pmovzxbq256(x) get256i() #define __builtin_ia32_pmovzxwd256(x) get256i() #define __builtin_ia32_pmovzxwq256(x) get256i() #define __builtin_ia32_pmovzxdq256(x) get256i() #define __builtin_ia32_pandd512_mask(...) get512i() #define __builtin_ia32_pandq512_mask(...) get512i() #define __builtin_ia32_pandnd512_mask(...) get512i() #define __builtin_ia32_pandnq512_mask(...) get512i() #define __builtin_ia32_pord512_mask(...) get512i() #define __builtin_ia32_porq512_mask(...) get512i() #define __builtin_ia32_pxord512_mask(...) get512i() #define __builtin_ia32_pxorq512_mask(...) get512i() #define __builtin_ia32_paddq512_mask(...) get512i() #define __builtin_ia32_psubq512_mask(...) get512i() #define __builtin_ia32_paddd512_mask(...) get512i() #define __builtin_ia32_psubd512_mask(...) get512i() #define __builtin_ia32_loaddqudi512_mask(...) get512i() #define __builtin_ia32_maxss_round(x,...) x #define __builtin_ia32_maxsd_round(x,...) x #define __builtin_ia32_minss_round(x,...) x #define __builtin_ia32_minsd_round(x,...) x #define __builtin_ia32_pmuldq512_mask(x,...) x #define __builtin_ia32_pmuludq512_mask(x,...) x #define __builtin_ia32_rsqrt14ss(x,...) x #define __builtin_ia32_pmulld512_mask(x,...) x #define __builtin_ia32_rsqrt14sd(x,...) x #define __builtin_ia32_rcp14ss(x,...) x #define __builtin_ia32_addss_round(x,...) x #define __builtin_ia32_subss_round(x,...) x #define __builtin_ia32_mulss_round(x,...) x #define __builtin_ia32_rcp14sd(x,...) x #define __builtin_ia32_addsd_round_mask(x,...) x #define __builtin_ia32_subsd_round(x,...) x #define __builtin_ia32_divsd_round(x,...) x #define __builtin_ia32_blendmpd_512_mask(x,...) x #define __builtin_ia32_blendmps_512_mask(x,...) x #define __builtin_ia32_blendmq_512_mask(x,...) x #define __builtin_ia32_cvtdq2pd512_mask(...) get512d() #define __builtin_ia32_addsd_round(x,...) x #define __builtin_ia32_divss_round(x,...) x #define __builtin_ia32_mulsd_round(x,...) x #define __builtin_ia32_blendmd_512_mask(x,...) x #define __builtin_ia32_cvtudq2pd512_mask(...) get512d() #define __builtin_ia32_loaddqusi512_mask(...) get512i() #define __builtin_ia32_loadups512_mask(...) get512i() #define __builtin_ia32_loadupd512_mask(...) get512d() #define __builtin_ia32_storeupd512_mask(...) #define __builtin_ia32_storedqudi512_mask(...) #define __builtin_ia32_storedqusi512_mask(...) #define __builtin_ia32_storeups512_mask(...) #define __builtin_ia32_paddd256_mask(x,...) x #define __builtin_ia32_paddq256_mask(x,...) x #define __builtin_ia32_psubd256_mask(x,...) x #define __builtin_ia32_psubq256_mask(x,...) x #define __builtin_ia32_paddd128_mask(x,...) x #define __builtin_ia32_paddq128_mask(x,...) x #define __builtin_ia32_psubd128_mask(x,...) x #define __builtin_ia32_psubq128_mask(x,...) x #define __builtin_ia32_pmuldq128_mask(x,...) x #define __builtin_ia32_pmuludq128_mask(x,...) x #define __builtin_ia32_pmuldq256_mask(x,...) x #define __builtin_ia32_pmuludq256_mask(x,...) x #define __builtin_ia32_pmulld256_mask(x,...) x #define __builtin_ia32_pmulld128_mask(x,...) x #define __builtin_ia32_pandd256_mask(x,...) x #define __builtin_ia32_pandnd256_mask(x,...) x #define __builtin_ia32_pandnd128_mask(x,...) x #define __builtin_ia32_pord256_mask(x,...) x #define __builtin_ia32_pord128_mask(x,...) x #define __builtin_ia32_pandd128_mask(x,...) x #define __builtin_ia32_pxord256_mask(x,...) x #define __builtin_ia32_pxord128_mask(x,...) x #define __builtin_ia32_pandq256_mask(x,...) x #define __builtin_ia32_pandq128_mask(x,...) x #define __builtin_ia32_pandnq256_mask(x,...) x #define __builtin_ia32_pandnq128_mask(x,...) x #define __builtin_ia32_porq256_mask(x,...) x #define __builtin_ia32_porq128_mask(x,...) x #define __builtin_ia32_pxorq256_mask(x,...) x #define __builtin_ia32_addpd128_mask(x,...) x #define __builtin_ia32_addps256_mask(x,...) x #define __builtin_ia32_pxorq128_mask(x,...) x #define __builtin_ia32_addps128_mask(x,...) x #define __builtin_ia32_addpd256_mask(x,...) x #define __builtin_ia32_blendmd_128_mask(x,...) x #define __builtin_ia32_blendmd_256_mask(x,...) x #define __builtin_ia32_blendmps_256_mask(x,...) x #define __builtin_ia32_blendmq_256_mask(x,...) x #define __builtin_ia32_cvtdq2pd128_mask(x,...) x #define __builtin_ia32_cvtdq2pd256_mask(x,...) get256d() #define __builtin_ia32_blendmpd_128_mask(x,...) x #define __builtin_ia32_blendmpd_256_mask(x,...) x #define __builtin_ia32_blendmq_128_mask(x,...) x #define __builtin_ia32_cvtudq2pd128_mask(x,...) x #define __builtin_ia32_divpd256_mask(x,...) x #define __builtin_ia32_blendmps_128_mask(x,...) x #define __builtin_ia32_cvtudq2pd256_mask(...) get256d() #define __builtin_ia32_divpd_mask(x,...) x #define __builtin_ia32_divps_mask(x,...) x #define __builtin_ia32_divps256_mask(x,...) x #define __builtin_ia32_maxpd_mask(x,...) x #define __builtin_ia32_maxps_mask(x,...) x #define __builtin_ia32_maxps256_mask(x,...) x #define __builtin_ia32_maxpd256_mask(x,...) x #define __builtin_ia32_minpd256_mask(x,...) x #define __builtin_ia32_minpd_mask(x,...) x #define __builtin_ia32_minps_mask(x,...) x #define __builtin_ia32_minps256_mask(x,...) x #define __builtin_ia32_mulpd_mask(x,...) x #define __builtin_ia32_mulpd256_mask(x,...) x #define __builtin_ia32_mulps_mask(x,...) x #define __builtin_ia32_mulps256_mask(x,...) x #define __builtin_ia32_pabsd128_mask(x,...) x #define __builtin_ia32_pabsd256_mask(x,...) x #define __builtin_ia32_pmaxsd128_mask(x,...) x #define __builtin_ia32_pmaxsd256_mask(x,...) x #define __builtin_ia32_pmaxud128_mask(x,...) x #define __builtin_ia32_pminsd128_mask(x,...) x #define __builtin_ia32_pmaxud256_mask(x,...) x #define __builtin_ia32_pminsd256_mask(x,...) x #define __builtin_ia32_pminud128_mask(x,...) x #define __builtin_ia32_pminud256_mask(x,...) x #define __builtin_ia32_sqrtpd128_mask(x,...) x #define __builtin_ia32_sqrtpd256_mask(x,...) x #define __builtin_ia32_sqrtps128_mask(x,...) x #define __builtin_ia32_subpd128_mask(x,...) x #define __builtin_ia32_subps128_mask(x,...) x #define __builtin_ia32_subps256_mask(x,...) x #define __builtin_ia32_sqrtps256_mask(x,...) x #define __builtin_ia32_subpd256_mask(x,...) x #define __builtin_ia32_paddb512_mask(x,...) x #define __builtin_ia32_packusdw512_mask(x,...) x #define __builtin_ia32_psubb512_mask(x,...) x #define __builtin_ia32_paddw512_mask(x,...) x #define __builtin_ia32_psubw512_mask(x,...) x #define __builtin_ia32_pmullw512_mask(x,...) x #define __builtin_ia32_packssdw512_mask(x,...) x #define __builtin_ia32_packsswb512_mask(x,...) x #define __builtin_ia32_blendmw_512_mask(x,...) x #define __builtin_ia32_packuswb512_mask(x,...) x #define __builtin_ia32_pshufb512_mask(x,...) x #define __builtin_ia32_punpckhbw512_mask(x,...) x #define __builtin_ia32_punpckhwd512_mask(x,...) x #define __builtin_ia32_blendmb_512_mask(x,...) x #define __builtin_ia32_punpcklbw512_mask(x,...) x #define __builtin_ia32_punpcklwd512_mask(x,...) x #define __builtin_ia32_pmullq512_mask(x,...) x #define __builtin_ia32_pmulhw512_mask(x,...) x #define __builtin_ia32_xorpd512_mask(x,...) x #define __builtin_ia32_sqrtps512_mask(x,...) x #define __builtin_ia32_xorps512_mask(x,...) x #define __builtin_ia32_orpd512_mask(x,...) x #define __builtin_ia32_paddw256_mask(x,...) x #define __builtin_ia32_paddb256_mask(x,...) x #define __builtin_ia32_orps512_mask(x,...) x #define __builtin_ia32_andpd512_mask(x,...) x #define __builtin_ia32_andps512_mask(x,...) x #define __builtin_ia32_andnpd512_mask(x,...) x #define __builtin_ia32_andnps512_mask(x,...) x #define __builtin_ia32_psubb256_mask(x,...) x #define __builtin_ia32_psubw256_mask(x,...) x #define __builtin_ia32_paddb128_mask(x,...) x #define __builtin_ia32_paddw128_mask(x,...) x #define __builtin_ia32_blendmb_256_mask(x,...) x #define __builtin_ia32_blendmw_256_mask(x,...) x #define __builtin_ia32_pmullw256_mask(x,...) x #define __builtin_ia32_psubb128_mask(x,...) x #define __builtin_ia32_psubsb512_mask(x,...) x #define __builtin_ia32_psubsw512_mask(x,...) x #define __builtin_ia32_psubw128_mask(x,...) x #define __builtin_ia32_pmullw128_mask(x,...) x #define __builtin_ia32_blendmb_128_mask(x,...) x #define __builtin_ia32_blendmw_128_mask(x,...) x #define __builtin_ia32_pabsb128_mask(x,...) x #define __builtin_ia32_pabsb256_mask(x,...) x #define __builtin_ia32_pabsw128_mask(x,...) x #define __builtin_ia32_pabsq128_mask(x,...) x #define __builtin_ia32_pabsq256_mask(x,...) x #define __builtin_ia32_pabsw256_mask(x,...) x #define __builtin_ia32_packssdw128_mask(x,...) x #define __builtin_ia32_packssdw256_mask(x,...) x #define __builtin_ia32_packusdw256_mask(x,...) x #define __builtin_ia32_packuswb128_mask(x,...) x #define __builtin_ia32_packsswb128_mask(x,...) x #define __builtin_ia32_packsswb256_mask(x,...) x #define __builtin_ia32_packusdw128_mask(x,...) x #define __builtin_ia32_paddsb512_mask(x,...) x #define __builtin_ia32_paddsb128_mask(x,...) x #define __builtin_ia32_paddsw128_mask(x,...) x #define __builtin_ia32_paddsw512_mask(x,...) x #define __builtin_ia32_packuswb256_mask(x,...) x #define __builtin_ia32_paddsb256_mask(x,...) x #define __builtin_ia32_paddsw256_mask(x,...) x #define __builtin_ia32_paddusb512_mask(x,...) x #define __builtin_ia32_paddusb128_mask(x,...) x #define __builtin_ia32_paddusb256_mask(x,...) x #define __builtin_ia32_paddusw512_mask(x,...) x #define __builtin_ia32_paddusw128_mask(x,...) x #define __builtin_ia32_paddusw256_mask(x,...) x #define __builtin_ia32_pavgb128_mask(x,...) x #define __builtin_ia32_pavgb512_mask(x,...) x #define __builtin_ia32_pavgb256_mask(x,...) x #define __builtin_ia32_pavgw512_mask(x,...) x #define __builtin_ia32_pavgw128_mask(x,...) x #define __builtin_ia32_pavgw256_mask(x,...) x #define __builtin_ia32_pmaxsb256_mask(x,...) x #define __builtin_ia32_pmaxsq256_mask(x,...) x #define __builtin_ia32_pmaxsw128_mask(x,...) x #define __builtin_ia32_pmaxsq128_mask(x,...) x #define __builtin_ia32_pmaxub128_mask(x,...) x #define __builtin_ia32_pmaxuq128_mask(x,...) x #define __builtin_ia32_pmaxsb128_mask(x,...) x #define __builtin_ia32_pmaxsw256_mask(x,...) x #define __builtin_ia32_pmaxuq256_mask(x,...) x #define __builtin_ia32_pmaxub256_mask(x,...) x #define __builtin_ia32_pmaxuw128_mask(x,...) x #define __builtin_ia32_pmaxuw256_mask(x,...) x #define __builtin_ia32_pminsb128_mask(x,...) x #define __builtin_ia32_pminsb256_mask(x,...) x #define __builtin_ia32_pminsq256_mask(x,...) x #define __builtin_ia32_pminsw128_mask(x,...) x #define __builtin_ia32_pminsq128_mask(x,...) x #define __builtin_ia32_pminub128_mask(x,...) x #define __builtin_ia32_pminuq256_mask(x,...) x #define __builtin_ia32_pminub256_mask(x,...) x #define __builtin_ia32_pminuw128_mask(x,...) x #define __builtin_ia32_pminuq128_mask(x,...) x #define __builtin_ia32_pminsw256_mask(x,...) x #define __builtin_ia32_pminuw256_mask(x,...) x #define __builtin_ia32_psubsb128_mask(x,...) x #define __builtin_ia32_psubsb256_mask(x,...) x #define __builtin_ia32_psubsw128_mask(x,...) x #define __builtin_ia32_pshufb128_mask(x,...) x #define __builtin_ia32_pshufb256_mask(x,...) x #define __builtin_ia32_psubusb128_mask(x,...) x #define __builtin_ia32_psubusb256_mask(x,...) x #define __builtin_ia32_psubusw128_mask(x,...) x #define __builtin_ia32_psubsw256_mask(x,...) x #define __builtin_ia32_psubusw256_mask(x,...) x #define __builtin_ia32_pmaddubsw128_mask(x,...) x #define __builtin_ia32_pmaddubsw512_mask(x,...) x #define __builtin_ia32_pmaddwd128_mask(x,...) x #define __builtin_ia32_pmulhrsw256_mask(x,...) x #define __builtin_ia32_pmulhuw128_mask(x,...) x #define __builtin_ia32_pmulhuw512_mask(x,...) x #define __builtin_ia32_pmaddubsw256_mask(x,...) x #define __builtin_ia32_pmulhrsw128_mask(x,...) x #define __builtin_ia32_pmaddwd256_mask(x,...) x #define __builtin_ia32_pmulhw128_mask(x,...) x #define __builtin_ia32_pmulhuw256_mask(x,...) x #define __builtin_ia32_punpckhbw256_mask(x,...) x #define __builtin_ia32_punpcklwd128_mask(x,...) x #define __builtin_ia32_punpckhwd128_mask(x,...) x #define __builtin_ia32_pmulhw256_mask(x,...) x #define __builtin_ia32_punpckhbw128_mask(x,...) x #define __builtin_ia32_punpckhwd256_mask(x,...) x #define __builtin_ia32_punpcklbw128_mask(x,...) x #define __builtin_ia32_punpcklwd256_mask(x,...) x #define __builtin_ia32_punpcklbw256_mask(x,...) x #define __builtin_ia32_andnps256_mask(x,...) x #define __builtin_ia32_andnps128_mask(x,...) x #define __builtin_ia32_andps128_mask(x,...) x #define __builtin_ia32_andps256_mask(x,...) x #define __builtin_ia32_xorps256_mask(x,...) x #define __builtin_ia32_xorps128_mask(x,...) x #define __builtin_ia32_orpd256_mask(x,...) x #define __builtin_ia32_orpd128_mask(x,...) x #define __builtin_ia32_xorpd128_mask(x,...) x #define __builtin_ia32_pmullq128_mask(x,...) x #define __builtin_ia32_orps256_mask(x,...) x #define __builtin_ia32_andnpd256_mask(x,...) x #define __builtin_ia32_xorpd256_mask(x,...) x #define __builtin_ia32_andpd128_mask(x,...) x #define __builtin_ia32_pmullq256_mask(x,...) x #define __builtin_ia32_orps128_mask(x,...) x #define __builtin_ia32_andnpd128_mask(x,...) x #define __builtin_ia32_andpd256_mask(x,...) x #define __builtin_ia32_vpcmov_256(x,...) x #define __builtin_ia32_vpcmov(x,...) x typedef float my64 __attribute__((__vector_size__(8))); typedef long long my64i __attribute__((__vector_size__(8))); typedef double my64d __attribute__((__vector_size__(8))); typedef float my128 __attribute__((__vector_size__(16))); typedef long long my128i __attribute__((__vector_size__(16))); typedef double my128d __attribute__((__vector_size__(16))); typedef float my256 __attribute__((__vector_size__(32))); typedef double my256d __attribute__((__vector_size__(32))); typedef long long my256i __attribute__((__vector_size__(32))); typedef float my512 __attribute__((__vector_size__(64))); typedef double my512d __attribute__((__vector_size__(64))); typedef long long my512i __attribute__((__vector_size__(64))); typedef int mymask8; typedef int mymask16; typedef int mymask32; typedef int mymask64; extern unsigned short getunsigned_short(); extern long long getlong_long(); extern int getint(); extern my64 get64(); extern my64i get64i(); extern my64d get64d(); extern my128 get128(); extern my128i get128i(); extern my128d get128d(); extern my256 get256(); extern my256d get256d(); extern my256i get256i(); extern my512 get512(); extern my512i get512i(); extern my512d get512d(); extern mymask8 getmask8(); extern mymask16 getmask16(); extern mymask32 getmask32(); extern mymask64 getmask64(); #define __builtin_ia32_andss(x,...) x #define __builtin_ia32_addss(x,...) x #define __builtin_ia32_subss(x,...) x #define __builtin_ia32_mulss(x,...) x #define __builtin_ia32_divss(x,...) x #define __builtin_ia32_xorss(x,...) x #define __builtin_ia32_andps(x,...) x #define __builtin_ia32_addps(x,...) x #define __builtin_ia32_subps(x,...) x #define __builtin_ia32_mulps(x,...) x #define __builtin_ia32_divps(x,...) x #define __builtin_ia32_xorps(x,...) x #define __builtin_ia32_bsrsi(x,...) x #define __builtin_ia32_rolqi(x,...) x #define __builtin_ia32_rolhi(x,...) x #define __builtin_ia32_rorqi(x,...) x #define __builtin_ia32_rorhi(x,...) x #define __builtin_ia32_bsrdi(x,...) x #define __builtin_ia32_andnps(x,...) x #define __builtin_ia32_orps(x,...) x #define __builtin_ia32_movss(x,...) x #define __builtin_ia32_cmpgtps(x,...) x #define __builtin_ia32_cmpltps(x,...) x #define __builtin_ia32_cmpgeps(x,...) x #define __builtin_ia32_cmpleps(x,...) x #define __builtin_ia32_cmpngeps(x,...) x #define __builtin_ia32_cvtsi2ss(x,...) x #define __builtin_ia32_cvtsi642ss(x,...) x #define __builtin_ia32_movlhps(x,...) x #define __builtin_ia32_movhlps(x,...) x #define __builtin_ia32_shufps(x,...) x #define __builtin_ia32_unpckhps(x,...) x #define __builtin_ia32_unpcklps(x,...) x #define __builtin_ia32_loadhps(x,...) x #define __builtin_ia32_loadlps(x,...) x #define __builtin_ia32_cmpngtps(x,...) x #define __builtin_ia32_movsd(x,...) x #define __builtin_ia32_shufpd(x,...) x #define __builtin_ia32_vec_ext_v2di(...) getlong_long() #define __builtin_ia32_addpd(x,...) x #define __builtin_ia32_addsd(x,...) x #define __builtin_ia32_subpd(...) get128d() #define __builtin_ia32_subsd(...) get128d() #define __builtin_ia32_mulpd(...) get128d() #define __builtin_ia32_mulsd(...) get128d() #define __builtin_ia32_divpd(...) get128d() #define __builtin_ia32_divsd(...) get128d() #define __builtin_ia32_sqrtpd(...) get128d() #define __builtin_ia32_sqrtsd(...) get128d() #define __builtin_ia32_minpd(...) get128d() #define __builtin_ia32_minsd(...) get128d() #define __builtin_ia32_maxpd(...) get128d() #define __builtin_ia32_maxsd(...) get128d() #define __builtin_ia32_andpd(...) get128d() #define __builtin_ia32_andnpd(...) get128d() #define __builtin_ia32_orpd(...) get128d() #define __builtin_ia32_xorpd(...) get128d() #define __builtin_ia32_cmpeqpd(...) get128d() #define __builtin_ia32_cmpltpd(...) get128d() #define __builtin_ia32_cmplepd(...) get128d() #define __builtin_ia32_cmpgtpd(...) get128d() #define __builtin_ia32_cmpgepd(...) get128d() #define __builtin_ia32_cmpneqpd(...) get128d() #define __builtin_ia32_cmpnltpd(...) get128d() #define __builtin_ia32_cmpnlepd(...) get128d() #define __builtin_ia32_cmpngtpd(...) get128d() #define __builtin_ia32_cmpngepd(...) get128d() #define __builtin_ia32_cmpordpd(...) get128d() #define __builtin_ia32_cmpunordpd(...) get128d() #define __builtin_ia32_cmpeqsd(...) get128d() #define __builtin_ia32_cmpltsd(...) get128d() #define __builtin_ia32_cmplesd(...) get128d() #define __builtin_ia32_cmpneqsd(...) get128d() #define __builtin_ia32_cmpnltsd(...) get128d() #define __builtin_ia32_cmpnlesd(...) get128d() #define __builtin_ia32_cmpordsd(...) get128d() #define __builtin_ia32_cmpunordsd(...) get128d() #define __builtin_ia32_loaddqu(...) get128i() #define __builtin_ia32_movq128(...) get128i() #define __builtin_ia32_cvtdq2ps(...) get128() #define __builtin_ia32_cvtpd2dq(...) get128i() #define __builtin_ia32_cvtpd2pi(...) get64() #define __builtin_ia32_cvtpd2ps(...) get128() #define __builtin_ia32_cvttpd2dq(...) get128i() #define __builtin_ia32_cvttpd2pi(...) get64() #define __builtin_ia32_cvtpi2pd(...) get128d() #define __builtin_ia32_cvtps2dq(...) get128i() #define __builtin_ia32_cvttps2dq(...) get128i() #define __builtin_ia32_cvtsd2ss(...) get128() #define __builtin_ia32_cvtsi2sd(...) get128d() #define __builtin_ia32_cvtsi642sd(...) get128d() #define __builtin_ia32_cvtss2sd(...) get128d() #define __builtin_ia32_unpckhpd(...) get128d() #define __builtin_ia32_unpcklpd(...) get128d() #define __builtin_ia32_loadhpd(...) get128d() #define __builtin_ia32_loadlpd(...) get128d() #define __builtin_ia32_packsswb128(...) get128i() #define __builtin_ia32_packssdw128(...) get128i() #define __builtin_ia32_packuswb128(...) get128i() #define __builtin_ia32_punpckhbw128(...) get128i() #define __builtin_ia32_punpckhwd128(...) get128i() #define __builtin_ia32_punpckhdq128(...) get128i() #define __builtin_ia32_punpckhqdq128(...) get128i() #define __builtin_ia32_punpcklbw128(...) get128i() #define __builtin_ia32_punpcklwd128(...) get128i() #define __builtin_ia32_punpckldq128(...) get128i() #define __builtin_ia32_punpcklqdq128(...) get128i() #define __builtin_ia32_paddb128(...) get128i() #define __builtin_ia32_paddw128(...) get128i() #define __builtin_ia32_paddd128(...) get128i() #define __builtin_ia32_paddq128(...) get128i() #define __builtin_ia32_paddsb128(...) get128i() #define __builtin_ia32_paddsw128(...) get128i() #define __builtin_ia32_paddusb128(...) get128i() #define __builtin_ia32_paddusw128(...) get128i() #define __builtin_ia32_psubb128(...) get128i() #define __builtin_ia32_psubw128(...) get128i() #define __builtin_ia32_psubd128(...) get128i() #define __builtin_ia32_psubq128(...) get128i() #define __builtin_ia32_psubsb128(...) get128i() #define __builtin_ia32_psubsw128(...) get128i() #define __builtin_ia32_psubusb128(...) get128i() #define __builtin_ia32_psubusw128(...) get128i() #define __builtin_ia32_pmaddwd128(...) get128i() #define __builtin_ia32_pmulhw128(...) get128i() #define __builtin_ia32_pmullw128(...) get128i() #define __builtin_ia32_pmuludq(...) get64() #define __builtin_ia32_pmuludq128(...) get128i() #define __builtin_ia32_psllwi128(...) get128i() #define __builtin_ia32_pslldi128(...) get128i() #define __builtin_ia32_psllqi128(...) get128i() #define __builtin_ia32_psrawi128(...) get128i() #define __builtin_ia32_psradi128(...) get128i() #define __builtin_ia32_psrldqi128(...) get128i() #define __builtin_ia32_pslldqi128(...) get128i() #define __builtin_ia32_psrlwi128(...) get128i() #define __builtin_ia32_psrlqi128(...) get128i() #define __builtin_ia32_psllw128(...) get128i() #define __builtin_ia32_pslld128(...) get128i() #define __builtin_ia32_psllq128(...) get128i() #define __builtin_ia32_psraw128(...) get128i() #define __builtin_ia32_psrad128(...) get128i() #define __builtin_ia32_psrlw128(...) get128i() #define __builtin_ia32_psrld128(...) get128i() #define __builtin_ia32_psrlq128(...) get128i() #define __builtin_ia32_pand128(...) get128i() #define __builtin_ia32_pandn128(...) get128i() #define __builtin_ia32_por128(...) get128i() #define __builtin_ia32_pxor128(...) get128i() #define __builtin_ia32_pcmpeqb128(...) get128i() #define __builtin_ia32_pcmpeqw128(...) get128i() #define __builtin_ia32_pcmpeqd128(...) get128i() #define __builtin_ia32_pcmpgtb128(...) get128i() #define __builtin_ia32_pcmpgtw128(...) get128i() #define __builtin_ia32_pcmpgtd128(...) get128i() #define __builtin_ia32_vec_ext_v8hi(...) getunsigned_short() #define __builtin_ia32_vec_set_v8hi(...) get128i() #define __builtin_ia32_pmaxsw128(...) get128i() #define __builtin_ia32_pmaxub128(...) get128i() #define __builtin_ia32_pminsw128(...) get128i() #define __builtin_ia32_pminub128(...) get128i() #define __builtin_ia32_pmulhuw128(...) get128i() #define __builtin_ia32_pshufhw(...) get128i() #define __builtin_ia32_pshuflw(...) get128i() #define __builtin_ia32_pshufd(...) get128i() #define __builtin_ia32_pavgb128(...) get128i() #define __builtin_ia32_pavgw128(...) get128i() #define __builtin_ia32_psadbw128(...) get128i() #define __builtin_ia32_storeupd(...) #define __builtin_ia32_storedqu(...) #define __builtin_ia32_maskmovdqu(...) #define __builtin_ia32_movnti(...) #define __builtin_ia32_movnti64(...) #define __builtin_ia32_movntdq(...) #define __builtin_ia32_movntpd(...) #define __builtin_ia32_clflush(...) #define __builtin_ia32_lfence(...) #define __builtin_ia32_mfence(...) #define __builtin_ia32_sqrtss(...) get128() #define __builtin_ia32_rcpss(...) get128() #define __builtin_ia32_rsqrtss(...) get128() #define __builtin_ia32_minss(...) get128() #define __builtin_ia32_maxss(...) get128() #define __builtin_ia32_sqrtps(...) get128() #define __builtin_ia32_rcpps(...) get128() #define __builtin_ia32_rsqrtps(...) get128() #define __builtin_ia32_minps(...) get128() #define __builtin_ia32_maxps(...) get128() #define __builtin_ia32_cmpeqss(...) get128() #define __builtin_ia32_cmpltss(...) get128() #define __builtin_ia32_cmpless(...) get128() #define __builtin_ia32_cmpneqss(...) get128() #define __builtin_ia32_cmpnltss(...) get128() #define __builtin_ia32_cmpnless(...) get128() #define __builtin_ia32_cmpordss(...) get128() #define __builtin_ia32_cmpunordss(...) get128() #define __builtin_ia32_cmpeqps(...) get128() #define __builtin_ia32_cmpneqps(...) get128() #define __builtin_ia32_cmpnltps(...) get128() #define __builtin_ia32_cmpnleps(...) get128() #define __builtin_ia32_cmpordps(...) get128() #define __builtin_ia32_cmpunordps(...) get128() #define __builtin_ia32_cvtps2pi(...) get64() #define __builtin_ia32_cvttps2pi(...) get64() #define __builtin_ia32_cvtpi2ps(...) get128() #define __builtin_ia32_packssdw(...) get64() #define __builtin_ia32_packsswb(...) get64() #define __builtin_ia32_vec_set_v4hi(...) get64() #define __builtin_ia32_pmaxsw(...) get64() #define __builtin_ia32_pmaxub(...) get64() #define __builtin_ia32_pminsw(...) get64() #define __builtin_ia32_pminub(...) get64() #define __builtin_ia32_pmulhuw(...) get64() #define __builtin_ia32_pshufw(...) get64() #define __builtin_ia32_pavgb(...) get64() #define __builtin_ia32_pavgw(...) get64() #define __builtin_ia32_psadbw(...) get64() #define __builtin_ia32_storehps(...) #define __builtin_ia32_storelps(...) #define __builtin_ia32_ldmxcsr(...) #define __builtin_ia32_maskmovq(...) #define __builtin_prefetch(...) #define __builtin_ia32_movntq(...) #define __builtin_ia32_sfence(...) #define __builtin_ia32_pause(...) #define __builtin_ia32_vec_ext_v4hi(...) 0 #define __builtin_ia32_vec_ext_v4sf(...) 0 #define __builtin_ia32_vec_ext_v4si(...) 0 #define __builtin_ia32_loadups(...) get128() #define __builtin_ia32_loadupd(...) get128d() #define __builtin_ia32_vec_ext_v2df(...) 0 #define __builtin_ia32_psrldi128(...) get128i() #define __builtin_ia32_vec_init_v2si(...) get64() #define __builtin_ia32_packuswb(...) get64() #define __builtin_ia32_punpckhbw(...) get64() #define __builtin_ia32_punpckhwd(...) get64() #define __builtin_ia32_punpckhdq(...) get64() #define __builtin_ia32_punpcklbw(...) get64() #define __builtin_ia32_punpcklwd(...) get64() #define __builtin_ia32_punpckldq(...) get64() #define __builtin_ia32_paddb(...) get64() #define __builtin_ia32_paddw(...) get64() #define __builtin_ia32_paddd(...) get64() #define __builtin_ia32_paddq(...) get64() #define __builtin_ia32_paddsb(...) get64() #define __builtin_ia32_paddsw(...) get64() #define __builtin_ia32_paddusb(...) get64() #define __builtin_ia32_paddusw(...) get64() #define __builtin_ia32_psubb(...) get64() #define __builtin_ia32_psubw(...) get64() #define __builtin_ia32_psubd(...) get64() #define __builtin_ia32_psubq(...) get64() #define __builtin_ia32_psubsb(...) get64() #define __builtin_ia32_psubsw(...) get64() #define __builtin_ia32_psubusb(...) get64() #define __builtin_ia32_psubusw(...) get64() #define __builtin_ia32_pmaddwd(...) get64() #define __builtin_ia32_pmulhw(...) get64() #define __builtin_ia32_pmullw(...) get64() #define __builtin_ia32_psllw(...) get64() #define __builtin_ia32_psllwi(...) get64() #define __builtin_ia32_pslld(...) get64() #define __builtin_ia32_pslldi(...) get64() #define __builtin_ia32_psllq(...) get64() #define __builtin_ia32_psllqi(...) get64() #define __builtin_ia32_psraw(...) get64() #define __builtin_ia32_psrawi(...) get64() #define __builtin_ia32_psrad(...) get64() #define __builtin_ia32_psradi(...) get64() #define __builtin_ia32_psrlw(...) get64() #define __builtin_ia32_psrlwi(...) get64() #define __builtin_ia32_psrld(...) get64() #define __builtin_ia32_psrldi(...) get64() #define __builtin_ia32_psrlq(...) get64() #define __builtin_ia32_psrlqi(...) get64() #define __builtin_ia32_pcmpeqb(...) get64() #define __builtin_ia32_pcmpgtb(...) get64() #define __builtin_ia32_pcmpeqw(...) get64() #define __builtin_ia32_pcmpgtw(...) get64() #define __builtin_ia32_pcmpeqd(...) get64() #define __builtin_ia32_pcmpgtd(...) get64() #define __builtin_ia32_vec_init_v4hi(...) get64() #define __builtin_ia32_vec_init_v8qi(...) get64() #define __builtin_ia32_emms(...) #define __builtin_ia32_movshdup(x) x #define __builtin_ia32_movsldup(x) x #define __builtin_ia32_monitor(...) #define __builtin_ia32_vfmaddsd(...) get128d() #define __builtin_ia32_vfmsubpd(...) get128d() #define __builtin_ia32_vfmsubsd(...) get128d() #define __builtin_ia32_vfnmaddpd(...) get128d() #define __builtin_ia32_vfnmaddsd(...) get128d() #define __builtin_ia32_vfnmsubpd(...) get128d() #define __builtin_ia32_vfnmsubsd(...) get128d() #define __builtin_ia32_vfmsubaddpd(...) get128d() #define __builtin_ia32_vfmsubpd256(...) get256d() #define __builtin_ia32_vfnmaddpd256(...) get256d() #define __builtin_ia32_vfnmsubpd256(...) get256d() #define __builtin_ia32_vfmsubaddpd256(...) get256d() #define __builtin_ia32_undef512(...) get512() #define __builtin_ia32_pbroadcastd512_gpr_mask(...) get512i() #define __builtin_ia32_pbroadcastq512_gpr_mask(...) get512i() #define __builtin_ia32_pbroadcastq512_mem_mask(...) get512i() #define __builtin_ia32_maxpd512_mask(...) get512d() #define __builtin_ia32_maxps512_mask(...) get512() #define __builtin_ia32_pmaxsd512_mask(...) get512i() #define __builtin_ia32_pmaxud512_mask(...) get512i() #define __builtin_ia32_pmaxsq512_mask(...) get512i() #define __builtin_ia32_pmaxuq512_mask(...) get512i() #define __builtin_ia32_minpd512_mask(...) get512d() #define __builtin_ia32_minps512_mask(...) get512() #define __builtin_ia32_pminsd512_mask(...) get512i() #define __builtin_ia32_pminud512_mask(...) get512i() #define __builtin_ia32_pminsq512_mask(...) get512i() #define __builtin_ia32_pminuq512_mask(...) get512i() #define __builtin_ia32_sqrtpd512_mask(...) get512d() #define __builtin_ia32_rsqrt14pd512_mask(...) get512d() #define __builtin_ia32_rsqrt14ps512_mask(...) get512() #define __builtin_ia32_rcp14pd512_mask(...) get512d() #define __builtin_ia32_rcp14ps512_mask(...) get512() #define __builtin_ia32_rndscaleps_mask(...) get512() #define __builtin_ia32_rndscalepd_mask(...) get512d() #define __builtin_ia32_pabsq512_mask(...) get512i() #define __builtin_ia32_pabsd512_mask(...) get512i() #define __builtin_ia32_addpd512_mask(...) get512d() #define __builtin_ia32_addps512_mask(...) get512() #define __builtin_ia32_subpd512_mask(...) get512d() #define __builtin_ia32_subps512_mask(...) get512() #define __builtin_ia32_mulpd512_mask(...) get512d() #define __builtin_ia32_mulps512_mask(...) get512() #define __builtin_ia32_divpd512_mask(...) get512d() #define __builtin_ia32_divps512_mask(...) get512() #define __builtin_ia32_vfmaddpd512_mask(...) get512d() #define __builtin_ia32_vfmaddpd512_mask3(...) get512d() #define __builtin_ia32_vfmaddpd512_maskz(...) get512d() #define __builtin_ia32_vfmaddps512_mask(...) get512() #define __builtin_ia32_vfmaddps512_mask3(...) get512() #define __builtin_ia32_vfmaddps512_maskz(...) get512() #define __builtin_ia32_vfmaddsubpd512_mask(...) get512d() #define __builtin_ia32_vfmaddsubpd512_mask3(...) get512d() #define __builtin_ia32_vfmaddsubpd512_maskz(...) get512d() #define __builtin_ia32_vfmaddsubps512_mask(...) get512() #define __builtin_ia32_vfmaddsubps512_mask3(...) get512() #define __builtin_ia32_vfmaddsubps512_maskz(...) get512() #define __builtin_ia32_vfmsubpd512_mask3(...) get512d() #define __builtin_ia32_vfmsubps512_mask3(...) get512() #define __builtin_ia32_vfmsubaddpd512_mask3(...) get512d() #define __builtin_ia32_vfmsubaddps512_mask3(...) get512() #define __builtin_ia32_vfnmaddpd512_mask(...) get512d() #define __builtin_ia32_vfnmaddps512_mask(...) get512() #define __builtin_ia32_vfnmsubpd512_mask(...) get512d() #define __builtin_ia32_vfnmsubpd512_mask3(...) get512d() #define __builtin_ia32_vfnmsubps512_mask(...) get512() #define __builtin_ia32_vfnmsubps512_mask3(...) get512() #define __builtin_ia32_vpermt2vard512_mask(...) get512i() #define __builtin_ia32_vpermt2varq512_mask(...) get512i() #define __builtin_ia32_vpermt2varpd512_mask(...) get512d() #define __builtin_ia32_vpermt2varps512_mask(...) get512() #define __builtin_ia32_alignq512_mask(...) get512i() #define __builtin_ia32_alignd512_mask(...) get512i() #define __builtin_ia32_cmpps512_mask(...) getmask16() #define __builtin_ia32_cmppd512_mask(...) getmask8() #define __builtin_ia32_cvttps2udq512_mask(...) get512i() #define __builtin_ia32_cvtdq2ps512_mask(...) get512() #define __builtin_ia32_cvtudq2ps512_mask(...) get512() #define __builtin_ia32_cvtpd2ps512_mask(...) get256() #define __builtin_ia32_vcvtps2ph512_mask(...) get256i() #define __builtin_ia32_vcvtph2ps512_mask(...) get512() #define __builtin_ia32_cvttps2dq512_mask(...) get512i() #define __builtin_ia32_cvttpd2dq512_mask(...) get256i() #define __builtin_ia32_cvtps2dq512_mask(...) get512i() #define __builtin_ia32_cvtpd2dq512_mask(...) get256i() #define __builtin_ia32_cvtps2udq512_mask(...) get512i() #define __builtin_ia32_cvtpd2udq512_mask(...) get256i() #define __builtin_ia32_ptestmd512(...) getmask16() #define __builtin_ia32_ptestmq512(...) getmask8() #define __builtin_ia32_loadaps512_mask(...) get512() #define __builtin_ia32_loadapd512_mask(...) get512d() #define __builtin_ia32_pcmpeqd512_mask(...) getmask16() #define __builtin_ia32_ucmpd512_mask(...) getmask16() #define __builtin_ia32_pcmpeqq512_mask(...) getmask8() #define __builtin_ia32_ucmpq512_mask(...) getmask8() #define __builtin_ia32_cmpd512_mask(...) getmask16() #define __builtin_ia32_cmpq512_mask(...) getmask8() #define __builtin_ia32_pcmpgtd512_mask(...) getmask16() #define __builtin_ia32_pcmpgtq512_mask(...) getmask8() #define __builtin_ia32_pcmpeqd128_mask(...) getmask8() #define __builtin_ia32_ucmpd128_mask(...) getmask8() #define __builtin_ia32_pcmpeqd256_mask(...) getmask8() #define __builtin_ia32_ucmpd256_mask(...) getmask8() #define __builtin_ia32_pcmpeqq128_mask(...) getmask8() #define __builtin_ia32_ucmpq128_mask(...) getmask8() #define __builtin_ia32_pcmpeqq256_mask(...) getmask8() #define __builtin_ia32_ucmpq256_mask(...) getmask8() #define __builtin_ia32_cmpd128_mask(...) getmask8() #define __builtin_ia32_cmpd256_mask(...) getmask8() #define __builtin_ia32_cmpq128_mask(...) getmask8() #define __builtin_ia32_cmpq256_mask(...) getmask8() #define __builtin_ia32_pcmpgtd128_mask(...) getmask8() #define __builtin_ia32_pcmpgtd256_mask(...) getmask8() #define __builtin_ia32_pcmpgtq128_mask(...) getmask8() #define __builtin_ia32_pcmpgtq256_mask(...) getmask8() #define __builtin_ia32_cmpps256_mask(...) getmask8() #define __builtin_ia32_cmppd256_mask(...) getmask8() #define __builtin_ia32_cmpps128_mask(...) getmask8() #define __builtin_ia32_cmppd128_mask(...) getmask8() #define __builtin_ia32_vfmaddpd128_mask(...) get128d() #define __builtin_ia32_vfmaddpd128_mask3(...) get128d() #define __builtin_ia32_vfmaddpd128_maskz(...) get128d() #define __builtin_ia32_vfmaddpd256_mask(...) get256d() #define __builtin_ia32_vfmaddpd256_mask3(...) get256d() #define __builtin_ia32_vfmaddpd256_maskz(...) get256d() #define __builtin_ia32_vfmaddps128_mask(...) get128() #define __builtin_ia32_vfmaddps128_mask3(...) get128() #define __builtin_ia32_vfmaddps128_maskz(...) get128() #define __builtin_ia32_vfmaddps256_mask(...) get256() #define __builtin_ia32_vfmaddps256_mask3(...) get256() #define __builtin_ia32_vfmaddps256_maskz(...) get256() #define __builtin_ia32_vfmaddsubpd128_mask(...) get128d() #define __builtin_ia32_vfmaddsubpd128_mask3(...) get128d() #define __builtin_ia32_vfmaddsubpd128_maskz(...) get128d() #define __builtin_ia32_vfmaddsubpd256_mask(...) get256d() #define __builtin_ia32_vfmaddsubpd256_mask3(...) get256d() #define __builtin_ia32_vfmaddsubpd256_maskz(...) get256d() #define __builtin_ia32_vfmaddsubps128_mask(...) get128() #define __builtin_ia32_vfmaddsubps128_mask3(...) get128() #define __builtin_ia32_vfmaddsubps128_maskz(...) get128() #define __builtin_ia32_vfmaddsubps256_mask(...) get256() #define __builtin_ia32_vfmaddsubps256_mask3(...) get256() #define __builtin_ia32_vfmaddsubps256_maskz(...) get256() #define __builtin_ia32_vfmsubpd128_mask3(...) get128d() #define __builtin_ia32_vfmsubpd256_mask3(...) get256d() #define __builtin_ia32_vfmsubps128_mask3(...) get128() #define __builtin_ia32_vfmsubps256_mask3(...) get256() #define __builtin_ia32_vfmsubaddpd128_mask3(...) get128d() #define __builtin_ia32_vfmsubaddpd256_mask3(...) get256d() #define __builtin_ia32_vfmsubaddps128_mask3(...) get128() #define __builtin_ia32_vfmsubaddps256_mask3(...) get256() #define __builtin_ia32_vfnmaddpd128_mask(...) get128d() #define __builtin_ia32_vfnmaddpd256_mask(...) get256d() #define __builtin_ia32_vfnmaddps128_mask(...) get128() #define __builtin_ia32_vfnmaddps256_mask(...) get256() #define __builtin_ia32_vfnmsubpd128_mask(...) get128d() #define __builtin_ia32_vfnmsubpd128_mask3(...) get128d() #define __builtin_ia32_vfnmsubpd256_mask(...) get256d() #define __builtin_ia32_vfnmsubpd256_mask3(...) get256d() #define __builtin_ia32_vfnmsubps128_mask(...) get128() #define __builtin_ia32_vfnmsubps128_mask3(...) get128() #define __builtin_ia32_vfnmsubps256_mask(...) get256() #define __builtin_ia32_vfnmsubps256_mask3(...) get256() #define __builtin_ia32_compressdf128_mask(...) get128d() #define __builtin_ia32_compressdf256_mask(...) get256d() #define __builtin_ia32_compressdi128_mask(...) get128i() #define __builtin_ia32_compressdi256_mask(...) get256i() #define __builtin_ia32_compresssf128_mask(...) get128() #define __builtin_ia32_compresssf256_mask(...) get256() #define __builtin_ia32_compresssi128_mask(...) get128i() #define __builtin_ia32_compresssi256_mask(...) get256i() #define __builtin_ia32_cvtdq2ps128_mask(...) get128() #define __builtin_ia32_cvtdq2ps256_mask(...) get256() #define __builtin_ia32_cvtpd2dq128_mask(...) get128i() #define __builtin_ia32_cvtpd2dq256_mask(...) get128i() #define __builtin_ia32_cvtpd2ps_mask(...) get128() #define __builtin_ia32_cvtpd2ps256_mask(...) get128() #define __builtin_ia32_cvtpd2udq128_mask(...) get128i() #define __builtin_ia32_cvtpd2udq256_mask(...) get128i() #define __builtin_ia32_cvtps2dq128_mask(...) get128i() #define __builtin_ia32_cvtps2dq256_mask(...) get256i() #define __builtin_ia32_cvtps2pd128_mask(...) get128d() #define __builtin_ia32_cvtps2pd256_mask(...) get256d() #define __builtin_ia32_cvtps2udq128_mask(...) get128i() #define __builtin_ia32_cvtps2udq256_mask(...) get256i() #define __builtin_ia32_cvttpd2dq128_mask(...) get128i() #define __builtin_ia32_cvttpd2dq256_mask(...) get128i() #define __builtin_ia32_cvttpd2udq128_mask(...) get128i() #define __builtin_ia32_cvttpd2udq256_mask(...) get128i() #define __builtin_ia32_cvttps2dq128_mask(...) get128i() #define __builtin_ia32_cvttps2dq256_mask(...) get256i() #define __builtin_ia32_cvttps2udq128_mask(...) get128i() #define __builtin_ia32_cvttps2udq256_mask(...) get256i() #define __builtin_ia32_cvtudq2ps128_mask(...) get128() #define __builtin_ia32_cvtudq2ps256_mask(...) get256() #define __builtin_ia32_expanddf128_mask(...) get128d() #define __builtin_ia32_expanddf256_mask(...) get256d() #define __builtin_ia32_expanddi128_mask(...) get128i() #define __builtin_ia32_expanddi256_mask(...) get256i() #define __builtin_ia32_expandloaddf128_mask(...) get128d() #define __builtin_ia32_expandloaddf256_mask(...) get256d() #define __builtin_ia32_expandloaddi128_mask(...) get128i() #define __builtin_ia32_expandloaddi256_mask(...) get256i() #define __builtin_ia32_expandloadsf128_mask(...) get128() #define __builtin_ia32_expandloadsf256_mask(...) get256() #define __builtin_ia32_expandloadsi128_mask(...) get128i() #define __builtin_ia32_expandloadsi256_mask(...) get256i() #define __builtin_ia32_expandsf128_mask(...) get128() #define __builtin_ia32_expandsf256_mask(...) get256() #define __builtin_ia32_expandsi128_mask(...) get128i() #define __builtin_ia32_expandsi256_mask(...) get256i() #define __builtin_ia32_getexppd128_mask(...) get128d() #define __builtin_ia32_getexppd256_mask(...) get256d() #define __builtin_ia32_getexpps128_mask(...) get128() #define __builtin_ia32_getexpps256_mask(...) get256() #define __builtin_ia32_rndscalepd_128_mask(...) get128d() #define __builtin_ia32_rndscalepd_256_mask(...) get256d() #define __builtin_ia32_rndscaleps_128_mask(...) get128() #define __builtin_ia32_rndscaleps_256_mask(...) get256() #define __builtin_ia32_scalefpd128_mask(...) get128d() #define __builtin_ia32_scalefpd256_mask(...) get256d() #define __builtin_ia32_scalefps128_mask(...) get128() #define __builtin_ia32_scalefps256_mask(...) get256() #define __builtin_ia32_vpermi2vard128_mask(...) get128i() #define __builtin_ia32_vpermi2vard256_mask(...) get256i() #define __builtin_ia32_vpermi2varpd128_mask(...) get128d() #define __builtin_ia32_vpermi2varpd256_mask(...) get256d() #define __builtin_ia32_vpermi2varps128_mask(...) get128() #define __builtin_ia32_vpermi2varps256_mask(...) get256() #define __builtin_ia32_vpermi2varq128_mask(...) get128i() #define __builtin_ia32_vpermi2varq256_mask(...) get256i() #define __builtin_ia32_vpermt2vard128_mask(...) get128i() #define __builtin_ia32_vpermt2vard128_maskz(...) get128i() #define __builtin_ia32_vpermt2vard256_mask(...) get256i() #define __builtin_ia32_vpermt2vard256_maskz(...) get256i() #define __builtin_ia32_vpermt2varpd128_mask(...) get128d() #define __builtin_ia32_vpermt2varpd128_maskz(...) get128d() #define __builtin_ia32_vpermt2varpd256_mask(...) get256d() #define __builtin_ia32_vpermt2varpd256_maskz(...) get256d() #define __builtin_ia32_vpermt2varps128_mask(...) get128() #define __builtin_ia32_vpermt2varps128_maskz(...) get128() #define __builtin_ia32_vpermt2varps256_mask(...) get256() #define __builtin_ia32_vpermt2varps256_maskz(...) get256() #define __builtin_ia32_vpermt2varq128_mask(...) get128i() #define __builtin_ia32_vpermt2varq128_maskz(...) get128i() #define __builtin_ia32_vpermt2varq256_mask(...) get256i() #define __builtin_ia32_vpermt2varq256_maskz(...) get256i() #define __builtin_ia32_pcmpeqb512_mask(...) getmask64() #define __builtin_ia32_ucmpb512_mask(...) getmask64() #define __builtin_ia32_pcmpeqw512_mask(...) getmask32() #define __builtin_ia32_ucmpw512_mask(...) getmask32() #define __builtin_ia32_cmpb512_mask(...) getmask64() #define __builtin_ia32_cmpw512_mask(...) getmask32() #define __builtin_ia32_pcmpgtb512_mask(...) getmask64() #define __builtin_ia32_pcmpgtw512_mask(...) getmask32() #define __builtin_ia32_pabsb512_mask(...) get512i() #define __builtin_ia32_pabsw512_mask(...) get512i() #define __builtin_ia32_pmaxsb512_mask(...) get512i() #define __builtin_ia32_pmaxsw512_mask(...) get512i() #define __builtin_ia32_pmaxub512_mask(...) get512i() #define __builtin_ia32_pmaxuw512_mask(...) get512i() #define __builtin_ia32_pminsb512_mask(...) get512i() #define __builtin_ia32_pminsw512_mask(...) get512i() #define __builtin_ia32_pminub512_mask(...) get512i() #define __builtin_ia32_pminuw512_mask(...) get512i() #define __builtin_ia32_psubusb512_mask(...) get512i() #define __builtin_ia32_psubusw512_mask(...) get512i() #define __builtin_ia32_vpermi2varhi512_mask(...) get512i() #define __builtin_ia32_vpermt2varhi512_mask(...) get512i() #define __builtin_ia32_vpermt2varhi512_maskz(...) get512i() #define __builtin_ia32_pmulhrsw512_mask(...) get512i() #define __builtin_ia32_pmaddwd512_mask(...) get512i() #define __builtin_ia32_pmovswb512_mask(...) get256i() #define __builtin_ia32_pmovuswb512_mask(...) get256i() #define __builtin_ia32_pmovwb512_mask(...) get256i() #define __builtin_ia32_pcmpeqb128_mask(...) getmask16() #define __builtin_ia32_ucmpb128_mask(...) getmask16() #define __builtin_ia32_pcmpeqb256_mask(...) getmask32() #define __builtin_ia32_ucmpb256_mask(...) getmask32() #define __builtin_ia32_pcmpeqw128_mask(...) getmask8() #define __builtin_ia32_ucmpw128_mask(...) getmask8() #define __builtin_ia32_pcmpeqw256_mask(...) getmask16() #define __builtin_ia32_ucmpw256_mask(...) getmask16() #define __builtin_ia32_cmpb128_mask(...) getmask16() #define __builtin_ia32_cmpb256_mask(...) getmask32() #define __builtin_ia32_cmpw128_mask(...) getmask8() #define __builtin_ia32_cmpw256_mask(...) getmask16() #define __builtin_ia32_pcmpgtb128_mask(...) getmask16() #define __builtin_ia32_pcmpgtb256_mask(...) getmask32() #define __builtin_ia32_pcmpgtw128_mask(...) getmask8() #define __builtin_ia32_pcmpgtw256_mask(...) getmask16() #define __builtin_ia32_vpermi2varhi128_mask(...) get128i() #define __builtin_ia32_vpermi2varhi256_mask(...) get256i() #define __builtin_ia32_vpermt2varhi128_mask(...) get128i() #define __builtin_ia32_vpermt2varhi128_maskz(...) get128i() #define __builtin_ia32_vpermt2varhi256_mask(...) get256i() #define __builtin_ia32_vpermt2varhi256_maskz(...) get256i() #define __builtin_ia32_pmovswb128_mask(...) get128i() #define __builtin_ia32_pmovswb256_mask(...) get128i() #define __builtin_ia32_pmovuswb128_mask(...) get128i() #define __builtin_ia32_pmovuswb256_mask(...) get128i() #define __builtin_ia32_pmovwb128_mask(...) get128i() #define __builtin_ia32_pmovwb256_mask(...) get128i() #define __builtin_ia32_vfmaddss(...) get128() #define __builtin_ia32_vfmsubps(...) get128() #define __builtin_ia32_vfmsubss(...) get128() #define __builtin_ia32_vfnmaddps(...) get128() #define __builtin_ia32_vfnmaddss(...) get128() #define __builtin_ia32_vfnmsubps(...) get128() #define __builtin_ia32_vfnmsubss(...) get128() #define __builtin_ia32_vfmsubaddps(...) get128() #define __builtin_ia32_vfmsubps256(...) get256() #define __builtin_ia32_vfnmaddps256(...) get256() #define __builtin_ia32_vfnmsubps256(...) get256() #define __builtin_ia32_vfmsubaddps256(...) get256() #define __builtin_ia32_pabsb256(...) get256i() #define __builtin_ia32_pabsw256(...) get256i() #define __builtin_ia32_pabsd256(...) get256i() #define __builtin_ia32_packsswb256(...) get256i() #define __builtin_ia32_packssdw256(...) get256i() #define __builtin_ia32_packuswb256(...) get256i() #define __builtin_ia32_packusdw256(...) get256i() #define __builtin_ia32_paddsb256(...) get256i() #define __builtin_ia32_paddsw256(...) get256i() #define __builtin_ia32_paddusb256(...) get256i() #define __builtin_ia32_paddusw256(...) get256i() #define __builtin_ia32_palignr256(...) get256i() #define __builtin_ia32_pavgb256(...) get256i() #define __builtin_ia32_pavgw256(...) get256i() #define __builtin_ia32_pblendvb256(...) get256i() //#define __builtin_shufflevector(...) 0 #define __builtin_ia32_phaddw256(...) get256i() #define __builtin_ia32_phaddd256(...) get256i() #define __builtin_ia32_phaddsw256(...) get256i() #define __builtin_ia32_phsubw256(...) get256i() #define __builtin_ia32_phsubd256(...) get256i() #define __builtin_ia32_phsubsw256(...) get256i() #define __builtin_ia32_pmaddubsw256(...) get256i() #define __builtin_ia32_pmaddwd256(...) get256i() #define __builtin_ia32_pmaxsb256(...) get256i() #define __builtin_ia32_pmaxsw256(...) get256i() #define __builtin_ia32_pmaxsd256(...) get256i() #define __builtin_ia32_pmaxub256(...) get256i() #define __builtin_ia32_pmaxuw256(...) get256i() #define __builtin_ia32_pmaxud256(...) get256i() #define __builtin_ia32_pminsb256(...) get256i() #define __builtin_ia32_pminsw256(...) get256i() #define __builtin_ia32_pminsd256(...) get256i() #define __builtin_ia32_pminub256(...) get256i() #define __builtin_ia32_pminuw256(...) get256i() #define __builtin_ia32_pminud256(...) get256i() #define __builtin_ia32_pmuldq256(...) get256i() #define __builtin_ia32_pmulhrsw256(...) get256i() #define __builtin_ia32_pmulhuw256(...) get256i() #define __builtin_ia32_pmulhw256(...) get256i() #define __builtin_ia32_pshufb256(...) get256i() #define __builtin_ia32_psignb256(...) get256i() #define __builtin_ia32_psignw256(...) get256i() #define __builtin_ia32_psignd256(...) get256i() #define __builtin_ia32_pslldqi256(...) get256i() #define __builtin_ia32_psllwi256(...) get256i() #define __builtin_ia32_psllw256(...) get256i() #define __builtin_ia32_pslldi256(...) get256i() #define __builtin_ia32_pslld256(...) get256i() #define __builtin_ia32_psrawi256(...) get256i() #define __builtin_ia32_psraw256(...) get256i() #define __builtin_ia32_psradi256(...) get256i() #define __builtin_ia32_psrad256(...) get256i() #define __builtin_ia32_psrldqi256(...) get256i() #define __builtin_ia32_psrlwi256(...) get256i() #define __builtin_ia32_psrlw256(...) get256i() #define __builtin_ia32_psrldi256(...) get256i() #define __builtin_ia32_psrld256(...) get256i() #define __builtin_ia32_psubsb256(...) get256i() #define __builtin_ia32_psubsw256(...) get256i() #define __builtin_ia32_psubusb256(...) get256i() #define __builtin_ia32_psubusw256(...) get256i() #define __builtin_ia32_movntdqa256(...) get256i() #define __builtin_ia32_permvarsi256(...) get256i() #define __builtin_ia32_permvarsf256(...) get256() #define __builtin_ia32_permti256(...) get256i() #define __builtin_ia32_maskloadd256(...) get256i() #define __builtin_ia32_maskloadq256(...) get256i() #define __builtin_ia32_maskloadd(...) get128i() #define __builtin_ia32_maskloadq(...) get128i() #define __builtin_ia32_psllv8si(...) get256i() #define __builtin_ia32_psllv4si(...) get128i() #define __builtin_ia32_psllv4di(...) get256i() #define __builtin_ia32_psllv2di(...) get128i() #define __builtin_ia32_psrav8si(...) get256i() #define __builtin_ia32_psrav4si(...) get128i() #define __builtin_ia32_psrlv8si(...) get256i() #define __builtin_ia32_psrlv4si(...) get128i() #define __builtin_ia32_psrlv4di(...) get256i() #define __builtin_ia32_psrlv2di(...) get128i() #define __builtin_ia32_gatherd_pd(...) get128d() #define __builtin_ia32_gatherd_pd256(...) get256d() #define __builtin_ia32_gatherq_pd(...) get128d() #define __builtin_ia32_gatherq_pd256(...) get256d() #define __builtin_ia32_gatherd_ps(...) get128() #define __builtin_ia32_gatherd_ps256(...) get256() #define __builtin_ia32_gatherq_ps(...) get128() #define __builtin_ia32_gatherq_ps256(...) get128() #define __builtin_ia32_gatherd_d(...) get128i() #define __builtin_ia32_gatherd_d256(...) get256i() #define __builtin_ia32_gatherq_d(...) get128i() #define __builtin_ia32_gatherq_d256(...) get128i() #define __builtin_ia32_gatherd_q(...) get128i() #define __builtin_ia32_gatherd_q256(...) get256i() #define __builtin_ia32_gatherq_q(...) get128i() #define __builtin_ia32_gatherq_q256(...) get256i() #define __builtin_ia32_movntdqa(...) get128i() #define __builtin_ia32_vpopcntw_512(...) get512i() #define __builtin_ia32_selectw_512(...) get512i() #define __builtin_ia32_vpopcntb_512(...) get512i() #define __builtin_ia32_vpshufbitqmb512_mask(...) getmask64() #define __builtin_ia32_vpopcntq_512(...) get512i() #define __builtin_ia32_selectq_512(...) get512i() #define __builtin_ia32_vpopcntd_512(...) get512i() #define __builtin_ia32_selectd_512(...) get512i() #define __builtin_ia32_vpdpbusd256_mask(...) get256i() #define __builtin_ia32_vpdpbusd256_maskz(...) get256i() #define __builtin_ia32_vpdpbusds256_mask(...) get256i() #define __builtin_ia32_vpdpbusds256_maskz(...) get256i() #define __builtin_ia32_vpdpwssd256_mask(...) get256i() #define __builtin_ia32_vpdpwssd256_maskz(...) get256i() #define __builtin_ia32_vpdpwssds256_mask(...) get256i() #define __builtin_ia32_vpdpwssds256_maskz(...) get256i() #define __builtin_ia32_vpdpbusd128_mask(...) get128i() #define __builtin_ia32_vpdpbusd128_maskz(...) get128i() #define __builtin_ia32_vpdpbusds128_mask(...) get128i() #define __builtin_ia32_vpdpbusds128_maskz(...) get128i() #define __builtin_ia32_vpdpwssd128_mask(...) get128i() #define __builtin_ia32_vpdpwssd128_maskz(...) get128i() #define __builtin_ia32_vpdpwssds128_mask(...) get128i() #define __builtin_ia32_vpdpwssds128_maskz(...) get128i() #define __builtin_ia32_vpopcntq_128(...) get128i() #define __builtin_ia32_selectq_128(...) get128i() #define __builtin_ia32_vpopcntd_128(...) get128i() #define __builtin_ia32_selectd_128(...) get128i() #define __builtin_ia32_vpopcntq_256(...) get256i() #define __builtin_ia32_selectq_256(...) get256i() #define __builtin_ia32_vpopcntd_256(...) get256i() #define __builtin_ia32_selectd_256(...) get256i() #define __builtin_ia32_vpdpbusd512_mask(...) get512i() #define __builtin_ia32_vpdpbusd512_maskz(...) get512i() #define __builtin_ia32_vpdpbusds512_mask(...) get512i() #define __builtin_ia32_vpdpbusds512_maskz(...) get512i() #define __builtin_ia32_vpdpwssd512_mask(...) get512i() #define __builtin_ia32_vpdpwssd512_maskz(...) get512i() #define __builtin_ia32_vpdpwssds512_mask(...) get512i() #define __builtin_ia32_vpdpwssds512_maskz(...) get512i() #define __builtin_ia32_vpopcntw_256(...) get256i() #define __builtin_ia32_selectw_256(...) get256i() #define __builtin_ia32_vpopcntw_128(...) get128i() #define __builtin_ia32_selectw_128(...) get128i() #define __builtin_ia32_vpopcntb_256(...) get256i() #define __builtin_ia32_vpopcntb_128(...) get128i() #define __builtin_ia32_vpshufbitqmb256_mask(...) getmask32() #define __builtin_ia32_vpshufbitqmb128_mask(...) getmask16() #define __builtin_ia32_compresshi128_mask(...) get128i() #define __builtin_ia32_compressqi128_mask(...) get128i() #define __builtin_ia32_expandhi128_mask(...) get128i() #define __builtin_ia32_expandqi128_mask(...) get128i() #define __builtin_ia32_expandloadhi128_mask(...) get128i() #define __builtin_ia32_expandloadqi128_mask(...) get128i() #define __builtin_ia32_compresshi256_mask(...) get256i() #define __builtin_ia32_compressqi256_mask(...) get256i() #define __builtin_ia32_expandhi256_mask(...) get256i() #define __builtin_ia32_expandqi256_mask(...) get256i() #define __builtin_ia32_expandloadhi256_mask(...) get256i() #define __builtin_ia32_expandloadqi256_mask(...) get256i() #define __builtin_ia32_vpshldq256_mask(...) get256i() #define __builtin_ia32_vpshldq128_mask(...) get128i() #define __builtin_ia32_vpshldd256_mask(...) get256i() #define __builtin_ia32_vpshldd128_mask(...) get128i() #define __builtin_ia32_vpshldw256_mask(...) get256i() #define __builtin_ia32_vpshldw128_mask(...) get128i() #define __builtin_ia32_vpshrdq256_mask(...) get256i() #define __builtin_ia32_vpshrdq128_mask(...) get128i() #define __builtin_ia32_vpshrdd256_mask(...) get256i() #define __builtin_ia32_vpshrdd128_mask(...) get128i() #define __builtin_ia32_vpshrdw256_mask(...) get256i() #define __builtin_ia32_vpshrdw128_mask(...) get128i() #define __builtin_ia32_vpshldvq256_mask(...) get256i() #define __builtin_ia32_vpshldvq256_maskz(...) get256i() #define __builtin_ia32_vpshldvq128_mask(...) get128i() #define __builtin_ia32_vpshldvq128_maskz(...) get128i() #define __builtin_ia32_vpshldvd256_mask(...) get256i() #define __builtin_ia32_vpshldvd256_maskz(...) get256i() #define __builtin_ia32_vpshldvd128_mask(...) get128i() #define __builtin_ia32_vpshldvd128_maskz(...) get128i() #define __builtin_ia32_vpshldvw256_mask(...) get256i() #define __builtin_ia32_vpshldvw256_maskz(...) get256i() #define __builtin_ia32_vpshldvw128_mask(...) get128i() #define __builtin_ia32_vpshldvw128_maskz(...) get128i() #define __builtin_ia32_vpshrdvq256_mask(...) get256i() #define __builtin_ia32_vpshrdvq256_maskz(...) get256i() #define __builtin_ia32_vpshrdvq128_mask(...) get128i() #define __builtin_ia32_vpshrdvq128_maskz(...) get128i() #define __builtin_ia32_vpshrdvd256_mask(...) get256i() #define __builtin_ia32_vpshrdvd256_maskz(...) get256i() #define __builtin_ia32_vpshrdvd128_mask(...) get128i() #define __builtin_ia32_vpshrdvd128_maskz(...) get128i() #define __builtin_ia32_vpshrdvw256_mask(...) get256i() #define __builtin_ia32_vpshrdvw256_maskz(...) get256i() #define __builtin_ia32_vpshrdvw128_mask(...) get128i() #define __builtin_ia32_vpshrdvw128_maskz(...) get128i() #define __builtin_ia32_compressstorehi128_mask(...) #define __builtin_ia32_compressstoreqi128_mask(...) #define __builtin_ia32_compressstorehi256_mask(...) #define __builtin_ia32_compressstoreqi256_mask(...) #define __builtin_ia32_aesenc256(...) get256i() #define __builtin_ia32_aesenc512(...) get512i() #define __builtin_ia32_aesdec256(...) get256i() #define __builtin_ia32_aesdec512(...) get512i() #define __builtin_ia32_aesenclast256(...) get256i() #define __builtin_ia32_aesenclast512(...) get512i() #define __builtin_ia32_aesdeclast256(...) get256i() #define __builtin_ia32_aesdeclast512(...) get512i() #define __builtin_ia32_vgf2p8affineinvqb_v16qi(...) get128i() #define __builtin_ia32_selectb_128(...) get128i() #define __builtin_ia32_vgf2p8affineinvqb_v32qi(...) get256i() #define __builtin_ia32_selectb_256(...) get256i() #define __builtin_ia32_vgf2p8affineinvqb_v64qi(...) get512i() #define __builtin_ia32_selectb_512(...) get512i() #define __builtin_ia32_vgf2p8affineqb_v16qi(...) get128i() #define __builtin_ia32_vgf2p8affineqb_v32qi(...) get256i() #define __builtin_ia32_vgf2p8affineqb_v64qi(...) get512i() #define __builtin_ia32_vgf2p8mulb_v16qi(...) get128i() #define __builtin_ia32_vgf2p8mulb_v32qi(...) get256i() #define __builtin_ia32_vgf2p8mulb_v64qi(...) get512i() #define __builtin_ia32_incsspd(...) #define __builtin_ia32_incsspq(...) #define __builtin_ia32_saveprevssp(...) #define __builtin_ia32_rstorssp(...) #define __builtin_ia32_wrssd(...) #define __builtin_ia32_wrssq(...) #define __builtin_ia32_wrussd(...) #define __builtin_ia32_wrussq(...) #define __builtin_ia32_setssbsy(...) #define __builtin_ia32_clrssbsy(...) #define __builtin_ia32_rdsspd(...) __VA_ARGS__ #define __builtin_ia32_rdsspq(...) __VA_ARGS__ #define __builtin_ia32_llwpcb(...) #define __builtin_ia32_slwpcb(...) __VA_ARGS__ #define get__v4df() get256d() #define get__v32qu() get256i() #define get__v16hu() get256i() #define get__v16hi() get256i() #define get__v8si() get256i() #define get__v4di() get256i() #define __builtin_convertvector(a,b) get##b() #define __builtin_ia32_vfmaddps(...) get128() #define __builtin_ia32_vfmaddpd(...) get128d() #define __builtin_ia32_vfmaddss3(...) get128() #define __builtin_ia32_vfmaddsd3(...) get128d() #define __builtin_ia32_vfmaddsubps(...) get128() #define __builtin_ia32_vfmaddsubpd(...) get128d() #define __builtin_ia32_vfmaddps256(...) get256() #define __builtin_ia32_vfmaddpd256(...) get256d() #define __builtin_ia32_vfmaddsubps256(...) get256() #define __builtin_ia32_vfmaddsubpd256(...) get256d() #define get__v8df() get512d() #define get__v16si() get512i() #define get__v8di() get512i() #define get__v2df() get128d() #define get__v32hi() get512i() #define get__v32hu() get512i() #define __builtin_ia32_compresshi512_mask(...) get512i() #define __builtin_ia32_compressqi512_mask(...) get512i() #define __builtin_ia32_expandhi512_mask(...) get512i() #define __builtin_ia32_expandqi512_mask(...) get512i() #define __builtin_ia32_expandloadhi512_mask(...) get512i() #define __builtin_ia32_expandloadqi512_mask(...) get512i() #define __builtin_ia32_vpshldq512_mask(...) get512i() #define __builtin_ia32_vpshldd512_mask(...) get512i() #define __builtin_ia32_vpshldw512_mask(...) get512i() #define __builtin_ia32_vpshrdq512_mask(...) get512i() #define __builtin_ia32_vpshrdd512_mask(...) get512i() #define __builtin_ia32_vpshrdw512_mask(...) get512i() #define __builtin_ia32_vpshldvq512_mask(...) get512i() #define __builtin_ia32_vpshldvq512_maskz(...) get512i() #define __builtin_ia32_vpshldvd512_mask(...) get512i() #define __builtin_ia32_vpshldvd512_maskz(...) get512i() #define __builtin_ia32_vpshldvw512_mask(...) get512i() #define __builtin_ia32_vpshldvw512_maskz(...) get512i() #define __builtin_ia32_vpshrdvq512_mask(...) get512i() #define __builtin_ia32_vpshrdvq512_maskz(...) get512i() #define __builtin_ia32_vpshrdvd512_mask(...) get512i() #define __builtin_ia32_vpshrdvd512_maskz(...) get512i() #define __builtin_ia32_vpshrdvw512_mask(...) get512i() #define __builtin_ia32_vpshrdvw512_maskz(...) get512i() #define __builtin_ia32_compressstorehi512_mask(...) #define __builtin_ia32_compressstoreqi512_mask(...) #define get__v64qu() get512i() #define get__v2di() get128i() #define get__v4si() get128i() #define get__v8hi() get128i() #define get__v8hu() get128i() #define get__v16qu() get128i() #define __builtin_ia32_clwb(...) #define __builtin_ia32_clflushopt(...) #define __builtin_ia32_pblendw128(x,...) x #define __builtin_ia32_blendps(x,...) x #define __builtin_ia32_blendpd(x,...) x #define __builtin_ia32_pcmpeqq(x,...) x #define __builtin_ia32_pmulld128(x,...) x #define __builtin_ia32_vec_set_v16qi(x,...) x #define __builtin_ia32_vec_set_v4si(x,...) x #define __builtin_ia32_vec_set_v2di(x,...) x #define __builtin_ia32_pmovsxbd128(x,...) x #define __builtin_ia32_pmovsxwd128(x,...) x #define __builtin_ia32_pmovsxbq128(x,...) x #define __builtin_ia32_pmovsxdq128(x,...) x #define __builtin_ia32_pmovsxwq128(x,...) x #define __builtin_ia32_pmovsxbw128(x,...) get128i() #define __builtin_ia32_palignr128(x,...) x #define __builtin_ia32_palignr(x,...) x #define __builtin_ia32_extrqi(x,...) x #define __builtin_ia32_insertqi(x,...) x #define __builtin_ia32_roundpd(x,...) x #define __builtin_ia32_roundsd(x,...) x #define __builtin_ia32_roundps(x,...) x #define __builtin_ia32_roundss(x,...) x #define __builtin_ia32_dpps(x,...) x #define __builtin_ia32_dppd(x,...) x #define __builtin_ia32_insertps128(x,...) x #define __builtin_ia32_mpsadbw128(x,...) x #define __builtin_ia32_pcmpistrm128(x,...) x #define __builtin_ia32_pcmpestrm128(x,...) x #define __builtin_ia32_pcmpgtq(x,...) x #define __builtin_ia32_addpd256(x,...) x #define __builtin_ia32_addps256(x,...) x #define __builtin_ia32_andpd256(x,...) x #define __builtin_ia32_aeskeygenassist128(x,...) x #define __builtin_ia32_pclmulqdq128(x,...) x #define __builtin_ia32_andps256(x,...) x #define __builtin_ia32_andnpd256(x,...) x #define __builtin_ia32_andnps256(x,...) x #define __builtin_ia32_blendpd256(x,...) x #define __builtin_ia32_blendps256(x,...) x #define __builtin_ia32_divpd256(x,...) x #define __builtin_ia32_divps256(x,...) x #define __builtin_ia32_mulpd256(x,...) x #define __builtin_ia32_mulps256(x,...) x #define __builtin_ia32_orpd256(x,...) x #define __builtin_ia32_dpps256(x,...) x #define __builtin_ia32_orps256(x,...) x #define __builtin_ia32_shufpd256(x,...) x #define __builtin_ia32_shufps256(x,...) x #define __builtin_ia32_subpd256(x,...) x #define __builtin_ia32_subps256(x,...) x #define __builtin_ia32_cmppd256(x,...) x #define __builtin_ia32_xorpd256(x,...) x #define __builtin_ia32_xorps256(x,...) x #define __builtin_ia32_cmppd(x,...) x #define __builtin_ia32_cmpps(x,...) x #define __builtin_ia32_cmpps256(x,...) x #define __builtin_ia32_cmpsd(x,...) x #define __builtin_ia32_vpermilpd(x,...) x #define __builtin_ia32_cmpss(x,...) x #define __builtin_ia32_vpermilpd256(x,...) x #define __builtin_ia32_vpermilps(x,...) x #define __builtin_ia32_vpermilps256(x,...) x #define __builtin_ia32_vperm2f128_pd256(x,...) x #define __builtin_ia32_vperm2f128_ps256(x,...) x #define __builtin_ia32_vperm2f128_si256(x,...) x #define __builtin_ia32_vextractf128_pd256(...) get128d() #define __builtin_ia32_vextractf128_ps256(...) get128() #define __builtin_ia32_vextractf128_si256(...) get128i() #define __builtin_ia32_vinsertf128_pd256(x,...) x #define __builtin_ia32_vinsertf128_ps256(x,...) x #define __builtin_ia32_vbroadcastss(...) get128() #define __builtin_ia32_vinsertf128_si256(x,...) x #define __builtin_ia32_vbroadcastsd256(...) get256d() #define __builtin_ia32_movshdup256(x,...) x #define __builtin_ia32_vbroadcastss256(...) get256() #define __builtin_ia32_movsldup256(x,...) x #define __builtin_ia32_movddup256(x,...) x #define __builtin_ia32_loadupd256(...) get256d() #define __builtin_ia32_unpckhpd256(x,...) x #define __builtin_ia32_unpcklpd256(x,...) x #define __builtin_ia32_roundpd256(x,...) x #define __builtin_ia32_roundps256(x,...) x #define __builtin_ia32_loadups256(...) get256() #define __builtin_ia32_unpckhps256(x,...) x #define __builtin_ia32_unpcklps256(x,...) x #define __builtin_ia32_loaddqu256(...) get256i() #define __builtin_ia32_pd_pd256(...) get128d() #define __builtin_ia32_mpsadbw256(x,...) x #define __builtin_ia32_ps_ps256(...) get128() #define __builtin_ia32_paddb256(x,...) x #define __builtin_ia32_paddw256(x,...) x #define __builtin_ia32_si_si256(...) get128i() #define __builtin_ia32_pd256_pd(...) get256d() #define __builtin_ia32_ps256_ps(...) get256() #define __builtin_ia32_si256_si(...) get256i() #define __builtin_ia32_paddq256(x,...) x #define __builtin_ia32_andsi256(x,...) x #define __builtin_ia32_andnotsi256(x,...) x #define __builtin_ia32_pblendw256(x,...) x #define __builtin_ia32_paddd256(...) get256i() #define __builtin_ia32_pcmpeqw256(x,...) x #define __builtin_ia32_pcmpeqd256(x,...) x #define __builtin_ia32_pcmpeqb256(...) get256i() #define __builtin_ia32_pcmpgtb256(x,...) x #define __builtin_ia32_pcmpgtw256(x,...) x #define __builtin_ia32_pcmpgtd256(x,...) x #define __builtin_ia32_pcmpeqq256(...) get256i() #define __builtin_ia32_pmullw256(x,...) x #define __builtin_ia32_pmulld256(x,...) x #define __builtin_ia32_por256(x,...) x #define __builtin_ia32_pshufd256(x,...) x #define __builtin_ia32_pcmpgtq256(...) get256i() #define __builtin_ia32_pshuflw256(x,...) x #define __builtin_ia32_psubb256(x,...) x #define __builtin_ia32_psubw256(x,...) x #define __builtin_ia32_pshufhw256(...) get256i() #define __builtin_ia32_psubq256(x,...) x #define __builtin_ia32_punpckhbw256(x,...) x #define __builtin_ia32_punpckhwd256(x,...) x #define __builtin_ia32_psubd256(...) get256i() #define __builtin_ia32_punpckhqdq256(x,...) x #define __builtin_ia32_punpcklbw256(x,...) x #define __builtin_ia32_punpckhdq256(...) get256i() #define __builtin_ia32_punpckldq256(x,...) x #define __builtin_ia32_punpcklqdq256(x,...) x #define __builtin_ia32_punpcklwd256(...) get256i() #define __builtin_ia32_vbroadcastss_ps(x,...) x #define __builtin_ia32_pxor256(...) get256i() #define __builtin_ia32_pblendd128(x,...) x #define __builtin_ia32_pblendd256(x,...) x #define __builtin_ia32_vbroadcastss_ps256(...) get256() #define __builtin_ia32_vbroadcastsd_pd256(...) get256d() #define __builtin_ia32_vbroadcastsi256(...) get256i() #define __builtin_ia32_pbroadcastb128(x,...) x #define __builtin_ia32_pbroadcastb256(...) get256i() #define __builtin_ia32_pbroadcastw256(...) get256i() #define __builtin_ia32_pbroadcastd256(...) get256i() #define __builtin_ia32_pbroadcastw128(x,...) x #define __builtin_ia32_pbroadcastd128(x,...) x #define __builtin_ia32_pbroadcastq128(x,...) x #define __builtin_ia32_permdf256(x,...) x #define __builtin_ia32_pbroadcastq256(...) get256i() #define __builtin_ia32_insert128i256(x,...) x #define __builtin_ia32_gathersiv2df(x,...) x #define __builtin_ia32_permdi256(...) get256i() #define __builtin_ia32_gathersiv4df(x,...) x #define __builtin_ia32_gatherdiv2df(x,...) x #define __builtin_ia32_gatherdiv4df(x,...) x #define __builtin_ia32_extract128i256(...) get128i() #define __builtin_ia32_gathersiv8sf(x,...) x #define __builtin_ia32_gathersiv4sf(...) get128() #define __builtin_ia32_gatherdiv4sf256(x,...) x #define __builtin_ia32_gatherdiv4sf(...) get128() #define __builtin_ia32_gathersiv4di(x,...) x #define __builtin_ia32_gatherdiv2di(x,...) x #define __builtin_ia32_gathersiv2di(...) get128i() #define __builtin_ia32_gathersiv4si(x,...) x #define __builtin_ia32_gatherdiv4di(...) get256i() #define __builtin_ia32_gatherdiv4si(x,...) x #define __builtin_ia32_gathersiv8si(...) get256i() #define __builtin_ia32_movapd512_mask(x,...) x #define __builtin_ia32_gatherdiv4si256(...) get128i() #define __builtin_ia32_broadcastsd512(...) get512d() #define __builtin_ia32_broadcastss512(...) get512() #define __builtin_ia32_movdqa64_512_mask(x,...) x #define __builtin_ia32_movaps512_mask(...) get512() #define __builtin_ia32_psllv16si_mask(x,...) x #define __builtin_ia32_movdqa32_512_mask(...) get512i() #define __builtin_ia32_psrlv16si_mask(x,...) x #define __builtin_ia32_psrav16si_mask(...) get512i() #define __builtin_ia32_psrav8di_mask(x,...) x #define __builtin_ia32_psllv8di_mask(...) get512i() #define __builtin_ia32_psllqi512_mask(x,...) x #define __builtin_ia32_psrlv8di_mask(...) get512i() #define __builtin_ia32_psllq512_mask(...) get512i() #define __builtin_ia32_prolq512_mask(x,...) x #define __builtin_ia32_psrlqi512_mask(...) get512i() #define __builtin_ia32_psrlq512_mask(...) get512i() #define __builtin_ia32_psraq512_mask(x,...) x #define __builtin_ia32_psraqi512_mask(...) get512i() #define __builtin_ia32_pslldi512_mask(...) get512i() #define __builtin_ia32_pslld512_mask(...) get512i() #define __builtin_ia32_prold512_mask(x,...) x #define __builtin_ia32_psrldi512_mask(...) get512i() #define __builtin_ia32_psrld512_mask(...) get512i() #define __builtin_ia32_psrad512_mask(x,...) x #define __builtin_ia32_psradi512_mask(...) get512i() #define __builtin_ia32_pternlogq512_maskz(x,...) x #define __builtin_ia32_pternlogd512_mask(x,...) x #define __builtin_ia32_pternlogd512_maskz(x,...) x #define __builtin_ia32_pternlogq512_mask(...) get512i() #define __builtin_ia32_sqrtss_round(x,...) x #define __builtin_ia32_sqrtsd_round(...) get128d() #define __builtin_ia32_pmovsxbd512_mask(...) get512i() #define __builtin_ia32_pmovsxbq512_mask(...) get512i() #define __builtin_ia32_pmovsxwd512_mask(...) get512i() #define __builtin_ia32_pmovsxwq512_mask(...) get512i() #define __builtin_ia32_pmovsxdq512_mask(...) get512i() #define __builtin_ia32_pmovzxbd512_mask(...) get512i() #define __builtin_ia32_pmovzxbq512_mask(...) get512i() #define __builtin_ia32_pmovzxwd512_mask(...) get512i() #define __builtin_ia32_pmovzxwq512_mask(...) get512i() #define __builtin_ia32_scalefpd512_mask(x,...) x #define __builtin_ia32_pmovzxdq512_mask(...) get512i() #define __builtin_ia32_scalefsd_round(x,...) x #define __builtin_ia32_scalefss_round(x,...) x #define __builtin_ia32_scalefps512_mask(...) get512() #define __builtin_ia32_pbroadcastd512(...) get512i() #define __builtin_ia32_pbroadcastq512(...) get512i() #define __builtin_ia32_broadcastf32x4_512(...) get512() #define __builtin_ia32_broadcasti32x4_512(...) get512i() #define __builtin_ia32_broadcastf64x4_512(...) get512d() #define __builtin_ia32_pshufd512_mask(x,...) x #define __builtin_ia32_broadcasti64x4_512(...) get512i() #define __builtin_ia32_shuf_i32x4_mask(x,...) x #define __builtin_ia32_shuf_i64x2_mask(...) get512i() #define __builtin_ia32_shuf_f32x4_mask(x,...) x #define __builtin_ia32_shuf_f64x2_mask(...) get512d() #define __builtin_ia32_cvtusi2sd64(x,...) x #define __builtin_ia32_cvtsi2sd64(x,...) x #define __builtin_ia32_cvttpd2udq512_mask(...) get256i() #define __builtin_ia32_cvtsi2ss32(x,...) x #define __builtin_ia32_cvtusi2ss64(x,...) x #define __builtin_ia32_cvtsi2ss64(x,...) x #define __builtin_ia32_cvtusi2ss32(...) get128() #define __builtin_ia32_extractf64x4_mask(...) get256d() #define __builtin_ia32_extractf32x4_mask(...) get128() #define __builtin_ia32_extracti64x4_mask(...) get256i() #define __builtin_ia32_inserti32x4_mask(x,...) x #define __builtin_ia32_insertf32x4_mask(x,...) x #define __builtin_ia32_extracti32x4_mask(...) get128i() #define __builtin_ia32_inserti64x4_mask(...) get512i() #define __builtin_ia32_vpermilvarpd512_mask(x,...) x #define __builtin_ia32_insertf64x4_mask(...) get512d() #define __builtin_ia32_vpermilpd512_mask(x,...) x #define __builtin_ia32_vpermilvarps512_mask(...) get512() #define __builtin_ia32_vpermilps512_mask(...) get512() #define __builtin_ia32_permdi512_mask(...) get512i() #define __builtin_ia32_permdf512_mask(...) get512d() #define __builtin_ia32_shufps512_mask(...) get512() #define __builtin_ia32_shufpd512_mask(...) get512d() #define __builtin_ia32_fixupimmpd512_maskz(x,...) x #define __builtin_ia32_fixupimmps512_mask(x,...) x #define __builtin_ia32_fixupimmps512_maskz(x,...) x #define __builtin_ia32_fixupimmpd512_mask(...) get512d() #define __builtin_ia32_fixupimmsd_maskz(x,...) x #define __builtin_ia32_fixupimmss_mask(x,...) x #define __builtin_ia32_fixupimmss_maskz(x,...) x #define __builtin_ia32_fixupimmsd_mask(...) get128d() #define __builtin_ia32_movsldup512_mask(x,...) x #define __builtin_ia32_movshdup512_mask(...) get512() #define __builtin_ia32_punpckhqdq512_mask(x,...) x #define __builtin_ia32_punpckhdq512_mask(...) get512i() #define __builtin_ia32_punpcklqdq512_mask(x,...) x #define __builtin_ia32_punpckldq512_mask(...) get512i() #define __builtin_ia32_vec_ext_v16qi(...) (0) #define __builtin_ia32_vcvtss2usi64(...) (0) #define __builtin_ia32_vcvtss2si64(...) (0) #define __builtin_ia32_vcvttss2usi64(...) (0) #define __builtin_ia32_vcvttss2si64(...) (0) #define __builtin_ia32_vcvtss2usi32(...) (0) #define __builtin_ia32_vcvtss2si32(...) (0) #define __builtin_ia32_vcvttss2usi32(...) (0) #define __builtin_ia32_vcvttss2si32(...) (0) #define __builtin_ia32_vcvtsd2usi64(...) (0) #define __builtin_ia32_vcvtsd2si64(...) (0) #define __builtin_ia32_vcvttsd2usi64(...) (0) #define __builtin_ia32_vcvttsd2si64(...) (0) #define __builtin_ia32_vcvtsd2usi32(...) (0) #define __builtin_ia32_vcvtsd2si32(...) (0) #define __builtin_ia32_movddup512_mask(x,...) x #define __builtin_ia32_unpcklpd512_mask(x,...) x #define __builtin_ia32_unpckhpd512_mask(x,...) x #define __builtin_ia32_vcvttsd2usi32(...) (0) #define __builtin_ia32_vcvttsd2si32(...) (0) #define __builtin_ia32_unpckhps512_mask(x,...) x #define __builtin_ia32_cvtsd2ss_round(x,...) x #define __builtin_ia32_cvtss2sd_round(x,...) x #define __builtin_ia32_movntdq512(x,...) x #define __builtin_ia32_cvtps2pd512_mask(...) get512d() #define __builtin_ia32_movntps512(x,...) x #define __builtin_ia32_movntpd512(x,...) x #define __builtin_ia32_getexpss128_round(x,...) x #define __builtin_ia32_getexpsd128_round(x,...) x #define __builtin_ia32_getexpps512_mask(x,...) x #define __builtin_ia32_getexppd512_mask(x,...) x #define __builtin_ia32_getmantpd512_mask(x,...) x #define __builtin_ia32_getmantps512_mask(x,...) x #define __builtin_ia32_getmantsd_round(x,...) x #define __builtin_ia32_getmantss_round(x,...) x #define __builtin_ia32_rndscaless_round(x,...) x #define __builtin_ia32_rndscalesd_round(x,...) x #define __builtin_ia32_gathersiv16sf(x,...) x #define __builtin_ia32_gathersiv8df(x,...) x #define __builtin_ia32_cmpsd_mask(...) getmask8() #define __builtin_ia32_cmpss_mask(...) getmask8() #define __builtin_ia32_gatherdiv16sf(x,...) x #define __builtin_ia32_gatherdiv8df(x,...) x #define __builtin_ia32_gathersiv16si(x,...) x #define __builtin_ia32_gathersiv8di(x,...) x #define __builtin_ia32_gatherdiv16si(x,...) x #define __builtin_ia32_gatherdiv8di(x,...) x #define __builtin_ia32_scattersiv16sf(x,...) x #define __builtin_ia32_scattersiv8df(x,...) x #define __builtin_ia32_scatterdiv16sf(x,...) x #define __builtin_ia32_scatterdiv8df(x,...) x #define __builtin_ia32_scattersiv16si(x,...) x #define __builtin_ia32_scattersiv8di(x,...) x #define __builtin_ia32_expanddf512_maskz(x,...) x #define __builtin_ia32_expandsf512_maskz(x,...) x #define __builtin_ia32_scatterdiv16si(x,...) x #define __builtin_ia32_scatterdiv8di(x,...) x #define __builtin_ia32_expanddi512_maskz(x,...) x #define __builtin_ia32_expandloaddi512_maskz(...) get512i() #define __builtin_ia32_expandsi512_maskz(x,...) x #define __builtin_ia32_unpcklps512_mask(x,...) x #define __builtin_ia32_vfmaddsd3_round(x,...) x #define __builtin_ia32_vfmaddss3_round(x,...) x #define __builtin_ia32_kmov16(x,...) x #define __builtin_ia32_exp2pd_mask(x,...) x #define __builtin_ia32_exp2ps_mask(x,...) x #define __builtin_ia32_rcp28pd_mask(x,...) x #define __builtin_ia32_rcp28ps_mask(x,...) x #define __builtin_ia32_rcp28sd_round(x,...) x #define __builtin_ia32_rcp28ss_round(x,...) x #define __builtin_ia32_rsqrt28pd_mask(x,...) x #define __builtin_ia32_rsqrt28ps_mask(x,...) x #define __builtin_ia32_rsqrt28sd_round(x,...) x #define __builtin_ia32_rsqrt28ss_round(x,...) x #define __builtin_ia32_gatherpfdpd(x,...) x #define __builtin_ia32_gatherpfdps(x,...) x #define __builtin_ia32_gatherpfqpd(x,...) x #define __builtin_ia32_gatherpfqps(x,...) x #define __builtin_ia32_pcmpistri128(...) (0) #define __builtin_ia32_pcmpestri128(...) (0) #define __builtin_ia32_pcmpistria128(...) (0) #define __builtin_ia32_pcmpistric128(...) (0) #define __builtin_ia32_pcmpistrio128(...) (0) #define __builtin_ia32_pcmpistris128(...) (0) #define __builtin_ia32_pcmpistriz128(...) (0) #define __builtin_ia32_pcmpestria128(...) (0) #define __builtin_ia32_pcmpestric128(...) (0) #define __builtin_ia32_pcmpestrio128(...) (0) #define __builtin_ia32_pcmpestris128(...) (0) #define __builtin_ia32_pcmpestriz128(...) (0) #define __builtin_ia32_vcomiss(...) (0) #define __builtin_ia32_vcomisd(...) (0) #define __builtin_ia32_sha1rnds4(x,...) x #define __builtin_ia32_vcvtps2ph(x,...) x #define __builtin_ia32_xabort(x,...) x #define __builtin_ia32_vprotbi(x,...) x #define __builtin_ia32_vprotwi(x,...) x #define __builtin_ia32_vpcomltub(x,...) x #define __builtin_ia32_vpcomleub(x,...) x #define __builtin_ia32_vpcomgtub(x,...) x #define __builtin_ia32_vprotdi(x,...) x #define __builtin_ia32_vprotqi(x,...) x #define __builtin_ia32_vcvtps2ph256(...) get128i() #define __builtin_ia32_vpcomgeub(x,...) x #define __builtin_ia32_vpcomequb(x,...) x #define __builtin_ia32_vpcomnequb(x,...) x #define __builtin_ia32_vpcomfalseub(x,...) x #define __builtin_ia32_vpcomtrueub(x,...) x #define __builtin_ia32_vpcomltuw(x,...) x #define __builtin_ia32_vpcomleuw(x,...) x #define __builtin_ia32_vpcomgtuw(x,...) x #define __builtin_ia32_vpcomgeuw(x,...) x #define __builtin_ia32_vpcomequw(x,...) x #define __builtin_ia32_vpcomnequw(x,...) x #define __builtin_ia32_vpcomfalseuw(x,...) x #define __builtin_ia32_vpcomtrueuw(x,...) x #define __builtin_ia32_vpcomltud(x,...) x #define __builtin_ia32_vpcomleud(x,...) x #define __builtin_ia32_vpcomgtud(x,...) x #define __builtin_ia32_vpcomgeud(x,...) x #define __builtin_ia32_vpcomequd(x,...) x #define __builtin_ia32_vpcomnequd(x,...) x #define __builtin_ia32_vpcomfalseud(x,...) x #define __builtin_ia32_vpcomtrueud(x,...) x #define __builtin_ia32_vpcomltuq(x,...) x #define __builtin_ia32_vpcomleuq(x,...) x #define __builtin_ia32_vpcomgtuq(x,...) x #define __builtin_ia32_vpcomgeuq(x,...) x #define __builtin_ia32_vpcomequq(x,...) x #define __builtin_ia32_vpcomnequq(x,...) x #define __builtin_ia32_vpcomfalseuq(x,...) x #define __builtin_ia32_vpcomtrueuq(x,...) x #define __builtin_ia32_vpcomltb(x,...) x #define __builtin_ia32_vpcomleb(x,...) x #define __builtin_ia32_vpcomgtb(x,...) x #define __builtin_ia32_vpcomgeb(x,...) x #define __builtin_ia32_vpcomeqb(x,...) x #define __builtin_ia32_vpcomneqb(x,...) x #define __builtin_ia32_vpcomfalseb(x,...) x #define __builtin_ia32_vpcomtrueb(x,...) x #define __builtin_ia32_vpcomltw(x,...) x #define __builtin_ia32_vpcomlew(x,...) x #define __builtin_ia32_vpcomgtw(x,...) x #define __builtin_ia32_vpcomgew(x,...) x #define __builtin_ia32_vpcomeqw(x,...) x #define __builtin_ia32_vpcomneqw(x,...) x #define __builtin_ia32_vpcomfalsew(x,...) x #define __builtin_ia32_vpcomtruew(x,...) x #define __builtin_ia32_vpcomltd(x,...) x #define __builtin_ia32_vpcomled(x,...) x #define __builtin_ia32_vpcomgtd(x,...) x #define __builtin_ia32_vpcomged(x,...) x #define __builtin_ia32_vpcomeqd(x,...) x #define __builtin_ia32_vpcomneqd(x,...) x #define __builtin_ia32_vpcomfalsed(x,...) x #define __builtin_ia32_vpcomtrued(x,...) x #define __builtin_ia32_vpcomltq(x,...) x #define __builtin_ia32_vpcomleq(x,...) x #define __builtin_ia32_vpcomgtq(x,...) x #define __builtin_ia32_vpcomgeq(x,...) x #define __builtin_ia32_vpcomeqq(x,...) x #define __builtin_ia32_vpcomneqq(x,...) x #define __builtin_ia32_vpcomfalseq(x,...) x #define __builtin_ia32_vpcomtrueq(x,...) x #define __builtin_ia32_lwpval32(x,...) x #define __builtin_ia32_lwpval64(x,...) x #define __builtin_ia32_vpermil2pd(x,...) x #define __builtin_ia32_vpermil2pd256(x,...) x #define __builtin_ia32_vpermil2ps(x,...) x #define __builtin_ia32_vpermil2ps256(x,...) x #define __builtin_ia32_lwpins32(x,...) x #define __builtin_ia32_lwpins64(x,...) x #define __builtin_ia32_bextri_u32(x,...) x #define __builtin_ia32_bextri_u64(x,...) x #define __builtin_ia32_rdseed_hi_step(...) (0) #define __builtin_ia32_rdseed_si_step(...) (0) #define __builtin_ia32_rdseed_di_step(...) (0) #define __builtin_ia32_scatterpfdps(...) #define __builtin_ia32_scatterpfdpd(...) #define __builtin_ia32_scatterpfqpd(...) #define __builtin_ia32_scatterpfqps(...) #define __builtin_ia32_expandloaddf512_maskz(...) get512d() #define __builtin_ia32_expandloadsf512_maskz(...) get512() #define __builtin_ia32_expandloadsi512_maskz(...) get512i() struct clangFloat128Fix {}; #endif
39.424565
71
0.780964
c5f094de6d82c8a566a72e31bb39830153158d4b
3,049
h
C
src/cpp/flann/mpi/queries.h
jerrycxj/flann
1d04523268c388dabf1c0865d69e1b638c8c7d9d
[ "BSD-3-Clause" ]
1,396
2015-01-02T20:05:22.000Z
2021-04-10T20:18:54.000Z
src/cpp/flann/mpi/queries.h
zcmacbeth/flann
06a49513138009d19a1f4e0ace67fbff13270c69
[ "BSD-3-Clause" ]
237
2015-02-20T18:50:16.000Z
2022-01-18T05:21:48.000Z
src/cpp/flann/mpi/queries.h
zcmacbeth/flann
06a49513138009d19a1f4e0ace67fbff13270c69
[ "BSD-3-Clause" ]
495
2015-01-02T20:05:28.000Z
2021-04-12T07:36:41.000Z
/*********************************************************************** * Software License Agreement (BSD License) * * Copyright 2008-2011 Marius Muja (mariusm@cs.ubc.ca). All rights reserved. * Copyright 2008-2011 David G. Lowe (lowe@cs.ubc.ca). All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *************************************************************************/ #ifndef MPI_QUERIES_H_ #define MPI_QUERIES_H_ #include <flann/mpi/matrix.h> #include <boost/archive/binary_iarchive.hpp> #include <boost/archive/binary_oarchive.hpp> #include <boost/asio.hpp> namespace flann { template<typename T> struct Request { flann::Matrix<T> queries; int nn; int checks; template<typename Archive> void serialize(Archive& ar, const unsigned int version) { ar & queries & nn & checks; } }; template<typename T> struct Response { flann::Matrix<int> indices; flann::Matrix<T> dists; template<typename Archive> void serialize(Archive& ar, const unsigned int version) { ar & indices & dists; } }; using boost::asio::ip::tcp; template <typename T> void read_object(tcp::socket& sock, T& val) { uint32_t size; boost::asio::read(sock, boost::asio::buffer(&size, sizeof(size))); size = ntohl(size); boost::asio::streambuf archive_stream; boost::asio::read(sock, archive_stream, boost::asio::transfer_at_least(size)); boost::archive::binary_iarchive archive(archive_stream); archive >> val; } template <typename T> void write_object(tcp::socket& sock, const T& val) { boost::asio::streambuf archive_stream; boost::archive::binary_oarchive archive(archive_stream); archive << val; uint32_t size = archive_stream.size(); size = htonl(size); boost::asio::write(sock, boost::asio::buffer(&size, sizeof(size))); boost::asio::write(sock, archive_stream); } } #endif /* MPI_QUERIES_H_ */
29.317308
79
0.706789
a9d4b23ea78501175f5ce14999ff4818e9e8ac00
500
c
C
workspace/uclibc-ng-master/libc/sysdeps/linux/common/close.c
maydali28/toolchain-cross-compile
254cfed3074532ff01c63259b4ea43b1cdf8b968
[ "MIT" ]
null
null
null
workspace/uclibc-ng-master/libc/sysdeps/linux/common/close.c
maydali28/toolchain-cross-compile
254cfed3074532ff01c63259b4ea43b1cdf8b968
[ "MIT" ]
null
null
null
workspace/uclibc-ng-master/libc/sysdeps/linux/common/close.c
maydali28/toolchain-cross-compile
254cfed3074532ff01c63259b4ea43b1cdf8b968
[ "MIT" ]
null
null
null
/* * close() for uClibc * * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <sys/syscall.h> #include <unistd.h> #include <cancel.h> #define __NR___close_nocancel __NR_close _syscall1(int, __NC(close), int, fd) #define __NR___close_nocancel_no_status __NR_close _syscall_noerr1(void, __close_nocancel_no_status, int, fd) CANCELLABLE_SYSCALL(int, close, (int fd), (fd)) lt_libc_hidden(close)
23.809524
74
0.752
e738ec06c7650e4503fa796b0552c049562b7bed
440
h
C
Bathchat/Bathchat.h
bathchat/bathchat
f7df7bef8b752caad5dbbabeed4a8e80b205277d
[ "MIT" ]
1
2015-01-06T09:29:47.000Z
2015-01-06T09:29:47.000Z
Bathchat/Bathchat.h
bathchat/bathchat
f7df7bef8b752caad5dbbabeed4a8e80b205277d
[ "MIT" ]
null
null
null
Bathchat/Bathchat.h
bathchat/bathchat
f7df7bef8b752caad5dbbabeed4a8e80b205277d
[ "MIT" ]
null
null
null
// // Bathchat.h // Bathchat // // Created by Derek Schultz on 4/26/14. // Copyright (c) 2014 Bathchat LLC. All rights reserved. // #ifndef Bathchat_Bathchat_h #define Bathchat_Bathchat_h #import <CoreLocation/CoreLocation.h> #import <Parse/Parse.h> #import <UIKit/UIKit.h> #import "BCDefines.h" #import "BCViewController.h" #import "BCTableViewController.h" #import "BCEditPhotoViewController.h" #import "BCInboxViewCell.h" #endif
19.130435
57
0.745455
a15c6ac97f89d6e1a17777323ff225dd5053def9
3,121
h
C
hhcards/Classes/PokerStateDeal.h
duhone/HeadstoneHarryCards
1a08d671835c659e543faca238a5661b4b59262f
[ "MIT" ]
1
2020-02-06T16:11:02.000Z
2020-02-06T16:11:02.000Z
hhcards/Classes/PokerStateDeal.h
duhone/HeadstoneHarryCards
1a08d671835c659e543faca238a5661b4b59262f
[ "MIT" ]
null
null
null
hhcards/Classes/PokerStateDeal.h
duhone/HeadstoneHarryCards
1a08d671835c659e543faca238a5661b4b59262f
[ "MIT" ]
null
null
null
/* * PokerStateDeal.h * hhcards * * Created by Eric Duhon on 3/8/10. * Copyright 2010 Apple Inc. All rights reserved. * */ #pragma once #include "PokerHand.h" #include "Graphics.h" #include "PokerState.h" #include "Timer.h" #include "Math.h" namespace CR { namespace HHCards { template<typename DeckType> class PokerStateDeal : public PokerState { struct Animation { CR::Math::Vector3F StartPosition; CR::Math::Vector3F EndPosition; CR::Math::Vector3F CurrentPosition; float StartAngle; float EndAngle; float CurrentAngle; void Tick(float _percent) { CurrentPosition = ((EndPosition-StartPosition)*_percent)+StartPosition; CurrentAngle = ((EndAngle-StartAngle)*_percent)+StartAngle; } }; public: PokerStateDeal(CR::Cards::PokerHand<DeckType> &_hand,std::vector<CR::Graphics::Sprite*> &_sprites,int _nextState); virtual bool CanDeal() {return false;} private: typedef CR::Cards::PokerHand<DeckType> HandType; virtual bool Begin(); virtual int Process(); const static float c_totalTime = 1.0; const static float c_invTotalTime = 1/1.0; CR::Cards::PokerHand<DeckType> &m_hand; std::vector<CR::Graphics::Sprite*> &m_sprites; CR::Utility::Timer m_timer; int m_nextState; Animation m_animation[HandType::NumCards]; }; template<typename DeckType> PokerStateDeal<DeckType>::PokerStateDeal(CR::Cards::PokerHand<DeckType> &_hand,std::vector<CR::Graphics::Sprite*> &_sprites,int _nextState) : m_hand(_hand), m_sprites(_sprites), m_nextState(_nextState) { } template<typename DeckType> bool PokerStateDeal<DeckType>::Begin() { for(int i = 0;i < m_sprites.size(); ++i) { m_sprites[i]->Visible(true); } m_timer.Reset(); for (int i = 0; i < HandType::NumCards; ++i) { m_animation[i].StartPosition.Set(512-44.0f,-50.0f,0); m_animation[i].EndPosition.Set(187+i*160.0f,430.0f,0); m_animation[i].StartAngle = ((rand()%1000)/1000.0f)*6.28f; m_animation[i].EndAngle = (((rand()%1000)/1000.0f)*0.1f)-0.05f+6.28f*4; m_animation[i].Tick(0); } for(int i = 0;i < m_sprites.size(); ++i) { m_sprites[i]->SetPositionAbsolute(m_animation[i].CurrentPosition.X(),m_animation[i].CurrentPosition.Y()); m_sprites[i]->RotateZ(m_animation[i].CurrentAngle); } return true; } template<typename DeckType> int PokerStateDeal<DeckType>::Process() { m_timer.Update(); float percentDone = 1.0f - (c_totalTime-m_timer.GetTotalTime())*c_invTotalTime; percentDone = std::max(percentDone,0.0f); percentDone = std::min(percentDone,1.0f); for (int i = 0; i < HandType::NumCards; ++i) { m_animation[i].Tick(percentDone); } for(int i = 0;i < m_sprites.size(); ++i) { m_sprites[i]->SetPositionAbsolute(m_animation[i].CurrentPosition.X(),m_animation[i].CurrentPosition.Y()); m_sprites[i]->RotateZ(m_animation[i].CurrentAngle); } if(m_timer.GetTotalTime() > c_totalTime) return m_nextState; else return UNCHANGED; } } }
25.373984
144
0.658122
a2b00a050d6c055f5b22dd93050b63e171f5af17
945
h
C
wmic_visual/Source/Model/Memory.h
leandrocadete/hardware_info
58ce08799ca5e1c3ab196991739d7cfc4f758f33
[ "MIT" ]
null
null
null
wmic_visual/Source/Model/Memory.h
leandrocadete/hardware_info
58ce08799ca5e1c3ab196991739d7cfc4f758f33
[ "MIT" ]
null
null
null
wmic_visual/Source/Model/Memory.h
leandrocadete/hardware_info
58ce08799ca5e1c3ab196991739d7cfc4f758f33
[ "MIT" ]
null
null
null
#ifndef MEMORY_H #define MEMORY_H #include <list> #include "win32.h" #include "PhysicalMemory.h" class Memory { private: uint64_t maxSize; uint64_t freeSpace; uint64_t usage; list<PhysicalMemory*> memories; void calculate() { list<PhysicalMemory*>::iterator iter; list<PhysicalMemory*>::iterator endIter; iter = memories.begin(); endIter = memories.end(); uint64_t capacity = 0; while (iter != endIter) { capacity += (*iter)->getCapacity(); } maxSize = capacity; } public: Memory() {} ~Memory() {} list<PhysicalMemory*> getPhysicalMemories() { return memories; } uint64_t getMaxSize() { return maxSize; } uint64_t getFreeSpace() { return freeSpace; } uint64_t getUsage() { return usage; } void setPhysicalMemories(list<PhysicalMemory*> v) { memories = v; } void setMaxSize(uint64_t v) { maxSize = v; } void setFreeSpace(uint64_t v) { freeSpace = v; } void setUsage(uint64_t v) { usage = v; } }; #endif
21.976744
68
0.69418
c830fea8c6f24ccfd0b100349c3270959c78af4c
334
h
C
source/Core/Debugger/moeDebugger.h
Scylardor/Monocle2
ff894b7065c589a1cba8093468ab9fae26db41e0
[ "BSD-3-Clause" ]
null
null
null
source/Core/Debugger/moeDebugger.h
Scylardor/Monocle2
ff894b7065c589a1cba8093468ab9fae26db41e0
[ "BSD-3-Clause" ]
null
null
null
source/Core/Debugger/moeDebugger.h
Scylardor/Monocle2
ff894b7065c589a1cba8093468ab9fae26db41e0
[ "BSD-3-Clause" ]
null
null
null
#ifndef MOE_DEBUGGER_H_ #define MOE_DEBUGGER_H_ #ifndef MOE_SHIPPING #include "Monocle_Core_Export.h" namespace moe { bool IsDebuggerPresent(); // DebugBreak returns false only so ASSERT can be used in an if... bool Monocle_Core_API DebugBreak(); } #endif // MOE_SHIPPING #endif // MOE_DEBUGGER_H_
17.578947
70
0.706587
c8620c9918fecd8f6a9c2cd1ee19bb17547d37f7
129
h
C
3rdparties/macos/sdl/include/SDL_test_memory.h
slowbrowser/slowbowser
ee644b46fa9d7266fca75ec77296ed00fce30902
[ "MIT" ]
null
null
null
3rdparties/macos/sdl/include/SDL_test_memory.h
slowbrowser/slowbowser
ee644b46fa9d7266fca75ec77296ed00fce30902
[ "MIT" ]
15
2022-03-14T22:08:18.000Z
2022-03-18T14:40:06.000Z
3rdparties/macos/sdl/include/SDL_test_memory.h
slowbrowser/slowbrowser
ee644b46fa9d7266fca75ec77296ed00fce30902
[ "MIT" ]
null
null
null
version https://git-lfs.github.com/spec/v1 oid sha256:58eed9203063f53ce4543450bc0ceab761f3873109beb8342ab7ad8a1249d893 size 1787
32.25
75
0.883721
838e70c4afdf58c8e67fc2328bb31101962e730c
895
h
C
owGame/DBC/Tables/DBC_CharacterFacialHairStyles.h
Chaos192/OpenWow
1d91a51fafeedadc67122a3e9372ec4637a48434
[ "Apache-2.0" ]
30
2017-09-02T20:25:47.000Z
2021-12-31T10:12:07.000Z
owGame/DBC/Tables/DBC_CharacterFacialHairStyles.h
Chaos192/OpenWow
1d91a51fafeedadc67122a3e9372ec4637a48434
[ "Apache-2.0" ]
null
null
null
owGame/DBC/Tables/DBC_CharacterFacialHairStyles.h
Chaos192/OpenWow
1d91a51fafeedadc67122a3e9372ec4637a48434
[ "Apache-2.0" ]
23
2018-02-04T17:18:33.000Z
2022-03-22T09:45:36.000Z
#pragma once #include "DBC/DBC__File.h" DBC_DEF_BEGIN(DBC_CharacterFacialHairStyles) #if WOW_CLIENT_VERSION == WOW_CLASSIC_1_12_1 __DBC_TVALUE(uint32, Race, 1); __DBC_TVALUE(uint32, Gender, 2); __DBC_TVALUE(uint32, Variation, 3); __DBC_TVALUE(uint32, Group_01xx, 4); // BeardGeoset __DBC_TVALUE(uint32, Group_03xx, 5); // MoustacheGeoset __DBC_TVALUE(uint32, Group_02xx, 6); // SideburnGeoset __DBC_TVALUE(uint32, Other0, 7); __DBC_TVALUE(uint32, Other1, 8); __DBC_TVALUE(uint32, Other2, 9); #else __DBC_TVALUE(uint32, Race, 1); __DBC_TVALUE(uint32, Gender, 2); __DBC_TVALUE(uint32, Variation, 3); __DBC_TVALUE(uint32, Group_01xx, 4); // BeardGeoset __DBC_TVALUE(uint32, Group_03xx, 5); // MoustacheGeoset __DBC_TVALUE(uint32, Group_02xx, 6); // SideburnGeoset __DBC_TVALUE(uint32, Group_16xx, 6); // SideburnGeoset __DBC_TVALUE(uint32, Group_17xx, 6); // SideburnGeoset #endif DBC_DEF_END
29.833333
55
0.778771
d3f408699ffa1db37451e1e3b37702eafc73bac2
534
h
C
ionAnimation/CLinearSplineInterpolator.h
iondune/ionEngine
7ce3394dafbabf0e0bb9f5d07dbfae31161800d4
[ "MIT" ]
36
2015-06-28T14:53:06.000Z
2021-10-31T04:26:53.000Z
ionAnimation/CLinearSplineInterpolator.h
iondune/ionEngine
7ce3394dafbabf0e0bb9f5d07dbfae31161800d4
[ "MIT" ]
90
2015-05-01T07:21:43.000Z
2017-08-30T01:16:41.000Z
ionAnimation/CLinearSplineInterpolator.h
iondune/ionEngine
7ce3394dafbabf0e0bb9f5d07dbfae31161800d4
[ "MIT" ]
9
2016-04-08T07:48:02.000Z
2019-07-22T15:13:53.000Z
#pragma once #include "ISplineInterpolator.h" namespace ion { namespace Animation { template <typename T> class CLinearSplineInterpolator : public ISplineInterpolator<T> { public: virtual T Interpolate(ISpline<T> const & Path, int const Index, float const Mu); }; template <typename T> T CLinearSplineInterpolator<T>::Interpolate(ISpline<T> const & Path, int const Index, float const Mu) { return Path.GetNode(Index) * (1.f - Mu) + Path.GetNode(Index + 1) * Mu; } } }
17.8
104
0.653558
2334bf8a650a16a35d5849a4b6c309d5f19eb1f1
830
c
C
linsched-linsched-alpha/arch/arm/kernel/pmu.c
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
47
2015-03-10T23:21:52.000Z
2022-02-17T01:04:14.000Z
linsched-linsched-alpha/arch/arm/kernel/pmu.c
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
1
2017-05-26T04:28:56.000Z
2017-08-13T12:12:31.000Z
linsched-linsched-alpha/arch/arm/kernel/pmu.c
usenixatc2021/SoftRefresh_Scheduling
589ba06c8ae59538973c22edf28f74a59d63aa14
[ "MIT" ]
19
2015-02-25T19:50:05.000Z
2021-10-05T14:35:54.000Z
/* * linux/arch/arm/kernel/pmu.c * * Copyright (C) 2009 picoChip Designs Ltd, Jamie Iles * Copyright (C) 2010 ARM Ltd, Will Deacon * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */ #include <linux/err.h> #include <linux/kernel.h> #include <linux/module.h> #include <asm/pmu.h> /* * PMU locking to ensure mutual exclusion between different subsystems. */ static unsigned long pmu_lock[BITS_TO_LONGS(ARM_NUM_PMU_DEVICES)]; int reserve_pmu(enum arm_pmu_type type) { return test_and_set_bit_lock(type, pmu_lock) ? -EBUSY : 0; } EXPORT_SYMBOL_GPL(reserve_pmu); void release_pmu(enum arm_pmu_type type) { clear_bit_unlock(type, pmu_lock); } EXPORT_SYMBOL_GPL(release_pmu);
22.432432
71
0.748193
234def531a06041fb63b1a48adbebe43225fbb3e
637
c
C
EXAMS/2015-02-25/q2.c
samueleallegranza/polimi-info
66947c3c5b4a8d14def53194ee7d6b0f6088ffb6
[ "MIT" ]
null
null
null
EXAMS/2015-02-25/q2.c
samueleallegranza/polimi-info
66947c3c5b4a8d14def53194ee7d6b0f6088ffb6
[ "MIT" ]
null
null
null
EXAMS/2015-02-25/q2.c
samueleallegranza/polimi-info
66947c3c5b4a8d14def53194ee7d6b0f6088ffb6
[ "MIT" ]
null
null
null
#include <stdio.h> int main(int argc, char * argv[]) { float real, max, min, avg, sum; int count; scanf("%f", &real); if(real != 0) { max = real; min = real; sum = real; count = 1; scanf("%f", &real); while(real != 0) { count++; sum += real; if(real > max) {max = real;} if(real < min) {min = real;} scanf("%f", &real); } avg = sum/count; printf("Max: %.2f\nMin: %.2f\nAvg: %.2f\n", max, min, avg); } else { printf("Not enough data.\n"); } return 0; }
21.965517
68
0.403454
23b16f5e6383a332f31b5e23fc8673dc5a252a11
4,722
h
C
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h
zyndor/dali-toolkit
9e3fd659c4d25706ab65345bc7c562ac27248325
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h
zyndor/dali-toolkit
9e3fd659c4d25706ab65345bc7c562ac27248325
[ "Apache-2.0", "BSD-3-Clause" ]
1
2020-10-19T15:47:43.000Z
2020-10-19T15:47:43.000Z
dali-toolkit/internal/visuals/wireframe/wireframe-visual.h
zyndor/dali-toolkit
9e3fd659c4d25706ab65345bc7c562ac27248325
[ "Apache-2.0", "BSD-3-Clause" ]
null
null
null
#ifndef DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H #define DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H /* * Copyright (c) 2019 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ // EXTERNAL INCLUDES #include <dali/public-api/common/intrusive-ptr.h> // INTERNAL INCLUDES #include <dali-toolkit/internal/visuals/visual-base-impl.h> namespace Dali { namespace Toolkit { namespace Internal { class WireframeVisual; typedef IntrusivePtr< WireframeVisual > WireframeVisualPtr; /** * @brief Renders a wireframe outline to the control's quad. */ class WireframeVisual: public Visual::Base { public: /** * @brief Create a new wireframe visual. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object * @param[in] properties A Property::Map containing settings for this visual * @return A smart-pointer to the newly allocated visual. */ static WireframeVisualPtr New( VisualFactoryCache& factoryCache, const Property::Map& properties ); /** * @brief Create a new wireframe visual with an encapsulated actual visual. * * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object * @param[in] actualVisual The encapsulated actual visual. * @return A smart-pointer to the newly allocated visual. */ static WireframeVisualPtr New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual ); /** * @brief Create a new wireframe visual with an encapsulated actual visual. * * For debugging purpose, the rendering of the encapsulated visual is replaced with wireframe * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object * @param[in] actualVisual The encapsulated actual visual. * @param[in] properties A Property::Map containing settings for this visual * @return A smart-pointer to the newly allocated visual. */ static WireframeVisualPtr New( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual, const Property::Map& properties ); protected: /** * @brief Constructor. * * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object * @param[in] actualVisual The encapsulated actual visual. */ WireframeVisual( VisualFactoryCache& factoryCache, Visual::BasePtr actualVisual ); /** * @brief A reference counted object may only be deleted by calling Unreference(). */ virtual ~WireframeVisual(); protected: // from Visual::Base /** * @copydoc Visual::Base::GetHeightForWidth() */ float GetHeightForWidth( float width ) override; /** * @copydoc Visual::Base::GetNaturalSize() */ void GetNaturalSize( Vector2& naturalSize ) override; /** * @copydoc Visual::Base::CreatePropertyMap() */ void DoCreatePropertyMap( Property::Map& map ) const override; /** * @copydoc Visual::Base::CreateInstancePropertyMap */ void DoCreateInstancePropertyMap( Property::Map& map ) const override; /** * @copydoc Visual::Base::DoSetProperties() */ void DoSetProperties( const Property::Map& propertyMap ) override; /** * @copydoc Visual::Base::DoSetOnScene */ void DoSetOnScene( Actor& actor ) override; /** * @copydoc Visual::Base::OnSetTransform */ void OnSetTransform() override; /** * @copydoc Visual::Base::GetVisualObject * * Overriding as this visual can sometimes act as a proxy to the actual visual, i.e. when using debug rendering. */ Base& GetVisualObject() override; private: /** * Create the geometry which presents the quad wireframe. * @return The border geometry */ Geometry CreateQuadWireframeGeometry(); /** * @brief Initialise the renderer from the cache, if not available, create and save to the cache for sharing. */ void InitializeRenderer(); // Undefined WireframeVisual( const WireframeVisual& visual); // Undefined WireframeVisual& operator=( const WireframeVisual& visual ); private: Visual::BasePtr mActualVisual; }; } // namespace Internal } // namespace Toolkit } // namespace Dali #endif // DALI_TOOLKIT_INTERNAL_WIREFRAME_VISUAL_H
27.940828
131
0.726811
fcd32cd2c2f2370809a8727377054068778d5f66
135
h
C
src/util/cartesian.h
zpooky/sputil
3eddf94655fe4ec5bc2a3b5e487a86d772b038ae
[ "Apache-2.0" ]
null
null
null
src/util/cartesian.h
zpooky/sputil
3eddf94655fe4ec5bc2a3b5e487a86d772b038ae
[ "Apache-2.0" ]
null
null
null
src/util/cartesian.h
zpooky/sputil
3eddf94655fe4ec5bc2a3b5e487a86d772b038ae
[ "Apache-2.0" ]
null
null
null
#ifndef SP_UTIL_UTIL_CARTESION_H #define SP_UTIL_UTIL_CARTESION_H namespace sp { // TODO in(arr,arr2,[](A1*one,A2*two){}); } #endif
13.5
41
0.733333
b337c2f2707b639908c0499b7ea3c38a32379ae4
165
c
C
C/URI 1006.c
LGUSTM/URI
553c62270aa7dd3f42ff0241ec5c190ef7eaa5b8
[ "MIT" ]
null
null
null
C/URI 1006.c
LGUSTM/URI
553c62270aa7dd3f42ff0241ec5c190ef7eaa5b8
[ "MIT" ]
null
null
null
C/URI 1006.c
LGUSTM/URI
553c62270aa7dd3f42ff0241ec5c190ef7eaa5b8
[ "MIT" ]
null
null
null
#include <stdio.h> int main() { float x,y,z; scanf("%f %f %f", &x, &y, &z); printf("MEDIA = %.1f\n", (x*2+y*3+z*5)/(2+3+5)); return 0; }
13.75
52
0.418182
e7e05585e33cf4e3bc69c8780fd53c6167da1c69
17,614
c
C
contrib/SDL-1.2.15/src/cdrom/aix/SDL_syscdrom.c
CronosTs/phobos3d
c0336456d946f3a9e62fb9b7815831ad32820da5
[ "Zlib" ]
33
2020-11-20T16:38:43.000Z
2021-10-17T04:21:44.000Z
contrib/SDL-1.2.15/src/cdrom/aix/SDL_syscdrom.c
CronosTs/phobos3d
c0336456d946f3a9e62fb9b7815831ad32820da5
[ "Zlib" ]
2
2020-11-21T00:32:37.000Z
2020-11-23T17:38:26.000Z
contrib/SDL-1.2.15/src/cdrom/aix/SDL_syscdrom.c
CronosTs/phobos3d
c0336456d946f3a9e62fb9b7815831ad32820da5
[ "Zlib" ]
5
2017-09-12T14:41:50.000Z
2019-11-18T03:04:41.000Z
/* SDL - Simple DirectMedia Layer Copyright (C) 1997-2012 Sam Lantinga This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Carsten Griwodz griff@kom.tu-darmstadt.de based on linux/SDL_syscdrom.c by Sam Lantinga */ #include "SDL_config.h" #ifdef SDL_CDROM_AIX /* Functions for system-level CD-ROM audio control */ /*#define DEBUG_CDROM 1*/ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <errno.h> #include <unistd.h> #include <sys/ioctl.h> #include <sys/devinfo.h> #include <sys/mntctl.h> #include <sys/statfs.h> #include <sys/vmount.h> #include <fstab.h> #include <sys/scdisk.h> #include "SDL_cdrom.h" #include "../SDL_syscdrom.h" /* The maximum number of CD-ROM drives we'll detect */ #define MAX_DRIVES 16 /* A list of available CD-ROM drives */ static char *SDL_cdlist[MAX_DRIVES]; static dev_t SDL_cdmode[MAX_DRIVES]; /* The system-dependent CD control functions */ static const char *SDL_SYS_CDName(int drive); static int SDL_SYS_CDOpen(int drive); static int SDL_SYS_CDGetTOC(SDL_CD *cdrom); static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position); static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length); static int SDL_SYS_CDPause(SDL_CD *cdrom); static int SDL_SYS_CDResume(SDL_CD *cdrom); static int SDL_SYS_CDStop(SDL_CD *cdrom); static int SDL_SYS_CDEject(SDL_CD *cdrom); static void SDL_SYS_CDClose(SDL_CD *cdrom); static int SDL_SYS_CDioctl(int id, int command, void *arg); /* Check a drive to see if it is a CD-ROM */ static int CheckDrive(char *drive, struct stat *stbuf) { int is_cd; int cdfd; int ret; struct devinfo info; /* If it doesn't exist, return -1 */ if ( stat(drive, stbuf) < 0 ) { return -1; } /* If it does exist, verify that it's an available CD-ROM */ is_cd = 0; if ( S_ISCHR(stbuf->st_mode) || S_ISBLK(stbuf->st_mode) ) { cdfd = open(drive, (O_RDONLY|O_EXCL|O_NONBLOCK), 0); if ( cdfd >= 0 ) { ret = SDL_SYS_CDioctl( cdfd, IOCINFO, &info ); if ( ret < 0 ) { /* Some kind of error */ is_cd = 0; } else { if ( info.devtype == DD_CDROM ) { is_cd = 1; } else { is_cd = 0; } } close(cdfd); } #ifdef DEBUG_CDROM else { fprintf(stderr, "Could not open drive %s (%s)\n", drive, strerror(errno)); } #endif } return is_cd; } /* Add a CD-ROM drive to our list of valid drives */ static void AddDrive(char *drive, struct stat *stbuf) { int i; if ( SDL_numcds < MAX_DRIVES ) { /* Check to make sure it's not already in our list. This can happen when we see a drive via symbolic link. */ for ( i=0; i<SDL_numcds; ++i ) { if ( stbuf->st_rdev == SDL_cdmode[i] ) { #ifdef DEBUG_CDROM fprintf(stderr, "Duplicate drive detected: %s == %s\n", drive, SDL_cdlist[i]); #endif return; } } /* Add this drive to our list */ i = SDL_numcds; SDL_cdlist[i] = SDL_strdup(drive); if ( SDL_cdlist[i] == NULL ) { SDL_OutOfMemory(); return; } SDL_cdmode[i] = stbuf->st_rdev; ++SDL_numcds; #ifdef DEBUG_CDROM fprintf(stderr, "Added CD-ROM drive: %s\n", drive); #endif } } static void CheckMounts() { char* buffer; int bufsz; struct vmount* ptr; int ret; buffer = (char*)SDL_malloc(10); bufsz = 10; if ( buffer==NULL ) { fprintf(stderr, "Could not allocate 10 bytes in aix/SDL_syscdrom.c:CheckMounts\n" ); exit ( -10 ); } do { /* mntctrl() returns an array of all mounted filesystems */ ret = mntctl ( MCTL_QUERY, bufsz, buffer ); if ( ret == 0 ) { /* Buffer was too small, realloc. */ bufsz = *(int*)buffer; /* Required size is in first word. */ /* (whatever a word is in AIX 4.3.3) */ /* int seems to be OK in 32bit mode. */ SDL_free(buffer); buffer = (char*)SDL_malloc(bufsz); if ( buffer==NULL ) { fprintf(stderr, "Could not allocate %d bytes in aix/SDL_syscdrom.c:CheckMounts\n", bufsz ); exit ( -10 ); } } else if ( ret < 0 ) { #ifdef DEBUG_CDROM fprintf(stderr, "Error reading vmount structures\n"); #endif return; } } while ( ret == 0 ); #ifdef DEBUG_CDROM fprintf ( stderr, "Read %d vmount structures\n",ret ); #endif ptr = (struct vmount*)buffer; do { switch(ptr->vmt_gfstype) { case MNT_CDROM : { struct stat stbuf; char* text; text = (char*)ptr + ptr->vmt_data[VMT_OBJECT].vmt_off; #ifdef DEBUG_CDROM fprintf(stderr, "Checking mount path: %s mounted on %s\n", text, (char*)ptr + ptr->vmt_data[VMT_STUB].vmt_off ); #endif if ( CheckDrive( text, &stbuf) > 0) { AddDrive( text, &stbuf); } } break; default : break; } ptr = (struct vmount*)((char*)ptr + ptr->vmt_length); ret--; } while ( ret > 0 ); free ( buffer ); } static int CheckNonmounts() { #ifdef _THREAD_SAFE AFILE_t fsFile = NULL; int passNo = 0; int ret; struct fstab entry; struct stat stbuf; ret = setfsent_r( &fsFile, &passNo ); if ( ret != 0 ) return -1; do { ret = getfsent_r ( &entry, &fsFile, &passNo ); if ( ret == 0 ) { char* l = SDL_strrchr(entry.fs_spec,'/'); if ( l != NULL ) { if ( !SDL_strncmp("cd",++l,2) ) { #ifdef DEBUG_CDROM fprintf(stderr, "Found unmounted CD ROM drive with device name %s\n", entry.fs_spec); #endif if ( CheckDrive( entry.fs_spec, &stbuf) > 0) { AddDrive( entry.fs_spec, &stbuf); } } } } } while ( ret == 0 ); ret = endfsent_r ( &fsFile ); if ( ret != 0 ) return -1; return 0; #else struct fstab* entry; struct stat stbuf; setfsent(); do { entry = getfsent(); if ( entry != NULL ) { char* l = SDL_strrchr(entry->fs_spec,'/'); if ( l != NULL ) { if ( !SDL_strncmp("cd",++l,2) ) { #ifdef DEBUG_CDROM fprintf(stderr,"Found unmounted CD ROM drive with device name %s", entry->fs_spec); #endif if ( CheckDrive( entry->fs_spec, &stbuf) > 0) { AddDrive( entry->fs_spec, &stbuf); } } } } } while ( entry != NULL ); endfsent(); #endif } int SDL_SYS_CDInit(void) { char *SDLcdrom; struct stat stbuf; /* Fill in our driver capabilities */ SDL_CDcaps.Name = SDL_SYS_CDName; SDL_CDcaps.Open = SDL_SYS_CDOpen; SDL_CDcaps.GetTOC = SDL_SYS_CDGetTOC; SDL_CDcaps.Status = SDL_SYS_CDStatus; SDL_CDcaps.Play = SDL_SYS_CDPlay; SDL_CDcaps.Pause = SDL_SYS_CDPause; SDL_CDcaps.Resume = SDL_SYS_CDResume; SDL_CDcaps.Stop = SDL_SYS_CDStop; SDL_CDcaps.Eject = SDL_SYS_CDEject; SDL_CDcaps.Close = SDL_SYS_CDClose; /* Look in the environment for our CD-ROM drive list */ SDLcdrom = SDL_getenv("SDL_CDROM"); /* ':' separated list of devices */ if ( SDLcdrom != NULL ) { char *cdpath, *delim; size_t len = SDL_strlen(SDLcdrom)+1; cdpath = SDL_stack_alloc(char, len); if ( cdpath != NULL ) { SDL_strlcpy(cdpath, SDLcdrom, len); SDLcdrom = cdpath; do { delim = SDL_strchr(SDLcdrom, ':'); if ( delim ) { *delim++ = '\0'; } #ifdef DEBUG_CDROM fprintf(stderr, "Checking CD-ROM drive from SDL_CDROM: %s\n", SDLcdrom); #endif if ( CheckDrive(SDLcdrom, &stbuf) > 0 ) { AddDrive(SDLcdrom, &stbuf); } if ( delim ) { SDLcdrom = delim; } else { SDLcdrom = NULL; } } while ( SDLcdrom ); SDL_stack_free(cdpath); } /* If we found our drives, there's nothing left to do */ if ( SDL_numcds > 0 ) { return(0); } } CheckMounts(); CheckNonmounts(); return 0; } /* General ioctl() CD-ROM command function */ static int SDL_SYS_CDioctl(int id, int command, void *arg) { int retval; retval = ioctl(id, command, arg); if ( retval < 0 ) { SDL_SetError("ioctl() error: %s", strerror(errno)); } return retval; } static const char *SDL_SYS_CDName(int drive) { return(SDL_cdlist[drive]); } static int SDL_SYS_CDOpen(int drive) { int fd; char* lastsl; char* cdromname; size_t len; /* * We found /dev/cd? drives and that is in our list. But we can * open only the /dev/rcd? versions of those devices for Audio CD. */ len = SDL_strlen(SDL_cdlist[drive])+2; cdromname = (char*)SDL_malloc(len); SDL_strlcpy(cdromname,SDL_cdlist[drive],len); lastsl = SDL_strrchr(cdromname,'/'); if (lastsl) { *lastsl = 0; SDL_strlcat(cdromname,"/r",len); lastsl = SDL_strrchr(SDL_cdlist[drive],'/'); if (lastsl) { lastsl++; SDL_strlcat(cdromname,lastsl,len); } } #ifdef DEBUG_CDROM fprintf(stderr, "Should open drive %s, opening %s\n", SDL_cdlist[drive], cdromname); #endif /* * Use exclusive access. Don't use SC_DIAGNOSTICS as xmcd does because they * require root priviledges, and we don't want that. SC_SINGLE provides * exclusive access with less trouble. */ fd = openx(cdromname, O_RDONLY, NULL, SC_SINGLE); if ( fd < 0 ) { #ifdef DEBUG_CDROM fprintf(stderr, "Could not open drive %s (%s)\n", cdromname, strerror(errno)); #endif } else { struct mode_form_op cdMode; int ret; #ifdef DEBUG_CDROM cdMode.action = CD_GET_MODE; ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode); if ( ret < 0 ) { fprintf(stderr, "Could not get drive mode for %s (%s)\n", cdromname, strerror(errno)); } else { switch(cdMode.cd_mode_form) { case CD_MODE1 : fprintf(stderr, "Drive mode for %s is %s\n", cdromname, "CD-ROM Data Mode 1"); break; case CD_MODE2_FORM1 : fprintf(stderr, "Drive mode for %s is %s\n", cdromname, "CD-ROM XA Data Mode 2 Form 1"); break; case CD_MODE2_FORM2 : fprintf(stderr, "Drive mode for %s is %s\n", cdromname, "CD-ROM XA Data Mode 2 Form 2"); break; case CD_DA : fprintf(stderr, "Drive mode for %s is %s\n", cdromname, "CD-DA"); break; default : fprintf(stderr, "Drive mode for %s is %s\n", cdromname, "unknown"); break; } } #endif cdMode.action = CD_CHG_MODE; cdMode.cd_mode_form = CD_DA; ret = SDL_SYS_CDioctl(fd, DK_CD_MODE, &cdMode); if ( ret < 0 ) { #ifdef DEBUG_CDROM fprintf(stderr, "Could not set drive mode for %s (%s)\n", cdromname, strerror(errno)); #endif SDL_SetError("ioctl() error: Could not set CD drive mode, %s", strerror(errno)); } else { #ifdef DEBUG_CDROM fprintf(stderr, "Drive mode for %s set to CD_DA\n", cdromname); #endif } } SDL_free(cdromname); return fd; } static int SDL_SYS_CDGetTOC(SDL_CD *cdrom) { struct cd_audio_cmd cmd; struct cd_audio_cmd entry; int i; int okay; cmd.audio_cmds = CD_TRK_INFO_AUDIO; cmd.msf_flag = FALSE; if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) { return -1; } okay = 0; cdrom->numtracks = cmd.indexing.track_index.last_track - cmd.indexing.track_index.first_track+1; if ( cdrom->numtracks > SDL_MAX_TRACKS ) { cdrom->numtracks = SDL_MAX_TRACKS; } /* Read all the track TOC entries */ for ( i=0; i<=cdrom->numtracks; ++i ) { if ( i == cdrom->numtracks ) { cdrom->track[i].id = 0xAA;; } else { cdrom->track[i].id = cmd.indexing.track_index.first_track+i; } entry.audio_cmds = CD_GET_TRK_MSF; entry.indexing.track_msf.track = cdrom->track[i].id; if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &entry) < 0 ) { break; } else { cdrom->track[i].type = 0; /* don't know how to detect 0x04 data track */ cdrom->track[i].offset = MSF_TO_FRAMES( entry.indexing.track_msf.mins, entry.indexing.track_msf.secs, entry.indexing.track_msf.frames); cdrom->track[i].length = 0; if ( i > 0 ) { cdrom->track[i-1].length = cdrom->track[i].offset - cdrom->track[i-1].offset; } } } if ( i == (cdrom->numtracks+1) ) { okay = 1; } return(okay ? 0 : -1); } /* Get CD-ROM status */ static CDstatus SDL_SYS_CDStatus(SDL_CD *cdrom, int *position) { CDstatus status; struct cd_audio_cmd cmd; cmd.audio_cmds = CD_INFO_AUDIO; if ( SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd) < 0 ) { #ifdef DEBUG_CDROM fprintf(stderr, "ioctl failed in SDL_SYS_CDStatus (%s)\n", SDL_GetError()); #endif status = CD_ERROR; } else { switch (cmd.status) { case CD_NO_AUDIO: case CD_COMPLETED: status = CD_STOPPED; break; case CD_PLAY_AUDIO: status = CD_PLAYING; break; case CD_PAUSE_AUDIO: status = CD_PAUSED; break; case CD_NOT_VALID: #ifdef DEBUG_CDROM fprintf(stderr, "cdStatus failed with CD_NOT_VALID\n"); #endif status = CD_ERROR; break; case CD_STATUS_ERROR: #ifdef DEBUG_CDROM fprintf(stderr, "cdStatus failed with CD_STATUS_ERROR\n"); #endif status = CD_ERROR; break; default: #ifdef DEBUG_CDROM fprintf(stderr, "cdStatus failed with unknown error\n"); #endif status = CD_ERROR; break; } } if ( position ) { if ( status == CD_PLAYING || (status == CD_PAUSED) ) { *position = MSF_TO_FRAMES( cmd.indexing.info_audio.current_mins, cmd.indexing.info_audio.current_secs, cmd.indexing.info_audio.current_frames); } else { *position = 0; } } return status; } /* Start play */ static int SDL_SYS_CDPlay(SDL_CD *cdrom, int start, int length) { struct cd_audio_cmd cmd; /* * My CD Rom is muted by default. I think I read that this is new with * AIX 4.3. SDL does not change the volume, so I need a kludge. Maybe * its better to do this elsewhere? */ cmd.audio_cmds = CD_PLAY_AUDIO | CD_SET_VOLUME; cmd.msf_flag = TRUE; FRAMES_TO_MSF(start, &cmd.indexing.msf.first_mins, &cmd.indexing.msf.first_secs, &cmd.indexing.msf.first_frames); FRAMES_TO_MSF(start+length, &cmd.indexing.msf.last_mins, &cmd.indexing.msf.last_secs, &cmd.indexing.msf.last_frames); cmd.volume_type = CD_VOLUME_ALL; cmd.all_channel_vol = 255; /* This is a uchar. What is a good value? No docu! */ cmd.out_port_0_sel = CD_AUDIO_CHNL_0; cmd.out_port_1_sel = CD_AUDIO_CHNL_1; cmd.out_port_2_sel = CD_AUDIO_CHNL_2; cmd.out_port_3_sel = CD_AUDIO_CHNL_3; #ifdef DEBUG_CDROM fprintf(stderr, "Trying to play from %d:%d:%d to %d:%d:%d\n", cmd.indexing.msf.first_mins, cmd.indexing.msf.first_secs, cmd.indexing.msf.first_frames, cmd.indexing.msf.last_mins, cmd.indexing.msf.last_secs, cmd.indexing.msf.last_frames); #endif return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); } /* Pause play */ static int SDL_SYS_CDPause(SDL_CD *cdrom) { struct cd_audio_cmd cmd; cmd.audio_cmds = CD_PAUSE_AUDIO; return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); } /* Resume play */ static int SDL_SYS_CDResume(SDL_CD *cdrom) { struct cd_audio_cmd cmd; cmd.audio_cmds = CD_RESUME_AUDIO; return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); } /* Stop play */ static int SDL_SYS_CDStop(SDL_CD *cdrom) { struct cd_audio_cmd cmd; cmd.audio_cmds = CD_STOP_AUDIO; return(SDL_SYS_CDioctl(cdrom->id, DKAUDIO, &cmd)); } /* Eject the CD-ROM */ static int SDL_SYS_CDEject(SDL_CD *cdrom) { return(SDL_SYS_CDioctl(cdrom->id, DKEJECT, 0)); } /* Close the CD-ROM handle */ static void SDL_SYS_CDClose(SDL_CD *cdrom) { close(cdrom->id); } void SDL_SYS_CDQuit(void) { int i; if ( SDL_numcds > 0 ) { for ( i=0; i<SDL_numcds; ++i ) { SDL_free(SDL_cdlist[i]); } SDL_numcds = 0; } } #endif /* SDL_CDROM_AIX */
26.647504
103
0.585216
1b383d43f1f1e094f94e98bfc12227b3a9f52355
2,391
h
C
src/sources/PhotonWindow.h
waddlesplash/Photon
a93eeed8c156bde5f3721f74ebe7c21aa7e12459
[ "BSD-3-Clause" ]
4
2017-06-13T22:51:50.000Z
2019-04-19T20:02:27.000Z
src/sources/PhotonWindow.h
waddlesplash/Photon
a93eeed8c156bde5f3721f74ebe7c21aa7e12459
[ "BSD-3-Clause" ]
null
null
null
src/sources/PhotonWindow.h
waddlesplash/Photon
a93eeed8c156bde5f3721f74ebe7c21aa7e12459
[ "BSD-3-Clause" ]
1
2020-10-26T09:00:17.000Z
2020-10-26T09:00:17.000Z
#ifndef NAT_WINDOW_H #define NAT_WINDOW_H #include "PrefWindow.h" #include "CreateWindow.h" #include "CurveWindow.h" #include "LimitLevelsWindow.h" #include "SaveAsPanel.h" #include "PhotonView.h" #include "ProgressWin.h" #include "share.h" #include "LoadSavePanels.h" #include "PaperWindow.h" #include "BrushWindow.h" #include "LayerWindow.h" #include "InfoWindow.h" #include "RangeWindow.h" #include "OptionWindow.h" #include "NavigationWindow.h" #include "ToolWindow.h" #include "cursors.h" #define MENU_PREFS 'mnpr' #define HIDE_ALL_WIN 'hdal' #define FULL_SCREEN_NONE 0 #define FULL_SCREEN_HALF 1 #define FULL_SCREEN_TOTAL 2 class PhotonWindow : public BWindow { public: share *shared; PhotonWindow(BRect frame,share *sh); ~PhotonWindow(); virtual bool QuitRequested(); void UpdateToolInfo(); BView *back_view; PicView *inside_view; BScrollView *scroll_view; //OutputFormatWindow *format_win; BrushWindow *brWindow; PaperWindow *ppWindow; LayerWindow *lyWindow; InfoWindow *ifWindow; OptionWindow *opWindow; NavigationWindow *nvWindow; ToolWindow *tlWindow; RangeWindow *rgWindow; LimitLevelsWindow *llWindow; bool rgWindow_visible; BBitmap *back_bmp; uint8 full_screen; void FrameResized(float width, float height); void DisableAll(); void EnableAll(); CurveWindow *curv_win; CreateWindow *crt_win; PrefWindow *prefWindow; void MessageReceived(BMessage *msg); void ShortCuts(BMessage *msg); void OpenPanel(); void SavePanel(); PhotonOpenPanel *panneau_load; SaveAsPanel *panneau_save; BMenu *gimpFilterMenu; void UpdateTitle(); void ZoomChanged(); void SetPointerForActiveTool(); bool menu_bar_shown; BMenuItem *mask_item; void SetFullScreen(); BRect windowed_frame; bool all_win_hidden; //----------------------- FOR SUPPORT GIMP FILTERS ------------------------------------- //Pointeurs sur lesquels doivent pointer les sources et dest pour filter gimp ok BBitmap *fSrcBitmap; BBitmap *fDstBitmap; void AddFilter (const char *menu, const char *item, BMessage *msg); void UseBitmap (BBitmap *bm); void SwitchBuffers (bool showMain); void Update (void); BBitmap *Src (void) { return fSrcBitmap; } BBitmap *Dst (void) { return fDstBitmap; } void RegisterGimpFilters (void) ; int32 AsyncFilter (void *arg); protected: void BuildMenus (void); BMenu *fFilterMenu; }; #endif //Photon_WINDOW_H
20.092437
88
0.737348
537ab603110b88550032cf49d8a7c6a354c3f09a
18,271
c
C
contrib/gnu/binutils/dist/bfd/plugin.c
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
3
2021-05-04T17:09:06.000Z
2021-10-04T07:19:26.000Z
contrib/gnu/binutils/dist/bfd/plugin.c
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
contrib/gnu/binutils/dist/bfd/plugin.c
TheSledgeHammer/2.11BSD
fe61f0b9aaa273783cd027c7b5ec77e95ead2153
[ "BSD-3-Clause" ]
null
null
null
/* Plugin support for BFD. Copyright (C) 2009-2020 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "sysdep.h" #include "bfd.h" #if BFD_SUPPORTS_PLUGINS #include <assert.h> #ifdef HAVE_DLFCN_H #include <dlfcn.h> #elif defined (HAVE_WINDOWS_H) #include <windows.h> #else #error Unknown how to handle dynamic-load-libraries. #endif #include <stdarg.h> #include "plugin-api.h" #include "plugin.h" #include "libbfd.h" #include "libiberty.h" #include <dirent.h> #if !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) #define RTLD_NOW 0 /* Dummy value. */ static void * dlopen (const char *file, int mode ATTRIBUTE_UNUSED) { return LoadLibrary (file); } static void * dlsym (void *handle, const char *name) { return GetProcAddress (handle, name); } static int ATTRIBUTE_UNUSED dlclose (void *handle) { FreeLibrary (handle); return 0; } static const char * dlerror (void) { return "Unable to load DLL."; } #endif /* !defined (HAVE_DLFCN_H) && defined (HAVE_WINDOWS_H) */ #define bfd_plugin_close_and_cleanup _bfd_generic_close_and_cleanup #define bfd_plugin_bfd_free_cached_info _bfd_generic_bfd_free_cached_info #define bfd_plugin_new_section_hook _bfd_generic_new_section_hook #define bfd_plugin_get_section_contents _bfd_generic_get_section_contents #define bfd_plugin_get_section_contents_in_window _bfd_generic_get_section_contents_in_window #define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define bfd_plugin_bfd_merge_private_bfd_data _bfd_generic_bfd_merge_private_bfd_data #define bfd_plugin_bfd_copy_private_header_data _bfd_generic_bfd_copy_private_header_data #define bfd_plugin_bfd_set_private_flags _bfd_generic_bfd_set_private_flags #define bfd_plugin_core_file_matches_executable_p generic_core_file_matches_executable_p #define bfd_plugin_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name #define bfd_plugin_bfd_is_target_special_symbol _bfd_bool_bfd_asymbol_false #define bfd_plugin_get_lineno _bfd_nosymbols_get_lineno #define bfd_plugin_find_nearest_line _bfd_nosymbols_find_nearest_line #define bfd_plugin_find_line _bfd_nosymbols_find_line #define bfd_plugin_find_inliner_info _bfd_nosymbols_find_inliner_info #define bfd_plugin_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string #define bfd_plugin_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol #define bfd_plugin_read_minisymbols _bfd_generic_read_minisymbols #define bfd_plugin_minisymbol_to_symbol _bfd_generic_minisymbol_to_symbol #define bfd_plugin_set_arch_mach bfd_default_set_arch_mach #define bfd_plugin_set_section_contents _bfd_generic_set_section_contents #define bfd_plugin_bfd_get_relocated_section_contents bfd_generic_get_relocated_section_contents #define bfd_plugin_bfd_relax_section bfd_generic_relax_section #define bfd_plugin_bfd_link_hash_table_create _bfd_generic_link_hash_table_create #define bfd_plugin_bfd_link_add_symbols _bfd_generic_link_add_symbols #define bfd_plugin_bfd_link_just_syms _bfd_generic_link_just_syms #define bfd_plugin_bfd_final_link _bfd_generic_final_link #define bfd_plugin_bfd_link_split_section _bfd_generic_link_split_section #define bfd_plugin_bfd_gc_sections bfd_generic_gc_sections #define bfd_plugin_bfd_lookup_section_flags bfd_generic_lookup_section_flags #define bfd_plugin_bfd_merge_sections bfd_generic_merge_sections #define bfd_plugin_bfd_is_group_section bfd_generic_is_group_section #define bfd_plugin_bfd_group_name bfd_generic_group_name #define bfd_plugin_bfd_discard_group bfd_generic_discard_group #define bfd_plugin_section_already_linked _bfd_generic_section_already_linked #define bfd_plugin_bfd_define_common_symbol bfd_generic_define_common_symbol #define bfd_plugin_bfd_link_hide_symbol _bfd_generic_link_hide_symbol #define bfd_plugin_bfd_define_start_stop bfd_generic_define_start_stop #define bfd_plugin_bfd_copy_link_hash_symbol_type _bfd_generic_copy_link_hash_symbol_type #define bfd_plugin_bfd_link_check_relocs _bfd_generic_link_check_relocs static enum ld_plugin_status message (int level ATTRIBUTE_UNUSED, const char * format, ...) { va_list args; va_start (args, format); printf ("bfd plugin: "); vprintf (format, args); putchar ('\n'); va_end (args); return LDPS_OK; } /* Register a claim-file handler. */ static ld_plugin_claim_file_handler claim_file = NULL; static enum ld_plugin_status register_claim_file (ld_plugin_claim_file_handler handler) { claim_file = handler; return LDPS_OK; } static enum ld_plugin_status add_symbols (void * handle, int nsyms, const struct ld_plugin_symbol * syms) { bfd *abfd = handle; struct plugin_data_struct *plugin_data = bfd_alloc (abfd, sizeof (plugin_data_struct)); plugin_data->nsyms = nsyms; plugin_data->syms = syms; if (nsyms != 0) abfd->flags |= HAS_SYMS; abfd->tdata.plugin_data = plugin_data; return LDPS_OK; } static const char *plugin_program_name; void bfd_plugin_set_program_name (const char *program_name) { plugin_program_name = program_name; } int bfd_plugin_open_input (bfd *ibfd, struct ld_plugin_input_file *file) { bfd *iobfd; iobfd = ibfd; while (iobfd->my_archive && !bfd_is_thin_archive (iobfd->my_archive)) iobfd = iobfd->my_archive; file->name = iobfd->filename; if (!iobfd->iostream && !bfd_open_file (iobfd)) return 0; /* The plugin API expects that the file descriptor won't be closed and reused as done by the bfd file cache. So open it again. dup isn't good enough. plugin IO uses lseek/read while BFD uses fseek/fread. It isn't wise to mix the unistd and stdio calls on the same underlying file descriptor. */ file->fd = open (file->name, O_RDONLY | O_BINARY); if (file->fd < 0) return 0; if (iobfd == ibfd) { struct stat stat_buf; if (fstat (file->fd, &stat_buf)) { close(file->fd); return 0; } file->offset = 0; file->filesize = stat_buf.st_size; } else { file->offset = ibfd->origin; file->filesize = arelt_size (ibfd); } return 1; } static int try_claim (bfd *abfd) { int claimed = 0; struct ld_plugin_input_file file; file.handle = abfd; if (!bfd_plugin_open_input (abfd, &file)) return 0; if (claim_file) claim_file (&file, &claimed); close (file.fd); return claimed; } struct plugin_list_entry { void * handle; ld_plugin_claim_file_handler claim_file; struct plugin_list_entry * next; }; static struct plugin_list_entry * plugin_list = NULL; static int try_load_plugin (const char *pname, bfd *abfd, int *has_plugin_p) { void *plugin_handle = NULL; struct ld_plugin_tv tv[4]; int i; ld_plugin_onload onload; enum ld_plugin_status status; struct plugin_list_entry *plugin_list_iter; *has_plugin_p = 0; plugin_handle = dlopen (pname, RTLD_NOW); if (!plugin_handle) { _bfd_error_handler ("%s\n", dlerror ()); return 0; } for (plugin_list_iter = plugin_list; plugin_list_iter; plugin_list_iter = plugin_list_iter->next) { if (plugin_handle == plugin_list_iter->handle) { dlclose (plugin_handle); if (!plugin_list_iter->claim_file) return 0; register_claim_file (plugin_list_iter->claim_file); goto have_claim_file; } } plugin_list_iter = bfd_malloc (sizeof *plugin_list_iter); if (plugin_list_iter == NULL) return 0; plugin_list_iter->handle = plugin_handle; plugin_list_iter->claim_file = NULL; plugin_list_iter->next = plugin_list; plugin_list = plugin_list_iter; onload = dlsym (plugin_handle, "onload"); if (!onload) return 0; i = 0; tv[i].tv_tag = LDPT_MESSAGE; tv[i].tv_u.tv_message = message; ++i; tv[i].tv_tag = LDPT_REGISTER_CLAIM_FILE_HOOK; tv[i].tv_u.tv_register_claim_file = register_claim_file; ++i; tv[i].tv_tag = LDPT_ADD_SYMBOLS; tv[i].tv_u.tv_add_symbols = add_symbols; ++i; tv[i].tv_tag = LDPT_NULL; tv[i].tv_u.tv_val = 0; status = (*onload)(tv); if (status != LDPS_OK) return 0; plugin_list_iter->claim_file = claim_file; have_claim_file: *has_plugin_p = 1; abfd->plugin_format = bfd_plugin_no; if (!claim_file) return 0; if (!try_claim (abfd)) return 0; abfd->plugin_format = bfd_plugin_yes; return 1; } /* There may be plugin libraries in lib/bfd-plugins. */ static int has_plugin = -1; static const bfd_target *(*ld_plugin_object_p) (bfd *); static const char *plugin_name; void bfd_plugin_set_plugin (const char *p) { plugin_name = p; has_plugin = p != NULL; } /* Return TRUE if a plugin library is used. */ bfd_boolean bfd_plugin_specified_p (void) { return has_plugin > 0; } /* Return TRUE if ABFD can be claimed by linker LTO plugin. */ bfd_boolean bfd_link_plugin_object_p (bfd *abfd) { if (ld_plugin_object_p) return ld_plugin_object_p (abfd) != NULL; return FALSE; } extern const bfd_target plugin_vec; /* Return TRUE if TARGET is a pointer to plugin_vec. */ bfd_boolean bfd_plugin_target_p (const bfd_target *target) { return target == &plugin_vec; } /* Register OBJECT_P to be used by bfd_plugin_object_p. */ void register_ld_plugin_object_p (const bfd_target *(*object_p) (bfd *)) { ld_plugin_object_p = object_p; } static int load_plugin (bfd *abfd) { /* The intent was to search ${libdir}/bfd-plugins for plugins, but unfortunately the original implementation wasn't precisely that when configuring binutils using --libdir. Search in the proper path first, then the old one for backwards compatibility. */ static const char *path[] = { LIBDIR "/bfd-plugins", BINDIR "/../lib/bfd-plugins" }; struct stat last_st; int found = 0; unsigned int i; if (!has_plugin) return found; if (plugin_name) return try_load_plugin (plugin_name, abfd, &has_plugin); if (plugin_program_name == NULL) return found; /* Try not to search the same dir twice, by looking at st_dev and st_ino for the dir. If we are on a file system that always sets st_ino to zero or the actual st_ino is zero we might waste some time, but that doesn't matter too much. */ last_st.st_dev = 0; last_st.st_ino = 0; for (i = 0; i < sizeof (path) / sizeof (path[0]); i++) { char *plugin_dir = make_relative_prefix (plugin_program_name, BINDIR, path[i]); if (plugin_dir) { struct stat st; DIR *d; if (stat (plugin_dir, &st) == 0 && S_ISDIR (st.st_mode) && !(last_st.st_dev == st.st_dev && last_st.st_ino == st.st_ino && st.st_ino != 0) && (d = opendir (plugin_dir)) != NULL) { struct dirent *ent; last_st.st_dev = st.st_dev; last_st.st_ino = st.st_ino; while ((ent = readdir (d)) != NULL) { char *full_name; full_name = concat (plugin_dir, "/", ent->d_name, NULL); if (stat (full_name, &st) == 0 && S_ISREG (st.st_mode)) { int valid_plugin; found = try_load_plugin (full_name, abfd, &valid_plugin); if (has_plugin <= 0) has_plugin = valid_plugin; } free (full_name); if (found) break; } closedir (d); } free (plugin_dir); } if (found) break; } return found; } static const bfd_target * bfd_plugin_object_p (bfd *abfd) { if (ld_plugin_object_p) return ld_plugin_object_p (abfd); if (abfd->plugin_format == bfd_plugin_unknown && !load_plugin (abfd)) return NULL; return abfd->plugin_format == bfd_plugin_yes ? abfd->xvec : NULL; } /* Copy any private info we understand from the input bfd to the output bfd. */ static bfd_boolean bfd_plugin_bfd_copy_private_bfd_data (bfd *ibfd ATTRIBUTE_UNUSED, bfd *obfd ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return TRUE; } /* Copy any private info we understand from the input section to the output section. */ static bfd_boolean bfd_plugin_bfd_copy_private_section_data (bfd *ibfd ATTRIBUTE_UNUSED, asection *isection ATTRIBUTE_UNUSED, bfd *obfd ATTRIBUTE_UNUSED, asection *osection ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return TRUE; } /* Copy any private info we understand from the input symbol to the output symbol. */ static bfd_boolean bfd_plugin_bfd_copy_private_symbol_data (bfd *ibfd ATTRIBUTE_UNUSED, asymbol *isymbol ATTRIBUTE_UNUSED, bfd *obfd ATTRIBUTE_UNUSED, asymbol *osymbol ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return TRUE; } static bfd_boolean bfd_plugin_bfd_print_private_bfd_data (bfd *abfd ATTRIBUTE_UNUSED, PTR ptr ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return TRUE; } static char * bfd_plugin_core_file_failing_command (bfd *abfd ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return NULL; } static int bfd_plugin_core_file_failing_signal (bfd *abfd ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return 0; } static int bfd_plugin_core_file_pid (bfd *abfd ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return 0; } static long bfd_plugin_get_symtab_upper_bound (bfd *abfd) { struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data; long nsyms = plugin_data->nsyms; BFD_ASSERT (nsyms >= 0); return ((nsyms + 1) * sizeof (asymbol *)); } static flagword convert_flags (const struct ld_plugin_symbol *sym) { switch (sym->def) { case LDPK_DEF: case LDPK_COMMON: case LDPK_UNDEF: return BSF_GLOBAL; case LDPK_WEAKUNDEF: case LDPK_WEAKDEF: return BSF_GLOBAL | BSF_WEAK; default: BFD_ASSERT (0); return 0; } } static long bfd_plugin_canonicalize_symtab (bfd *abfd, asymbol **alocation) { struct plugin_data_struct *plugin_data = abfd->tdata.plugin_data; long nsyms = plugin_data->nsyms; const struct ld_plugin_symbol *syms = plugin_data->syms; static asection fake_section = BFD_FAKE_SECTION (fake_section, NULL, "plug", 0, SEC_ALLOC | SEC_LOAD | SEC_CODE | SEC_HAS_CONTENTS); static asection fake_common_section = BFD_FAKE_SECTION (fake_common_section, NULL, "plug", 0, SEC_IS_COMMON); int i; for (i = 0; i < nsyms; i++) { asymbol *s = bfd_alloc (abfd, sizeof (asymbol)); BFD_ASSERT (s); alocation[i] = s; s->the_bfd = abfd; s->name = syms[i].name; s->value = 0; s->flags = convert_flags (&syms[i]); switch (syms[i].def) { case LDPK_COMMON: s->section = &fake_common_section; break; case LDPK_UNDEF: case LDPK_WEAKUNDEF: s->section = bfd_und_section_ptr; break; case LDPK_DEF: case LDPK_WEAKDEF: s->section = &fake_section; break; default: BFD_ASSERT (0); } s->udata.p = (void *) &syms[i]; } return nsyms; } static void bfd_plugin_print_symbol (bfd *abfd ATTRIBUTE_UNUSED, PTR afile ATTRIBUTE_UNUSED, asymbol *symbol ATTRIBUTE_UNUSED, bfd_print_symbol_type how ATTRIBUTE_UNUSED) { BFD_ASSERT (0); } static void bfd_plugin_get_symbol_info (bfd *abfd ATTRIBUTE_UNUSED, asymbol *symbol, symbol_info *ret) { bfd_symbol_info (symbol, ret); } /* Make an empty symbol. */ static asymbol * bfd_plugin_make_empty_symbol (bfd *abfd) { asymbol *new_symbol = bfd_zalloc (abfd, sizeof (asymbol)); if (new_symbol == NULL) return new_symbol; new_symbol->the_bfd = abfd; return new_symbol; } static int bfd_plugin_sizeof_headers (bfd *a ATTRIBUTE_UNUSED, struct bfd_link_info *info ATTRIBUTE_UNUSED) { BFD_ASSERT (0); return 0; } const bfd_target plugin_vec = { "plugin", /* Name. */ bfd_target_unknown_flavour, BFD_ENDIAN_LITTLE, /* Target byte order. */ BFD_ENDIAN_LITTLE, /* Target headers byte order. */ (HAS_RELOC | EXEC_P | /* Object flags. */ HAS_LINENO | HAS_DEBUG | HAS_SYMS | HAS_LOCALS | DYNAMIC | WP_TEXT | D_PAGED), (SEC_CODE | SEC_DATA | SEC_ROM | SEC_HAS_CONTENTS | SEC_ALLOC | SEC_LOAD | SEC_RELOC), /* Section flags. */ 0, /* symbol_leading_char. */ '/', /* ar_pad_char. */ 15, /* ar_max_namelen. */ 255, /* match priority. */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* data */ bfd_getl64, bfd_getl_signed_64, bfd_putl64, bfd_getl32, bfd_getl_signed_32, bfd_putl32, bfd_getl16, bfd_getl_signed_16, bfd_putl16, /* hdrs */ { /* bfd_check_format. */ _bfd_dummy_target, bfd_plugin_object_p, bfd_generic_archive_p, _bfd_dummy_target }, { /* bfd_set_format. */ _bfd_bool_bfd_false_error, _bfd_bool_bfd_false_error, _bfd_generic_mkarchive, _bfd_bool_bfd_false_error, }, { /* bfd_write_contents. */ _bfd_bool_bfd_false_error, _bfd_bool_bfd_false_error, _bfd_write_archive_contents, _bfd_bool_bfd_false_error, }, BFD_JUMP_TABLE_GENERIC (bfd_plugin), BFD_JUMP_TABLE_COPY (bfd_plugin), BFD_JUMP_TABLE_CORE (bfd_plugin), #ifdef USE_64_BIT_ARCHIVE BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_64_bit), #else BFD_JUMP_TABLE_ARCHIVE (_bfd_archive_coff), #endif BFD_JUMP_TABLE_SYMBOLS (bfd_plugin), BFD_JUMP_TABLE_RELOCS (_bfd_norelocs), BFD_JUMP_TABLE_WRITE (bfd_plugin), BFD_JUMP_TABLE_LINK (bfd_plugin), BFD_JUMP_TABLE_DYNAMIC (_bfd_nodynamic), NULL, NULL /* backend_data. */ }; #endif /* BFD_SUPPORTS_PLUGIN */
26.13877
97
0.722949
9bc27a0717ae6ba537a02f14954f9edea920ac3a
489
h
C
src/StripController/stripper/Logger.h
anatoly-kryzhanovsky/Pulsar
4f7481c2260c200c97a687f72eef6064db009cda
[ "MIT" ]
null
null
null
src/StripController/stripper/Logger.h
anatoly-kryzhanovsky/Pulsar
4f7481c2260c200c97a687f72eef6064db009cda
[ "MIT" ]
null
null
null
src/StripController/stripper/Logger.h
anatoly-kryzhanovsky/Pulsar
4f7481c2260c200c97a687f72eef6064db009cda
[ "MIT" ]
null
null
null
#ifndef __LOGGER_H__ #define __LOGGER_H__ class Logger { public: static const int LevelNone = 0; static const int LevelTrace = 1; static const int LevelInfo = 2; static const int LevelWarning = 4; static const int LevelError = 8; private: char* _buffer; int _level; public: Logger(int boundRate); ~Logger(); void SetLogLevel(int level); void Trace(const char* msg); void Info(const char* msg); void Warning(const char* msg); void Error(const char* msg); }; #endif
16.862069
35
0.711656
4b0d1970e80efa1e95b7f6731d2ed1f0a080a625
30,989
c
C
gpdb/contrib/postgis/topology/sql/populate.sql.in.c
vitessedata/gpdb.4.3.99.x
9462aad5df1bf120a2a87456b1f9574712227da4
[ "PostgreSQL", "Apache-2.0" ]
3
2017-12-10T16:41:21.000Z
2020-07-08T12:59:12.000Z
gpdb/contrib/postgis/topology/sql/populate.sql.in.c
vitessedata/gpdb.4.3.99.x
9462aad5df1bf120a2a87456b1f9574712227da4
[ "PostgreSQL", "Apache-2.0" ]
null
null
null
gpdb/contrib/postgis/topology/sql/populate.sql.in.c
vitessedata/gpdb.4.3.99.x
9462aad5df1bf120a2a87456b1f9574712227da4
[ "PostgreSQL", "Apache-2.0" ]
4
2017-12-10T16:41:35.000Z
2020-11-28T12:20:30.000Z
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -- PostGIS - Spatial Types for PostgreSQL -- http://postgis.refractions.net -- -- Copyright (C) 2010-2012 Sandro Santilli <strk@keybit.net> -- -- This is free software; you can redistribute and/or modify it under -- the terms of the GNU General Public Licence. See the COPYING file. -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- -- Functions used to populate a topology -- -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - /* #define POSTGIS_TOPOLOGY_DEBUG 1 */ -- { -- Compute the max size of the double-precision floating point grid -- cell required to cover the given geometry -- -- -- A pragmatic test conducted using algoritm shown here: -- http://stackoverflow.com/questions/7408407/generate-next-largest-or-smallest-representable-floating-point-number-without-bi -- showed the "tolerance" growing by an order of magnitude proportionally -- with the order of magnitude of the input, starting with something like -- 3.5527136788005009294e-15 for the starting value of 9.0 -- -- }{ CREATE OR REPLACE FUNCTION topology._st_mintolerance(ageom Geometry) RETURNS float8 AS $$ SELECT 3.6 * power(10, - ( 15 - log(coalesce( nullif( greatest(abs(ST_xmin($1)), abs(ST_ymin($1)), abs(ST_xmax($1)), abs(ST_ymax($1))), 0), 1)) )); $$ LANGUAGE 'sql' IMMUTABLE STRICT; -- } -- { -- Get tolerance for a given topology -- and if zero the minimum for the given geometry -- -- }{ CREATE OR REPLACE FUNCTION topology._st_mintolerance(atopology varchar, ageom Geometry) RETURNS float8 AS $$ DECLARE ret FLOAT8; BEGIN SELECT COALESCE( NULLIF(precision, 0), topology._st_mintolerance($2)) FROM topology.topology WHERE name = $1 INTO ret; IF NOT FOUND THEN RAISE EXCEPTION 'No topology with name "%" in topology.topology', atopology; END IF; return ret; END; $$ LANGUAGE 'plpgsql' STABLE STRICT; -- } --{ -- -- AddNode(atopology, point, allowEdgeSplitting, setContainingFace) -- -- Add a node primitive to a topology and get its identifier. -- Returns an existing node at the same location, if any. -- -- When adding a _new_ node it checks for the existance of any -- edge crossing the given point, raising an exception if found. -- -- The newly added nodes have no containing face. -- -- Developed by Sandro Santilli <strk@keybit.net> -- for Faunalia (http://www.faunalia.it) with funding from -- Regione Toscana - Sistema Informativo per la Gestione del Territorio -- e dell' Ambiente [RT-SIGTA]. -- For the project: "Sviluppo strumenti software per il trattamento di dati -- geografici basati su QuantumGIS e Postgis (CIG 0494241492)" -- -- }{ CREATE OR REPLACE FUNCTION topology.AddNode(atopology varchar, apoint geometry, allowEdgeSplitting boolean, setContainingFace boolean DEFAULT false) RETURNS int AS $$ DECLARE nodeid int; rec RECORD; containing_face int; BEGIN -- -- Atopology and apoint are required -- IF atopology IS NULL OR apoint IS NULL THEN RAISE EXCEPTION 'Invalid null argument'; END IF; -- -- Apoint must be a point -- IF substring(geometrytype(apoint), 1, 5) != 'POINT' THEN RAISE EXCEPTION 'Node geometry must be a point'; END IF; -- -- Check if a coincident node already exists -- -- We use index AND x/y equality -- FOR rec IN EXECUTE 'SELECT node_id FROM ' || quote_ident(atopology) || '.node ' || 'WHERE geom && ' || quote_literal(apoint::text) || '::geometry' ||' AND ST_X(geom) = ST_X('||quote_literal(apoint::text)||'::geometry)' ||' AND ST_Y(geom) = ST_Y('||quote_literal(apoint::text)||'::geometry)' LOOP RETURN rec.node_id; END LOOP; -- -- Check if any edge crosses this node -- (endpoints are fine) -- FOR rec IN EXECUTE 'SELECT edge_id FROM ' || quote_ident(atopology) || '.edge ' || 'WHERE ST_DWithin(' || quote_literal(apoint::text) || ', geom, 0) AND NOT ST_Equals(' || quote_literal(apoint::text) || ', ST_StartPoint(geom)) AND NOT ST_Equals(' || quote_literal(apoint::text) || ', ST_EndPoint(geom))' LOOP IF allowEdgeSplitting THEN RETURN ST_ModEdgeSplit(atopology, rec.edge_id, apoint); ELSE RAISE EXCEPTION 'An edge crosses the given node.'; END IF; END LOOP; IF setContainingFace THEN containing_face := topology.GetFaceByPoint(atopology, apoint, 0); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'containing face: %', containing_face; #endif ELSE containing_face := NULL; END IF; -- -- Get new node id from sequence -- FOR rec IN EXECUTE 'SELECT nextval(' || quote_literal( quote_ident(atopology) || '.node_node_id_seq' ) || ')' LOOP nodeid = rec.nextval; END LOOP; -- -- Insert the new row -- EXECUTE 'INSERT INTO ' || quote_ident(atopology) || '.node(node_id, containing_face, geom) VALUES(' || nodeid || ',' || coalesce(containing_face::text, 'NULL') || ',' || quote_literal(apoint::text) || ')'; RETURN nodeid; END $$ LANGUAGE 'plpgsql' VOLATILE; --} AddNode --{ -- -- AddNode(atopology, point) -- CREATE OR REPLACE FUNCTION topology.AddNode(atopology varchar, apoint geometry) RETURNS int AS $$ SELECT topology.AddNode($1, $2, false, false); $$ LANGUAGE 'sql' VOLATILE; --} AddNode --{ -- -- AddEdge(atopology, line) -- -- Add an edge primitive to a topology and get its identifier. -- Edge endpoints will be added as nodes if missing. -- Returns an existing edge at the same location, if any. -- -- An exception is raised if the given line crosses an existing -- node or interects with an existing edge on anything but endnodes. -- -- The newly added edge has "universe" face on both sides -- and links to itself as per next left/right edge. -- Calling code is expected to do further linking. -- -- Developed by Sandro Santilli <strk@keybit.net> -- for Faunalia (http://www.faunalia.it) with funding from -- Regione Toscana - Sistema Informativo per la Gestione del Territorio -- e dell' Ambiente [RT-SIGTA]. -- For the project: "Sviluppo strumenti software per il trattamento di dati -- geografici basati su QuantumGIS e Postgis (CIG 0494241492)" -- CREATE OR REPLACE FUNCTION topology.AddEdge(atopology varchar, aline geometry) RETURNS int AS $$ DECLARE edgeid int; rec RECORD; ix geometry; BEGIN -- -- Atopology and apoint are required -- IF atopology IS NULL OR aline IS NULL THEN RAISE EXCEPTION 'Invalid null argument'; END IF; -- -- Aline must be a linestring -- IF substring(geometrytype(aline), 1, 4) != 'LINE' THEN RAISE EXCEPTION 'Edge geometry must be a linestring'; END IF; -- -- Check there's no face registered in the topology -- FOR rec IN EXECUTE 'SELECT count(face_id) FROM ' || quote_ident(atopology) || '.face ' || ' WHERE face_id != 0 LIMIT 1' LOOP IF rec.count > 0 THEN RAISE EXCEPTION 'AddEdge can only be used against topologies with no faces defined'; END IF; END LOOP; -- -- Check if the edge crosses an existing node -- FOR rec IN EXECUTE 'SELECT node_id FROM ' || quote_ident(atopology) || '.node ' || 'WHERE ST_Crosses(' || quote_literal(aline::text) || '::geometry, geom' || ')' LOOP RAISE EXCEPTION 'Edge crosses node %', rec.node_id; END LOOP; -- -- Check if the edge intersects an existing edge -- on anything but endpoints -- -- Following DE-9 Intersection Matrix represent -- the only relation we accept. -- -- F F 1 -- F * * -- 1 * 2 -- -- Example1: linestrings touching at one endpoint -- FF1 F00 102 -- FF1 F** 1*2 <-- our match -- -- Example2: linestrings touching at both endpoints -- FF1 F0F 1F2 -- FF1 F** 1*2 <-- our match -- FOR rec IN EXECUTE 'SELECT edge_id, geom, ST_Relate(' || quote_literal(aline::text) || '::geometry, geom, 2) as im' || ' FROM ' || quote_ident(atopology) || '.edge ' || 'WHERE ' || quote_literal(aline::text) || '::geometry && geom' LOOP IF ST_RelateMatch(rec.im, 'FF1F**1*2') THEN CONTINUE; -- no interior intersection END IF; -- Reuse an EQUAL edge (be it closed or not) IF ST_RelateMatch(rec.im, '1FFF*FFF2') THEN #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Edge already known as %', rec.edge_id; #endif RETURN rec.edge_id; END IF; -- WARNING: the constructive operation might throw an exception BEGIN ix = ST_Intersection(rec.geom, aline); EXCEPTION WHEN OTHERS THEN RAISE NOTICE 'Could not compute intersection between input edge (%) and edge % (%)', aline::text, rec.edge_id, rec.geom::text; END; RAISE EXCEPTION 'Edge intersects (not on endpoints) with existing edge % at or near point %', rec.edge_id, ST_AsText(ST_PointOnSurface(ix)); END LOOP; -- -- Get new edge id from sequence -- FOR rec IN EXECUTE 'SELECT nextval(' || quote_literal( quote_ident(atopology) || '.edge_data_edge_id_seq' ) || ')' LOOP edgeid = rec.nextval; END LOOP; -- -- Insert the new row -- EXECUTE 'INSERT INTO ' || quote_ident(atopology) || '.edge(edge_id, start_node, end_node, ' || 'next_left_edge, next_right_edge, ' || 'left_face, right_face, ' || 'geom) ' || ' VALUES(' -- edge_id || edgeid ||',' -- start_node || 'topology.addNode(' || quote_literal(atopology) || ', ST_StartPoint(' || quote_literal(aline::text) || ')) ,' -- end_node || 'topology.addNode(' || quote_literal(atopology) || ', ST_EndPoint(' || quote_literal(aline::text) || ')) ,' -- next_left_edge || -edgeid ||',' -- next_right_edge || edgeid ||',' -- left_face || '0,' -- right_face || '0,' -- geom ||quote_literal(aline::text) || ')'; RETURN edgeid; END $$ LANGUAGE 'plpgsql' VOLATILE; --} AddEdge --{ -- -- AddFace(atopology, poly, [<force_new>=true]) -- -- Add a face primitive to a topology and get its identifier. -- Returns an existing face at the same location, if any, unless -- true is passed as the force_new argument -- -- For a newly added face, its edges will be appropriately -- linked (marked as left-face or right-face), and any contained -- edges and nodes would also be marked as such. -- -- When forcing re-registration of an existing face, no action will be -- taken to deal with the face being substituted. Which means -- a record about the old face and any record in the relation table -- referencing the existing face will remain untouched, effectively -- leaving the topology in a possibly invalid state. -- It is up to the caller to deal with that. -- -- The target topology is assumed to be valid (containing no -- self-intersecting edges). -- -- An exception is raised if: -- o The polygon boundary is not fully defined by existing edges. -- o The polygon overlaps an existing face. -- -- Developed by Sandro Santilli <strk@keybit.net> -- for Faunalia (http://www.faunalia.it) with funding from -- Regione Toscana - Sistema Informativo per la Gestione del Territorio -- e dell' Ambiente [RT-SIGTA]. -- For the project: "Sviluppo strumenti software per il trattamento di dati -- geografici basati su QuantumGIS e Postgis (CIG 0494241492)" -- CREATE OR REPLACE FUNCTION topology.AddFace(atopology varchar, apoly geometry, force_new boolean DEFAULT FALSE) RETURNS int AS $$ DECLARE bounds geometry; symdif geometry; faceid int; rec RECORD; rrec RECORD; relate text; right_edges int[]; left_edges int[]; all_edges geometry; old_faceid int; old_edgeid int; sql text; right_side bool; edgeseg geometry; p1 geometry; p2 geometry; p3 geometry; loc float8; segnum int; numsegs int; BEGIN -- -- Atopology and apoly are required -- IF atopology IS NULL OR apoly IS NULL THEN RAISE EXCEPTION 'Invalid null argument'; END IF; -- -- Aline must be a polygon -- IF substring(geometrytype(apoly), 1, 4) != 'POLY' THEN RAISE EXCEPTION 'Face geometry must be a polygon'; END IF; for rrec IN SELECT (ST_DumpRings(ST_ForceRHR(apoly))).geom LOOP -- { -- -- Find all bounds edges, forcing right-hand-rule -- to know what's left and what's right... -- bounds = ST_Boundary(rrec.geom); sql := 'SELECT e.geom, e.edge_id, ' || 'e.left_face, e.right_face FROM ' || quote_ident(atopology) || '.edge e, (SELECT ' || quote_literal(bounds::text) || '::geometry as geom) r WHERE ' || 'r.geom && e.geom' ; -- RAISE DEBUG 'SQL: %', sql; FOR rec IN EXECUTE sql LOOP -- { --RAISE DEBUG 'Edge % has bounding box intersection', rec.edge_id; -- Find first non-empty segment of the edge numsegs = ST_NumPoints(rec.geom); segnum = 1; WHILE segnum < numsegs LOOP p1 = ST_PointN(rec.geom, segnum); p2 = ST_PointN(rec.geom, segnum+1); IF ST_Distance(p1, p2) > 0 THEN EXIT; END IF; segnum = segnum + 1; END LOOP; IF segnum = numsegs THEN RAISE WARNING 'Edge % is collapsed', rec.edge_id; CONTINUE; -- we don't want to spend time on it END IF; edgeseg = ST_MakeLine(p1, p2); -- Skip non-covered edges IF NOT ST_Equals(p2, ST_EndPoint(rec.geom)) THEN IF NOT ( _ST_Intersects(bounds, p1) AND _ST_Intersects(bounds, p2) ) THEN --RAISE DEBUG 'Edge % has points % and % not intersecting with ring bounds', rec.edge_id, st_astext(p1), st_astext(p2); CONTINUE; END IF; ELSE -- must be a 2-points only edge, let's use Covers (more expensive) IF NOT _ST_Covers(bounds, edgeseg) THEN --RAISE DEBUG 'Edge % is not covered by ring', rec.edge_id; CONTINUE; END IF; END IF; p3 = ST_StartPoint(bounds); IF ST_DWithin(edgeseg, p3, 0) THEN -- Edge segment covers ring endpoint, See bug #874 loc = ST_Line_Locate_Point(edgeseg, p3); -- WARNING: this is as robust as length of edgeseg allows... IF loc > 0.9 THEN -- shift last point down p2 = ST_Line_Interpolate_Point(edgeseg, loc - 0.1); ELSIF loc < 0.1 THEN -- shift first point up p1 = ST_Line_Interpolate_Point(edgeseg, loc + 0.1); ELSE -- when ring start point is in between, we swap the points p3 = p1; p1 = p2; p2 = p3; END IF; END IF; right_side = ST_Line_Locate_Point(bounds, p1) < ST_Line_Locate_Point(bounds, p2); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Edge % (left:%, right:%) - ring : % - right_side : %', rec.edge_id, rec.left_face, rec.right_face, rrec.path, right_side; #endif IF right_side THEN right_edges := array_append(right_edges, rec.edge_id); old_faceid = rec.right_face; ELSE left_edges := array_append(left_edges, rec.edge_id); old_faceid = rec.left_face; END IF; IF faceid IS NULL OR faceid = 0 THEN faceid = old_faceid; old_edgeid = rec.edge_id; ELSIF faceid != old_faceid THEN RAISE EXCEPTION 'Edge % has face % registered on the side of this face, while edge % has face % on the same side', rec.edge_id, old_faceid, old_edgeid, faceid; END IF; -- Collect all edges for final full coverage check all_edges = ST_Collect(all_edges, rec.geom); END LOOP; -- } END LOOP; -- } IF all_edges IS NULL THEN RAISE EXCEPTION 'Found no edges on the polygon boundary'; END IF; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Left edges: %', left_edges; #endif #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Right edges: %', right_edges; #endif -- -- Check that all edges found, taken togheter, -- fully match the ring boundary and nothing more -- -- If the test fail either we need to add more edges -- from the polygon ring or we need to split -- some of the existing ones. -- bounds = ST_Boundary(apoly); IF NOT ST_isEmpty(ST_SymDifference(bounds, all_edges)) THEN IF NOT ST_isEmpty(ST_Difference(bounds, all_edges)) THEN RAISE EXCEPTION 'Polygon boundary is not fully defined by existing edges at or near point %', ST_AsText(ST_PointOnSurface(ST_Difference(bounds, all_edges))); ELSE RAISE EXCEPTION 'Existing edges cover polygon boundary and more at or near point % (invalid topology?)', ST_AsText(ST_PointOnSurface(ST_Difference(all_edges, bounds))); END IF; END IF; IF faceid IS NOT NULL AND faceid != 0 THEN IF NOT force_new THEN #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Face already known as %, not forcing a new face', faceid; #endif RETURN faceid; ELSE #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Face already known as %, forcing a new face', faceid; #endif END IF; END IF; -- -- Get new face id from sequence -- FOR rec IN EXECUTE 'SELECT nextval(' || quote_literal( quote_ident(atopology) || '.face_face_id_seq' ) || ')' LOOP faceid = rec.nextval; END LOOP; -- -- Insert new face -- EXECUTE 'INSERT INTO ' || quote_ident(atopology) || '.face(face_id, mbr) VALUES(' -- face_id || faceid || ',' -- minimum bounding rectangle || quote_literal(ST_Envelope(apoly)::text) || ')'; -- -- Update all edges having this face on the left -- IF left_edges IS NOT NULL THEN EXECUTE 'UPDATE ' || quote_ident(atopology) || '.edge_data SET left_face = ' || quote_literal(faceid) || ' WHERE edge_id = ANY(' || quote_literal(left_edges) || ') '; END IF; -- -- Update all edges having this face on the right -- IF right_edges IS NOT NULL THEN EXECUTE 'UPDATE ' || quote_ident(atopology) || '.edge_data SET right_face = ' || quote_literal(faceid) || ' WHERE edge_id = ANY(' || quote_literal(right_edges) || ') '; END IF; -- -- Set left_face/right_face of any contained edge -- EXECUTE 'UPDATE ' || quote_ident(atopology) || '.edge_data SET right_face = ' || quote_literal(faceid) || ', left_face = ' || quote_literal(faceid) || ' WHERE ST_Contains(' || quote_literal(apoly::text) || ', geom)'; -- -- Set containing_face of any contained node -- EXECUTE 'UPDATE ' || quote_ident(atopology) || '.node SET containing_face = ' || quote_literal(faceid) || ' WHERE containing_face IS NOT NULL AND ST_Contains(' || quote_literal(apoly::text) || ', geom)'; RETURN faceid; END $$ LANGUAGE 'plpgsql' VOLATILE; --} AddFace -- ---------------------------------------------------------------------------- -- -- Functions to incrementally populate a topology -- -- ---------------------------------------------------------------------------- --{ -- TopoGeo_AddPoint(toponame, pointgeom, tolerance) -- -- Add a Point into a topology, with an optional tolerance -- CREATE OR REPLACE FUNCTION topology.TopoGeo_AddPoint(atopology varchar, apoint geometry, tolerance float8 DEFAULT 0) RETURNS int AS $$ DECLARE id integer; rec RECORD; sql text; prj GEOMETRY; snapedge GEOMETRY; snaptol FLOAT8; tol FLOAT8; z FLOAT8; BEGIN -- 0. Check arguments IF geometrytype(apoint) != 'POINT' THEN RAISE EXCEPTION 'Invalid geometry type (%) passed to TopoGeo_AddPoint, expected POINT', geometrytype(apoint); END IF; -- Get tolerance, if 0 was given tol := COALESCE( NULLIF(tolerance, 0), topology._st_mintolerance(atopology, apoint) ); -- 1. Check if any existing node falls within tolerance -- and if so pick the closest sql := 'SELECT a.node_id FROM ' || quote_ident(atopology) || '.node as a WHERE ST_DWithin(a.geom,' || quote_literal(apoint::text) || '::geometry,' || tol || ') ORDER BY ST_Distance(' || quote_literal(apoint::text) || '::geometry, a.geom) LIMIT 1;'; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG '%', sql; #endif EXECUTE sql INTO id; IF id IS NOT NULL THEN RETURN id; END IF; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'No existing node within tolerance distance'; #endif -- 2. Check if any existing edge falls within tolerance -- and if so split it by a point projected on it sql := 'SELECT a.edge_id, a.geom FROM ' || quote_ident(atopology) || '.edge as a WHERE ST_DWithin(a.geom,' || quote_literal(apoint::text) || '::geometry,' || tol || ') ORDER BY ST_Distance(' || quote_literal(apoint::text) || '::geometry, a.geom) LIMIT 1;'; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG '%', sql; #endif EXECUTE sql INTO rec; IF rec IS NOT NULL THEN -- project point to line, split edge by point prj := ST_ClosestPoint(rec.geom, apoint); -- This is a workaround for ClosestPoint lack of Z support: -- http://trac.osgeo.org/postgis/ticket/2033 z := ST_Z(apoint); IF z IS NOT NULL THEN prj := ST_Translate(ST_Force_3DZ(prj), 0, 0, z); -- no ST_SetZ ... END IF; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Splitting edge % with closest point %', rec.edge_id, ST_AsText(prj); #endif IF NOT ST_Contains(rec.geom, prj) THEN #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG ' Snapping edge to contain closest point'; #endif -- The tolerance must be big enough for snapping to happen -- and small enough to snap only to the projected point. -- Unfortunately ST_Distance returns 0 because it also uses -- a projected point internally, so we need another way. snaptol := topology._st_mintolerance(prj); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Tolerance for snapping to point % = %', ST_AsText(prj), snaptol; #endif snapedge := ST_Snap(rec.geom, prj, snaptol); -- Snapping currently snaps the first point below tolerance -- so may possibly move first point. See ticket #1631 IF NOT ST_Equals(ST_StartPoint(rec.geom), ST_StartPoint(snapedge)) THEN #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE WARNING 'Snapping moved first edge vertex, fixing'; #endif snapedge := ST_MakeLine(ST_StartPoint(rec.geom), snapedge); END IF; #ifdef POSTGIS_TOPOLOGY_DEBUG IF NOT ST_Contains(snapedge, prj) THEN -- or if equal ? RAISE WARNING 'Edge within % distance from node still does not contain the node after snapping to it with tolerance %', tol, snaptol; END IF; #endif PERFORM ST_ChangeEdgeGeom(atopology, rec.edge_id, snapedge); END IF; id := topology.ST_ModEdgeSplit(atopology, rec.edge_id, prj); ELSE #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'No existing edge within tolerance distance'; #endif id := topology.ST_AddIsoNode(atopology, NULL, apoint); END IF; RETURN id; END $$ LANGUAGE 'plpgsql' VOLATILE; --} TopoGeo_AddPoint --{ -- TopoGeo_addLinestring(toponame, linegeom, tolerance) -- -- Add a LineString into a topology -- -- }{ CREATE OR REPLACE FUNCTION topology.TopoGeo_addLinestring(atopology varchar, aline geometry, tolerance float8 DEFAULT 0) RETURNS SETOF int AS $$ DECLARE rec RECORD; rec2 RECORD; sql TEXT; set1 GEOMETRY; set2 GEOMETRY; snapped GEOMETRY; noded GEOMETRY; start_node INTEGER; end_node INTEGER; id INTEGER; inodes GEOMETRY; iedges GEOMETRY; tol float8; BEGIN -- 0. Check arguments IF geometrytype(aline) != 'LINESTRING' THEN RAISE EXCEPTION 'Invalid geometry type (%) passed to TopoGeo_AddLinestring, expected LINESTRING', geometrytype(aline); END IF; -- Get tolerance, if 0 was given tol := COALESCE( NULLIF(tolerance, 0), topology._st_mintolerance(atopology, aline) ); -- 1. Self-node noded := ST_UnaryUnion(aline); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Self-noded: %', ST_AsText(noded); #endif -- 2. Node to edges falling within tol distance sql := 'WITH nearby AS ( SELECT e.geom FROM ' || quote_ident(atopology) || '.edge e WHERE ST_DWithin(e.geom, ' || quote_literal(noded::text) || '::geometry, ' || tol || ') ) SELECT st_collect(geom) FROM nearby;'; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG '%', sql; #endif EXECUTE sql INTO iedges; IF iedges IS NOT NULL THEN #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Intersecting edges: %', ST_AsText(iedges); #endif snapped := ST_Snap(noded, iedges, tol); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Snapped to edges: %', ST_AsText(snapped); #endif noded := ST_Difference(snapped, iedges); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Difference: %', ST_AsText(noded); #endif set1 := ST_Intersection(snapped, iedges); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Intersection: %', ST_AsText(set1); #endif set2 := ST_LineMerge(set1); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'LineMerged intersection: %', ST_AsText(set2); #endif noded := ST_Union(noded, set2); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Unioned: %', ST_AsText(noded); #endif END IF; -- 2.1. Node with existing nodes within tol -- TODO: check if we should be only considering _isolated_ nodes! sql := 'WITH nearby AS ( SELECT n.geom FROM ' || quote_ident(atopology) || '.node n WHERE ST_DWithin(n.geom, ' || quote_literal(noded::text) || '::geometry, ' || tol || ') ) SELECT st_collect(geom) FROM nearby;'; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG '%', sql; #endif EXECUTE sql INTO inodes; IF inodes IS NOT NULL THEN -- { #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Intersecting nodes: %', ST_AsText(inodes); #endif -- TODO: consider snapping once against all elements --- (rather than once with edges and once with nodes) noded := ST_Snap(noded, inodes, tol); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Snapped to nodes: %', ST_AsText(noded); #endif FOR rec IN SELECT (ST_Dump(inodes)).* LOOP -- Use the node to split edges SELECT ST_Collect(geom) FROM ST_Dump(ST_Split(noded, rec.geom)) INTO STRICT noded; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Split by %: %', ST_AsText(rec.geom), ST_AsText(noded); #endif END LOOP; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Split: %', ST_AsText(noded); #endif -- re-node to account for ST_Snap introduced self-intersections -- See http://trac.osgeo.org/postgis/ticket/1714 -- TODO: consider running UnaryUnion once after all noding noded := ST_UnaryUnion(noded); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Self-unioned again: %', ST_AsText(noded); #endif END IF; -- } -- 3. For each (now-noded) segment, insert an edge FOR rec IN SELECT (ST_Dump(noded)).geom LOOP -- TODO: skip point elements ? #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Adding edge %', ST_AsText(rec.geom); #endif start_node := topology.TopoGeo_AddPoint(atopology, ST_StartPoint(rec.geom), tol); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG ' Start Node: %', start_node; #endif end_node := topology.TopoGeo_AddPoint(atopology, ST_EndPoint(rec.geom), tol); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG ' End Node: %', end_node; #endif -- Added endpoints may have drifted due to tolerance, so -- we need to re-snap the edge to the new nodes before adding it sql := 'SELECT n1.geom as sn, n2.geom as en FROM ' || quote_ident(atopology) || '.node n1, ' || quote_ident(atopology) || '.node n2 WHERE n1.node_id = ' || start_node || ' AND n2.node_id = ' || end_node; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG '%', sql; #endif EXECUTE sql INTO STRICT rec2; snapped := ST_SetPoint( ST_SetPoint(rec.geom, ST_NPoints(rec.geom)-1, rec2.en), 0, rec2.sn); /* We might have introduced an invalidity (TODO: check this out) */ snapped := ST_CollectionExtract(ST_MakeValid(snapped), 2); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Cleaned edge: %', ST_AsText(snapped); #endif -- Check if the so-snapped edge collapsed (see #1650) IF ST_IsEmpty(snapped) THEN #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Edge collapsed'; #endif CONTINUE; END IF; -- Check if the so-snapped edge _now_ exists sql := 'SELECT edge_id FROM ' || quote_ident(atopology) || '.edge_data WHERE ST_Equals(geom, ' || quote_literal(snapped::text) || '::geometry)'; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG '%', sql; #endif EXECUTE sql INTO id; IF id IS NULL THEN id := topology.ST_AddEdgeModFace(atopology, start_node, end_node, snapped); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'New edge id: %', id; #endif ELSE #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Old edge id: %', id; #endif END IF; RETURN NEXT id; END LOOP; RETURN; END $$ LANGUAGE 'plpgsql'; --} TopoGeo_addLinestring --{ -- TopoGeo_AddPolygon(toponame, polygeom, tolerance) -- -- Add a Polygon into a topology -- -- }{ CREATE OR REPLACE FUNCTION topology.TopoGeo_AddPolygon(atopology varchar, apoly geometry, tolerance float8 DEFAULT 0) RETURNS SETOF int AS $$ DECLARE boundary GEOMETRY; fgeom GEOMETRY; rec RECORD; edges INTEGER[]; sql TEXT; tol FLOAT8; BEGIN -- 0. Check arguments IF geometrytype(apoly) != 'POLYGON' THEN RAISE EXCEPTION 'Invalid geometry type (%) passed to TopoGeo_AddPolygon, expected POLYGON', geometrytype(apoly); END IF; -- Get tolerance, if 0 was given tol := COALESCE( NULLIF(tolerance, 0), topology._st_mintolerance(atopology, apoly) ); -- 1. Extract boundary boundary := ST_Boundary(apoly); #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Boundary: %', ST_AsText(boundary); #endif -- 2. Add boundaries as edges FOR rec IN SELECT (ST_Dump(boundary)).geom LOOP edges := array_cat(edges, array_agg(x)) FROM ( select topology.TopoGeo_addLinestring(atopology, rec.geom, tol) as x ) as foo; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'New edges: %', edges; #endif END LOOP; -- 3. Find faces covered by input polygon -- NOTE: potential snapping changed polygon edges sql := 'SELECT DISTINCT f.face_id FROM ' || quote_ident(atopology) || '.face f WHERE f.mbr && ' || quote_literal(apoly::text) || '::geometry'; #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG '%', sql; #endif FOR rec IN EXECUTE sql LOOP -- check for actual containment fgeom := ST_PointOnSurface(ST_GetFaceGeometry(atopology, rec.face_id)); IF NOT ST_Covers(apoly, fgeom) THEN #ifdef POSTGIS_TOPOLOGY_DEBUG RAISE DEBUG 'Face % not covered by input polygon', rec.face_id; #endif CONTINUE; END IF; RETURN NEXT rec.face_id; END LOOP; END $$ LANGUAGE 'plpgsql'; --} TopoGeo_AddPolygon --{ -- TopoGeo_AddGeometry(toponame, geom, tolerance) -- -- Add a Geometry into a topology -- CREATE OR REPLACE FUNCTION topology.TopoGeo_AddGeometry(atopology varchar, ageom geometry, tolerance float8 DEFAULT 0) RETURNS void AS $$ DECLARE BEGIN RAISE EXCEPTION 'TopoGeo_AddGeometry not implemented yet'; END $$ LANGUAGE 'plpgsql'; --} TopoGeo_AddGeometry
28.274635
174
0.66117
17177e24a33e6544f9dc2e9b5507622541e54cab
5,245
h
C
DataStructures/Geometry/Point.h
kit-algo/ULTRA-Transfer-Time
49b6ed196daf64269f1521052d9dced0447521e2
[ "MIT" ]
null
null
null
DataStructures/Geometry/Point.h
kit-algo/ULTRA-Transfer-Time
49b6ed196daf64269f1521052d9dced0447521e2
[ "MIT" ]
null
null
null
DataStructures/Geometry/Point.h
kit-algo/ULTRA-Transfer-Time
49b6ed196daf64269f1521052d9dced0447521e2
[ "MIT" ]
null
null
null
#pragma once #include <cmath> #include <ostream> #include <sstream> #include "../../Helpers/Helpers.h" #include "../../Helpers/Types.h" #include "../../Helpers/ConstructorTags.h" namespace Geometry { class Point { public: // Constructors Point() : latitude(0.0), longitude(0.0) {} Point(const Construct::XYTag, const double& x, const double& y) : y(y), x(x) {} Point(const Construct::LatLongTag, const double& latitude, const double& longitude) : latitude(latitude), longitude(longitude) {} // Modifiers & Operators inline void min(const Point& p) { x = std::min(x, p.x); y = std::min(y, p.y); } inline void max(const Point& p) { x = std::max(x, p.x); y = std::max(y, p.y); } inline Point& operator+=(Point& p) { x += p.x; y += p.y; return *this; } inline Point& operator-=(Point& p) { x -= p.x; y -= p.y; return *this; } inline Point& operator*=(const double scalar) { x *= scalar; y *= scalar; return *this; } inline Point& operator/=(const double divisor) { x /= divisor; y /= divisor; return *this; } inline bool operator==(const Point& p) const { return (x == p.x) && (y == p.y); } inline bool operator!=(const Point& p) const { return !operator==(p); } inline double abs() const { return std::sqrt((x * x) + (y * y)); } inline double absSquared() const { return (x * x) + (y * y); } inline friend Point operator*(const double scalar, const Point& point) { return Point(Construct::XY, point.x * scalar, point.y * scalar); } inline friend Point operator*(const Point& point, const double scalar) { return Point(Construct::XY, scalar * point.x, scalar * point.y); } inline friend double operator*(const Point& a, const Point& b) { return (a.x * b.x) + (a.y * b.y); } inline friend Point operator/(const Point& point, const double divisor) { return Point(Construct::XY, point.x / divisor, point.y / divisor); } inline friend Point operator+(const Point& a, const Point& b) { return Point(Construct::XY, a.x + b.x, a.y + b.y); } inline friend Point operator-(const Point& a, const Point& b) { return Point(Construct::XY, a.x - b.x, a.y - b.y); } inline friend double dotProduct(const Point& a, const Point& b) { return (a.x * b.x) + (a.y * b.y); } inline double distanceToPoint(const Point& p) const { const double dx = x - p.x; const double dy = y - p.y; return sqrt((dx * dx) + (dy * dy)); } inline double distanceToLine(const Point& p, const Point& q) const { const Point direction = q - p; const Point closestPointOnLine = p + (dotProduct(*this - p, direction) * (direction / direction.absSquared())); return distanceToPoint(closestPointOnLine); } // String conversion inline std::string toXY() const { std::stringstream ss; ss << "\"X\":" << x << ", \"Y\":" << y; return ss.str(); } inline std::string toLatLong() const { std::stringstream ss; ss << "\"Lat\":" << latitude << ", \"Lon\":" << longitude; return ss.str(); } inline std::ostream& writeXY(std::ostream& stream) const { return stream << toXY(); } inline std::ostream& writeLatLong(std::ostream& stream) const { return stream << toLatLong(); } inline friend std::ostream& operator<<(std::ostream& os, const Point& p) { std::stringstream ss; ss << "(" << p.x << ", " << p.y << ")"; return os << ss.str(); } // Access inline double& operator[](const int dimension) {return (&latitude)[dimension];} inline const double& operator[](const int dimension) const {return (&latitude)[dimension];} public: union { double latitude; double y; }; union { double longitude; double x; }; }; // Free functions inline Point min(const Point& a, const Point& b) { return Point(Construct::XY, Variadic::min(a.x, b.x), Variadic::min(a.y, b.y)); } inline Point max(const Point& a, const Point& b) { return Point(Construct::XY, Variadic::max(a.x, b.x), Variadic::max(a.y, b.y)); } inline double geoDistanceInCM(const Point& from, const Point& to) { if (from == to) return 0; double heightFrom(degreesToRadians(from.longitude)); double heightTo(degreesToRadians(to.longitude)); double widthFrom(degreesToRadians(from.latitude)); double widthTo(degreesToRadians(to.latitude)); return acos(std::min(1.0, sin(widthFrom) * sin(widthTo) + cos(widthFrom) * cos(widthTo) * cos(heightTo - heightFrom))) * EARTH_RADIUS_IN_CENTIMETRE; } inline double euclideanDistanceSquared(const Point& a, const Point& b) { const double dx = a.x - b.x; const double dy = a.y - b.y; return (dx * dx) + (dy * dy); } inline double euclideanDistance(const Point& a, const Point& b) { return std::sqrt(euclideanDistanceSquared(a, b)); } static_assert(sizeof(Point) == 2 * sizeof(double), "Point layout is broken"); }
28.198925
152
0.583794
c0acae9e110331bfa563ecb8dfe69e768f045812
1,763
h
C
CZFToolDemo/CZFToolDemo/CZFTool/NSDate+CZFTools.h
MacleChen/CZFTool
524eae6b1d38b909926a0f7177185a1f6a6db58d
[ "MIT" ]
null
null
null
CZFToolDemo/CZFToolDemo/CZFTool/NSDate+CZFTools.h
MacleChen/CZFTool
524eae6b1d38b909926a0f7177185a1f6a6db58d
[ "MIT" ]
null
null
null
CZFToolDemo/CZFToolDemo/CZFTool/NSDate+CZFTools.h
MacleChen/CZFTool
524eae6b1d38b909926a0f7177185a1f6a6db58d
[ "MIT" ]
null
null
null
// // NSDate+CZFTools.h // CZFToolDemo // // Created by 陈帆 on 2018/2/9. // Copyright © 2018年 陈帆. All rights reserved. // #import <Foundation/Foundation.h> @interface NSDate (CZFTools) /** * 根据一个过去的时间与现在时间做对比,获取间隔多少分钟 * * @param oldDate 过去时间 * * @return 差值多少秒 */ + (long)getMinuteByOldDateBetweenNowDate:(NSDate *)oldDate; /** * NSString转换成NSDate,根据 自定义格式 @"yyyy-MM-dd HH:mm:ss zzz" */ + (NSDate *)dateFromString:(NSString *)dateString andFormatterString:(NSString *)strFormater; /** * NSDate转换成NSString,根据 自定义格式 @"yyyy-MM-dd HH:mm:ss zzz" 忽略时区的转换 */ + (NSString *)stringIgnoreZoneFromDate:(NSDate *)date andFormatterString:(NSString *)strFormater; /** * 根据日期获取对应的星期几 * * @param strInputDate 输入日期字符串 * * @return 星期几 */ + (NSString*)weekdayStringFromDate:(NSString *)strInputDate; /** 格式化为可读的时间显示字符串 @param date 时间 @return 可读时间字符串 */ + (NSString *)stringNormalReadWithDate:(NSDate *)date; /** 获取日期的年月日时分秒毫秒周 @param date 日期 @return 年月日时分秒毫秒周数组 */ + (NSArray *)getDateYearMonthDayWithDate:(NSDate *)date; /** * NSDate转换成NSString,根据 自定义格式 @"yyyy-MM-dd HH:mm:ss zzz" */ + (NSString *)stringFromDate:(NSDate *)date andFormatterString:(NSString *)strFormater; /** * 获取时间字符串,从当前时间开始算起,正数表示向后推算几天,负数表示向前推算几天 * 自定义格式 @"yyyy-MM-dd HH:mm:ss zzz" */ + (NSString *)DateToStringForOtherDateFromNowDays:(NSInteger)dayValue andFormatterString:(NSString *)strFormater; /** * 获取时间字符串,从某个日期算起,正数表示向后推算几小时,负数表示向前推算几小时 * 自定义格式 @"yyyy-MM-dd HH:mm:ss zzz" */ + (NSString *)DateToStringForOtherHourFromNowHours:(NSInteger)dayValue andFormatterString:(NSString *)strFormater andDate:(NSDate *)date; /** 格式化数据发布时间 @param oldDate oldDate */ + (NSString *)formattingTimeCanEasyRead:(NSDate *)oldDate; @end
19.163043
137
0.707317
a5b9502240888a18654cdd315755fd91e1214e59
1,725
h
C
dataset/source/SARD/SARD-4/114869/CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81.h
kppw99/enVAS
99a92411c21241f7030b3c3b697c4161aaaf852b
[ "Apache-2.0" ]
28
2017-01-20T15:25:54.000Z
2020-03-17T00:28:31.000Z
testcases/CWE762_Mismatched_Memory_Management_Routines/s04/CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81.h
mellowCS/cwe_checker_juliet_suite
ae604f6fd94964251fbe88ef04d5287f6c1ffbe2
[ "MIT" ]
1
2017-01-20T15:26:27.000Z
2018-08-20T00:55:37.000Z
testcases/CWE762_Mismatched_Memory_Management_Routines/s04/CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81.h
mellowCS/cwe_checker_juliet_suite
ae604f6fd94964251fbe88ef04d5287f6c1ffbe2
[ "MIT" ]
2
2019-07-15T19:07:04.000Z
2019-09-07T14:21:04.000Z
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81.h Label Definition File: CWE762_Mismatched_Memory_Management_Routines__delete.label.xml Template File: sources-sinks-81.tmpl.h */ /* * @description * CWE: 762 Mismatched Memory Management Routines * BadSource: calloc Allocate data using calloc() * GoodSource: Allocate data using new * Sinks: * GoodSink: Deallocate data using free() * BadSink : Deallocate data using delete * Flow Variant: 81 Data flow: data passed in a parameter to an virtual method called via a reference * * */ #include "std_testcase.h" namespace CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81 { class CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81_base { public: /* pure virtual function */ virtual void action(twoIntsStruct * data) const = 0; }; #ifndef OMITBAD class CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81_bad : public CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81_base { public: void action(twoIntsStruct * data) const; }; #endif /* OMITBAD */ #ifndef OMITGOOD class CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81_goodG2B : public CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81_base { public: void action(twoIntsStruct * data) const; }; class CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81_goodB2G : public CWE762_Mismatched_Memory_Management_Routines__delete_struct_calloc_81_base { public: void action(twoIntsStruct * data) const; }; #endif /* OMITGOOD */ }
30.263158
168
0.795942
a5e688fe68ea2f2c45618aac952ab6c484f5ea75
526
c
C
ompi/mca/fs/ime/fs_ime_file_sync.c
itemko-tester/ompi
3f11c8ef6cb52fab8a2a7ff1776e7de3527d5948
[ "BSD-3-Clause-Open-MPI" ]
null
null
null
ompi/mca/fs/ime/fs_ime_file_sync.c
itemko-tester/ompi
3f11c8ef6cb52fab8a2a7ff1776e7de3527d5948
[ "BSD-3-Clause-Open-MPI" ]
null
null
null
ompi/mca/fs/ime/fs_ime_file_sync.c
itemko-tester/ompi
3f11c8ef6cb52fab8a2a7ff1776e7de3527d5948
[ "BSD-3-Clause-Open-MPI" ]
null
null
null
/* * Copyright (c) 2018 DataDirect Networks. All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ #include "ime_native.h" #include "ompi_config.h" #include "fs_ime.h" #include "mpi.h" #include "ompi/constants.h" #include "ompi/mca/fs/fs.h" int mca_fs_ime_file_sync (ompio_file_t *fh) { int ret; /* reset errno */ errno = 0; ret = ime_native_fsync(fh->fd); if (ret != 0) { return mca_fs_base_get_mpi_err(errno); } return OMPI_SUCCESS; }
15.939394
68
0.636882
9908f256626885a7e93cd059cf746e14409d689c
5,096
c
C
linux-2.6.0/drivers/s390/scsi/zfcp_sysfs_driver.c
dnhua/Linux_study
96863b599cbba9c925b3209bed07b1d7b60cb463
[ "MIT" ]
1
2020-11-10T12:47:02.000Z
2020-11-10T12:47:02.000Z
linux-2.6.0/drivers/s390/scsi/zfcp_sysfs_driver.c
dnhua/Linux_study
96863b599cbba9c925b3209bed07b1d7b60cb463
[ "MIT" ]
null
null
null
linux-2.6.0/drivers/s390/scsi/zfcp_sysfs_driver.c
dnhua/Linux_study
96863b599cbba9c925b3209bed07b1d7b60cb463
[ "MIT" ]
null
null
null
/* * linux/drivers/s390/scsi/zfcp_sysfs_driver.c * * FCP adapter driver for IBM eServer zSeries * * sysfs driver related routines * * Copyright (C) 2003 IBM Entwicklung GmbH, IBM Corporation * Authors: * Martin Peschke <mpeschke@de.ibm.com> * Heiko Carstens <heiko.carstens@de.ibm.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define ZFCP_SYSFS_DRIVER_C_REVISION "$Revision: 1.8 $" #include <asm/ccwdev.h> #include "zfcp_ext.h" #include "zfcp_def.h" #define ZFCP_LOG_AREA ZFCP_LOG_AREA_CONFIG #define ZFCP_LOG_AREA_PREFIX ZFCP_LOG_AREA_PREFIX_CONFIG /** * ZFCP_DEFINE_DRIVER_ATTR - define for all loglevels sysfs attributes * @_name: name of attribute * @_define: name of ZFCP loglevel define * * Generates store function for a sysfs loglevel attribute of zfcp driver. */ #define ZFCP_DEFINE_DRIVER_ATTR(_name, _define) \ static ssize_t zfcp_sysfs_loglevel_##_name##_store(struct device_driver *drv, \ const char *buf, \ size_t count) \ { \ unsigned int loglevel; \ unsigned int new_loglevel; \ char *endp; \ \ new_loglevel = simple_strtoul(buf, &endp, 0); \ if ((endp + 1) < (buf + count)) \ return -EINVAL; \ if (new_loglevel > 3) \ return -EINVAL; \ down(&zfcp_data.config_sema); \ loglevel = atomic_read(&zfcp_data.loglevel); \ loglevel &= ~((unsigned int) 0xf << (ZFCP_LOG_AREA_##_define << 2)); \ loglevel |= new_loglevel << (ZFCP_LOG_AREA_##_define << 2); \ atomic_set(&zfcp_data.loglevel, loglevel); \ up(&zfcp_data.config_sema); \ return count; \ } \ \ static ssize_t zfcp_sysfs_loglevel_##_name##_show(struct device_driver *dev, \ char *buf) \ { \ return sprintf(buf,"%d\n", ZFCP_LOG_VALUE(ZFCP_LOG_AREA_##_define)); \ } \ \ static DRIVER_ATTR(loglevel_##_name, S_IWUSR | S_IRUGO, \ zfcp_sysfs_loglevel_##_name##_show, \ zfcp_sysfs_loglevel_##_name##_store); ZFCP_DEFINE_DRIVER_ATTR(other, OTHER); ZFCP_DEFINE_DRIVER_ATTR(scsi, SCSI); ZFCP_DEFINE_DRIVER_ATTR(fsf, FSF); ZFCP_DEFINE_DRIVER_ATTR(config, CONFIG); ZFCP_DEFINE_DRIVER_ATTR(cio, CIO); ZFCP_DEFINE_DRIVER_ATTR(qdio, QDIO); ZFCP_DEFINE_DRIVER_ATTR(erp, ERP); ZFCP_DEFINE_DRIVER_ATTR(fc, FC); static struct attribute *zfcp_driver_attrs[] = { &driver_attr_loglevel_other.attr, &driver_attr_loglevel_scsi.attr, &driver_attr_loglevel_fsf.attr, &driver_attr_loglevel_config.attr, &driver_attr_loglevel_cio.attr, &driver_attr_loglevel_qdio.attr, &driver_attr_loglevel_erp.attr, &driver_attr_loglevel_fc.attr, NULL }; static struct attribute_group zfcp_driver_attr_group = { .attrs = zfcp_driver_attrs, }; /** * zfcp_sysfs_create_driver_files - create sysfs driver files * @dev: pointer to belonging device * * Create all sysfs attributes of the zfcp device driver */ int zfcp_sysfs_driver_create_files(struct device_driver *drv) { return sysfs_create_group(&drv->kobj, &zfcp_driver_attr_group); } /** * zfcp_sysfs_remove_driver_files - remove sysfs driver files * @dev: pointer to belonging device * * Remove all sysfs attributes of the zfcp device driver */ void zfcp_sysfs_driver_remove_files(struct device_driver *drv) { sysfs_remove_group(&drv->kobj, &zfcp_driver_attr_group); } #undef ZFCP_LOG_AREA #undef ZFCP_LOG_AREA_PREFIX
39.8125
79
0.566523
126ff7977afa4a3c603450b6681fb4856e541ac2
2,268
c
C
solutions/1-22-fold.c
pedrohasantiago/c-language-solutions
950c6e85d46a73fb82ff3d8eb6e20be11bac2fa9
[ "Unlicense" ]
null
null
null
solutions/1-22-fold.c
pedrohasantiago/c-language-solutions
950c6e85d46a73fb82ff3d8eb6e20be11bac2fa9
[ "Unlicense" ]
null
null
null
solutions/1-22-fold.c
pedrohasantiago/c-language-solutions
950c6e85d46a73fb82ff3d8eb6e20be11bac2fa9
[ "Unlicense" ]
null
null
null
/** Folds long input lines into two or more shorter lines * after the last non-blank character that occurs before * the n-th column of input. */ #include <stdio.h> #define DEBUG 0 #define MAX_LINE_LEN 1000 #define MAX_COLUMN 10 #define TRUE 1 #define FALSE 0 int getLine(char[], int); void fold(char[], char[], int); int main() { int i, c; char inputLine[MAX_LINE_LEN]; char outputLine[MAX_LINE_LEN]; while (getLine(inputLine, MAX_LINE_LEN) != 0) { fold(inputLine, outputLine, MAX_LINE_LEN); for (i = 0; (c = outputLine[i]) != '\0'; ++i) { putchar(c); } } return 0; } void fold(char input[], char output[], int limit) { int i, c, outputPos, insideBlanks, j; int firstBlank = 0; int lastFold = 0; for (i = 0, outputPos = 0; (c = input[i]) != '\0' && i <= limit - 1; ++i) { if (DEBUG) printf("i %d c %c\n", i, c); if ((c == ' ' || c == '\t') && !insideBlanks) { insideBlanks = TRUE; firstBlank = i; if (DEBUG) printf("firstBlank %d\n", firstBlank); } else { insideBlanks = FALSE; } if (i - lastFold >= MAX_COLUMN) { if (DEBUG) printf("Adding a newline at %d\n", firstBlank); output[firstBlank] = '\n'; ++outputPos; /* if (i - firstBlank == MAX_COLUMN) { */ /* output[outputPos] = c; */ /* continue; */ /* } */ if (DEBUG) printf("Backfilling from %d to %d\n", firstBlank + 1, i); for (j = 0; j <= i - firstBlank; ++j) { if ((c = input[firstBlank + j]) != ' ' && c != '\t') { if (DEBUG) printf("firstblank + j %d receive %c\n", firstBlank + j, c); output[firstBlank + j] = c; } } lastFold = i; } else { output[outputPos] = c; ++outputPos; } } output[outputPos + 1] = '\0'; } int getLine(char output[], int limit) { int i, c; for (i = 0; (c = getchar()) != '\n' && c != EOF && i <= limit - 1; ++i) { output[i] = c; } if (c == '\n') { output[i] = '\n'; ++i; } output[i] = '\0'; return i; }
29.076923
91
0.471781
8f78227d84553304eecd4d37b16f8364fe41934c
14,383
c
C
cgoua_api.c
ByteFlinger/cgoopc
91c90d61c5ebff0529bf1d68ef75a49b6202fa7b
[ "MIT" ]
2
2018-06-21T14:01:28.000Z
2020-11-28T03:01:40.000Z
cgoua_api.c
ByteFlinger/cgoopc
91c90d61c5ebff0529bf1d68ef75a49b6202fa7b
[ "MIT" ]
1
2018-06-14T08:37:48.000Z
2018-06-21T14:43:20.000Z
cgoua_api.c
FlexLink/cgoopc
42c0749d9bb57aa6bed9907e4918195b9db4e6d4
[ "MIT" ]
null
null
null
#include <stdio.h> #include "open62541.h" #include "cgoua_api.h" #include "_cgo_export.h" inline int IsStringEqual(const char *a, const char *b) { while (*a == *b) { if (*a == '\0') return 1; a++; b++; } return 0; } size_t strlstchar(const char *str, const char ch) { char *chptr = strrchr(str, ch); return chptr - str; } ArrayInt *initArrayInt(size_t initSize) { ArrayInt *a = malloc(sizeof(a)); a->array = malloc(initSize * sizeof(Tuple)); a->used = 0; a->size = initSize; return a; } void appendArrayInt(ArrayInt *a, int ns, int elem) { // resize the array if it's needed if (a->used == a->size) { size_t extension = a->size; if (extension > 100) { extension = 100; }; a->size = a->size + extension; a->array = realloc(a->array, a->size * sizeof(Tuple)); for (int i = a->used; i < a->size; i++) { a->array[i].ns = 0; a->array[i].val = 0; } } // append 'int' element a->array[a->used].ns = ns; a->array[a->used].val = elem; a->used++; } int contains(ArrayInt *a, int ns, int elem) { for (int i=0; i < a->used; i++) { if (a->array[i].val == elem && a->array[i].ns == 0 ) { return 1; } } return 0; } void freeArrayInt(ArrayInt *a) { free(a->array); free(a); } Array *initArray(size_t initSize) { Array *a = malloc(sizeof(*a)); a->size = initSize; a->used = 0; a->array = (NodeData *) malloc(initSize * sizeof(NodeData)); return a; } void insertArray(Array *a, NodeData element) { if (a->used == a->size) { a->size *= 2; a->array = (NodeData *) realloc(a->array, a->size * sizeof(NodeData)); for (unsigned int i = a->used; i < a->size; i++) { memset(&a->array[i], 0, sizeof(NodeData)); } } // Assign name a->array[a->used].stringNodeId = (char *) malloc(strlen(element.stringNodeId) + 1); strcpy(a->array[a->used].stringNodeId, element.stringNodeId); // Assign display name a->array[a->used].displayName = (char *) malloc(strlen(element.displayName) + 1); strcpy(a->array[a->used].displayName, element.displayName); // Assign ID a->array[a->used].nameSpace = element.nameSpace; // Assign type a->array[a->used].type = element.type; // Assign nodeId a->array[a->used].intNodeId = element.intNodeId; a->used++; } void freeArray(Array *a) { // Free all name variables of each array element first for (int i = 0; i < a->used; i++) { free(a->array[i].stringNodeId); a->array[i].stringNodeId = NULL; free(a->array[i].displayName); a->array[i].displayName = NULL; } // Now free the array free(a->array); a->array = NULL; a->used = 0; a->size = 0; } UA_StatusCode readTagInt32(UA_Client *client, UA_UInt16 nsIndex, UA_Int32 numeric, char *name, UA_Int32 *ret) { UA_Int32 value = 0; UA_Variant *val = UA_Variant_new(); UA_StatusCode retval; if (numeric == -1) { //String node ID retval = UA_Client_readValueAttribute(client, UA_NODEID_STRING(nsIndex, name), val); } else { //Int Node ID retval = UA_Client_readValueAttribute(client, UA_NODEID_NUMERIC(nsIndex, numeric), val); } if (retval == UA_STATUSCODE_GOOD && UA_Variant_isScalar(val)) { if (val->type == &UA_TYPES[UA_TYPES_INT32]) { value = *(UA_Int32 *) val->data; //printf("UINT32 value is: %i\n", value); } else if (val->type == &UA_TYPES[UA_TYPES_UINT32]) { value = *(UA_UInt32 *) val->data; //printf("UA_UInt32 value is: %i\n", value); } else if (val->type == &UA_TYPES[UA_TYPES_INT16]) { value = *(UA_Int16 *) val->data; //printf("UA_Int16 value is: %i\n", value); } else if (val->type == &UA_TYPES[UA_TYPES_UINT16]) { value = *(UA_UInt16 *) val->data; //printf("UA_UInt16 value is: %i\n", value); } else { //printf("Unknown value type to read\n"); } } else { printf("[ERROR] C.readTagInt32: No value. Status=%s, Name=%s\n", UA_StatusCode_name(retval), name); } UA_Variant_delete(val); *ret = value; return retval; } UA_StatusCode writeTagInt32(UA_Client *client, UA_UInt16 nsIndex, char *name, UA_Int32 val) { UA_NodeId nodeId = UA_NODEID_STRING(nsIndex, name); UA_Variant *newValue = UA_Variant_new(); UA_Variant_setScalar(newValue, &val, &UA_TYPES[UA_TYPES_INT32]); UA_StatusCode statusCode = UA_Client_writeValueAttribute(client, nodeId, newValue); return statusCode; } // Helper to print trace info while scanning OPCUA tree void printRef(UA_ReferenceDescription *ref, uint8_t level) { //printf("level=%d\n", level); char *levelPref[level+1]; memset(levelPref, '_', level); levelPref[level] = '\0'; //printf("%*.s", level, levelPref); if (ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_STRING) { UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "%-3d %-3d %-5d %*.s %-16.*s %-16.*s", ref->nodeClass, ref->nodeId.nodeId.namespaceIndex, ref->nodeId.nodeId.identifier.numeric, level, *levelPref, (int) ref->nodeId.nodeId.identifier.string.length, ref->nodeId.nodeId.identifier.string.data, (int) ref->displayName.text.length, ref->displayName.text.data); } else if (ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_NUMERIC) { UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "%-3d %-3d %-5d %*.s %-16.*s %-16.*s", ref->nodeClass, ref->nodeId.nodeId.namespaceIndex, ref->nodeId.nodeId.identifier.numeric, level, *levelPref, (int) ref->browseName.name.length, ref->browseName.name.data, (int) ref->displayName.text.length, ref->displayName.text.data); } else { UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "[WARN] printRef: Unknown nodeId.identiferType = %d\n", ref->nodeId.nodeId.identifierType); } } // Add 'TAG' node to result list void putNodeToArray(UA_ReferenceDescription *ref, Array *a) { NodeData x; x.nameSpace = ref->nodeId.nodeId.namespaceIndex; x.displayName = (char *) malloc(strlen(ref->displayName.text.data) + 1); x.stringNodeId = (char *) malloc(2); strcpy(x.displayName, ref->displayName.text.data); if (ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_STRING) { //printRef(ref, 0); // variable found x.type = 3; x.intNodeId = -1; x.stringNodeId = (char *) malloc((int) ref->nodeId.nodeId.identifier.string.length + 1); strcpy(x.stringNodeId, ref->nodeId.nodeId.identifier.string.data); x.stringNodeId[ref->nodeId.nodeId.identifier.string.length] = '\0'; x.intNodeId = ref->nodeId.nodeId.identifier.numeric; insertArray(a, x); } else if (ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_NUMERIC) { // SKIP 'EM ! // printf("[WARN] putNodeToArray: Skipping UA_NODEIDTYPE_NUMERIC id = %d\n", ref->nodeId.nodeId.identifier.numeric); } else { printf("[WARN] putNodeToArray: Unknown nodeId.identiferType = %d\n", ref->nodeId.nodeId.identifierType); } if (x.stringNodeId != NULL) { free(x.stringNodeId); } if (x.displayName != NULL) { free(x.displayName); } } // Fixing wrond terminated string // it might be a bug in the library void fixNodeStringId(UA_NodeId *nodeId, int dn_len) { if (nodeId->identifier.numeric != 0) { size_t chankPos = strlstchar((char *)(nodeId->identifier.string.data), '.'); if (chankPos <= 0 || chankPos > 99999) { return; } size_t len = nodeId->identifier.string.length; size_t chunkLen = len - chankPos - 1; if (chunkLen > dn_len) { len = len - (chunkLen - dn_len); printf("[WARN] the indentifer.string is long!\n"); nodeId->identifier.string.length = len; nodeId->identifier.string.data[len] = '\0'; printf("[WARN] fixed string = %.*s \n", (int)(nodeId->identifier.string.length), nodeId->identifier.string.data); } } } // Getting node by Id and scanf for it children void browseNodeId(UA_Client *client, UA_NodeId *nodeId, Array *a, ArrayInt *numNodeIDs, uint8_t level, int debug) { level += 2; UA_BrowseRequest bReq3; UA_BrowseRequest_init(&bReq3); bReq3.requestedMaxReferencesPerNode = 0; bReq3.nodesToBrowse = UA_BrowseDescription_new(); bReq3.nodesToBrowseSize = 1; bReq3.nodesToBrowse[0].nodeId = *nodeId; bReq3.nodesToBrowse[0].resultMask = UA_BROWSERESULTMASK_ALL; /* return everything */ UA_BrowseResponse bResp3 = UA_Client_Service_browse(client, bReq3); for (size_t i = 0; i < bResp3.resultsSize; ++i) { for (size_t j = 0; j < bResp3.results[i].referencesSize; ++j) { UA_ReferenceDescription *ref = &(bResp3.results[i].references[j]); UA_UInt16 ns = ref->nodeId.nodeId.namespaceIndex; UA_UInt32 num = ref->nodeId.nodeId.identifier.numeric; UA_NodeClass ncl = ref->nodeClass; enum UA_NodeIdType ntyp = ref->nodeId.nodeId.identifierType; if (debug >= 6) { printRef(ref, level); // prints everything whatever it is } if (ntyp != UA_NODEIDTYPE_STRING && ntyp != UA_NODEIDTYPE_NUMERIC) { continue; } if (ncl == UA_NODECLASS_VARIABLE) { putNodeToArray(ref, a); continue; } else if (ncl == UA_NODECLASS_OBJECT || ncl == UA_NODECLASS_OBJECTTYPE) { // getting next node ID UA_NodeId nextId; // check duplicates if (contains(numNodeIDs, ns, num) != 0) { continue; } appendArrayInt(numNodeIDs, ns, num); // append nodeId to cache if (ntyp == UA_NODEIDTYPE_STRING) { nextId = UA_NODEID_STRING(ns, (char *)ref->nodeId.nodeId.identifier.string.data); fixNodeStringId(&nextId, (int)ref->displayName.text.length); } else { nextId = UA_NODEID_NUMERIC(ns, num); } browseNodeId(client, &nextId, a, numNodeIDs, level, debug); continue; } else { //printRef(ref); continue; } } } } Array *getNodesArray(UA_Client *client, int debug) { ArrayInt *numNodeIDs = initArrayInt(10); Array *a = initArray(5); UA_BrowseRequest bReq; UA_BrowseRequest_init(&bReq); bReq.requestedMaxReferencesPerNode = 0; bReq.nodesToBrowse = UA_BrowseDescription_new(); bReq.nodesToBrowseSize = 1; bReq.nodesToBrowse[0].nodeId = UA_NODEID_NUMERIC(0, UA_NS0ID_OBJECTSFOLDER); /* browse objects folder */ bReq.nodesToBrowse[0].resultMask = UA_BROWSERESULTMASK_ALL; /* return everything */ UA_BrowseResponse bResp = UA_Client_Service_browse(client, bReq); if (debug >= 6) { printf("%-9s %-9s %-16s %-16s %-16s\n", "NODECLASS", "NAMESPACE", "NODEID", "BROWSE NAME", "DISPLAY NAME"); } uint8_t level = 0; for (size_t i = 0; i < bResp.resultsSize; ++i) { for (size_t j = 0; j < bResp.results[i].referencesSize; ++j) { UA_ReferenceDescription *ref = &(bResp.results[i].references[j]); if (debug == 1) { printRef(ref, level); } if (ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_NUMERIC) { UA_NodeId nodeId = UA_NODEID_NUMERIC(ref->nodeId.nodeId.namespaceIndex, ref->nodeId.nodeId.identifier.numeric); if (contains(numNodeIDs, ref->nodeId.nodeId.namespaceIndex, ref->nodeId.nodeId.identifier.numeric) == 0) { appendArrayInt(numNodeIDs, ref->nodeId.nodeId.namespaceIndex, ref->nodeId.nodeId.identifier.numeric); browseNodeId(client, &nodeId, a, numNodeIDs, level, debug); } else { // do nothing, cycle ref } } else if (ref->nodeId.nodeId.identifierType == UA_NODEIDTYPE_STRING) { UA_NodeId nodeId = UA_NODEID_STRING(ref->nodeId.nodeId.namespaceIndex, ref->nodeId.nodeId.identifier.string.data); browseNodeId(client, &nodeId, a, numNodeIDs, level, debug); } } } UA_BrowseRequest_deleteMembers(&bReq); UA_BrowseResponse_deleteMembers(&bResp); printf("check cache:\n"); for (int i = 0; i < numNodeIDs->used; i++) { int ns = numNodeIDs->array[i].ns; int num = numNodeIDs->array[i].val; if (ns == 4 && num == 58) { printf("ns=%d, num=%d\n", ns, num); } } freeArrayInt(numNodeIDs); return a; } UA_Logger logger = UA_Log_Stdout; // wrapper UA_MonitoredItemCreateResult createDataExchange(UA_Client *client, UA_UInt32 subId, UA_TimestampsToReturn ts, const UA_MonitoredItemCreateRequest monRequest, void *context, int dataChangeCallbackId, int deleteItemCallbackId) { int *c = context; UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "createDataExchange called, subId=%d", subId); UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "createDataExchange called, fn=%d", *c); UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "createDataExchange called, ns=%d", monRequest.itemToMonitor.nodeId.namespaceIndex); UA_LOG_INFO(UA_Log_Stdout, UA_LOGCATEGORY_USERLAND, "createDataExchange called, stringId=%s", monRequest.itemToMonitor.nodeId.identifier.string.data); UA_MonitoredItemCreateResult *result = UA_MonitoredItemCreateResult_new(); UA_MonitoredItemCreateResult monResponse = UA_Client_MonitoredItems_createDataChange(client, subId, UA_TIMESTAMPSTORETURN_BOTH, monRequest, context, go_handler, NULL); return monResponse; }
37.358442
151
0.600362
e94699baa16ac62423417846a422ebb4518810db
1,819
h
C
StRoot/StEvent/StSvtBarrelHitCollection.h
xiaohaijin/RHIC-STAR
a305cb0a6ac15c8165bd8f0d074d7075d5e58752
[ "MIT" ]
2
2018-12-24T19:37:00.000Z
2022-02-28T06:57:20.000Z
StRoot/StEvent/StSvtBarrelHitCollection.h
xiaohaijin/RHIC-STAR
a305cb0a6ac15c8165bd8f0d074d7075d5e58752
[ "MIT" ]
null
null
null
StRoot/StEvent/StSvtBarrelHitCollection.h
xiaohaijin/RHIC-STAR
a305cb0a6ac15c8165bd8f0d074d7075d5e58752
[ "MIT" ]
null
null
null
/*! * \class StSvtBarrelHitCollection * \author Thomas Ullrich, Feb 2000 */ /*************************************************************************** * * $Id: StSvtBarrelHitCollection.h,v 2.3 2002/02/22 22:56:50 jeromel Exp $ * * Author: Thomas Ullrich, Feb 2000 *************************************************************************** * * Description: * *************************************************************************** * * $Log: StSvtBarrelHitCollection.h,v $ * Revision 2.3 2002/02/22 22:56:50 jeromel * Doxygen basic documentation in all header files. None of this is required * for QM production. * * Revision 2.2 2001/04/05 04:00:42 ullrich * Replaced all (U)Long_t by (U)Int_t and all redundant ROOT typedefs. * * Revision 2.1 2000/02/17 18:15:11 ullrich * Initial Revision * **************************************************************************/ #ifndef StSvtBarrelHitCollection_hh #define StSvtBarrelHitCollection_hh #include "StObject.h" #include "StSvtLadderHitCollection.h" class StSvtBarrelHitCollection : public StObject { public: StSvtBarrelHitCollection(); ~StSvtBarrelHitCollection(); // StSvtBarrelHitCollection(const StSvtBarrelHitCollection&); use default // const StSvtBarrelHitCollection& // operator=(const StSvtBarrelHitCollection&); use default unsigned int numberOfHits() const; unsigned int numberOfLadders() const; StSvtLadderHitCollection* ladder(unsigned int); const StSvtLadderHitCollection* ladder(unsigned int) const; void setBarrelNumber(int); private: enum { mMaxNumberOfLadders = 16 }; Int_t mBarrelNumber; StSvtLadderHitCollection mLadders[mMaxNumberOfLadders]; ClassDef(StSvtBarrelHitCollection,1) }; #endif
31.362069
77
0.590434
6a17b03d6b61a0af76188bdc9feb5adabe92dd9c
9,156
h
C
QYHCustomView/Classes/CustomView/QYHAlertView/QYHAlertView.h
qiuyh/CustomView
6d8d3f5ce6dc59063cdbbc7471f95a0932fd9b41
[ "MIT" ]
1
2021-03-18T05:38:15.000Z
2021-03-18T05:38:15.000Z
QYHCustomView/Classes/CustomView/QYHAlertView/QYHAlertView.h
qiuyh/CustomView
6d8d3f5ce6dc59063cdbbc7471f95a0932fd9b41
[ "MIT" ]
null
null
null
QYHCustomView/Classes/CustomView/QYHAlertView/QYHAlertView.h
qiuyh/CustomView
6d8d3f5ce6dc59063cdbbc7471f95a0932fd9b41
[ "MIT" ]
null
null
null
// // QYHAlertView.h // QYHProgressHUD // // Created by saj-king on 2020/4/7. // Copyright © 2020 SAJ. All rights reserved. // #import <UIKit/UIKit.h> NS_ASSUME_NONNULL_BEGIN @interface QYHAlertView : UIView /** 可以自由更改以下控件的属性 */ @property (nonatomic, strong) UIColor *dimBackgroundColor;//背景颜色 @property (nonatomic, strong) UIColor *alertViewColor;//alertView颜色 @property (nonatomic, strong) UIImageView *iconImageView; @property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *messageLabel; @property (nonatomic, strong) UITextField *textField; @property (nonatomic, strong) UIView *hLineView; @property (nonatomic, strong) UIView *vLineView; @property (nonatomic, strong) UIButton *cancelButton; @property (nonatomic, strong) UIButton *confirmButton; /** 相当于alertView,带title,message */ - (instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 相当于alertView,类方法,带title,message */ + (instancetype)alertViewWithTitle:(nullable NSString *)title message:(nullable NSString *)message actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带icon,title,message */ - (instancetype)initWithIcon:(nullable NSString *)icon title:(nullable NSString *)title message:(nullable NSString *)message actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带icon,title,message */ + (instancetype)alertViewWithIcon:(nullable NSString *)icon title:(nullable NSString *)title message:(nullable NSString *)message actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带icon,title */ - (instancetype)initWithIcon:(nullable NSString *)icon title:(nullable NSString *)title actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带icon,title */ + (instancetype)alertViewWithIcon:(nullable NSString *)icon title:(nullable NSString *)title actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带icon,message; */ - (instancetype)initWithIcon:(nullable NSString *)icon message:(nullable NSString *)message actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带icon,message; */ + (instancetype)alertViewWithIcon:(nullable NSString *)icon message:(nullable NSString *)message actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带icon,title,textField,textField为YES时需要手动调用hideAnimated隐藏; */ - (instancetype)initWithIcon:(nullable NSString *)icon title:(nullable NSString *)title textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带icon,title,textField,textFieldd为YES时需要手动调用hideAnimated隐藏; */ + (instancetype)alertViewWithIcon:(nullable NSString *)icon title:(nullable NSString *)title textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带icon,message,textField,textField为YES时需要手动调用hideAnimated隐藏; */ - (instancetype)initWithIcon:(nullable NSString *)icon message:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带icon,message,textField,textField为YES时需要手动调用hideAnimated隐藏; */ + (instancetype)alertViewWithIcon:(nullable NSString *)icon message:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带message,textField,textField为YES时需要手动调用hideAnimated隐藏; */ - (instancetype)initWithMessage:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带message,textField,textFieldd为YES时需要手动调用hideAnimated隐藏; */ + (instancetype)alertViewWithMessage:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带title,textField,textField为YES时需要手动调用hideAnimated隐藏; */ - (instancetype)initWithTitle:(nullable NSString *)title textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带title,textField,textField为YES时需要手动调用hideAnimated隐藏; */ + (instancetype)alertViewWithTitle:(nullable NSString *)title textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带title,message,textField,textField为YES时需要手动调用hideAnimated隐藏; */ - (instancetype)initWithTitle:(nullable NSString *)title message:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带title,message,textField,textField为YES时需要手动调用hideAnimated隐藏; */ + (instancetype)alertViewWithTitle:(nullable NSString *)title message:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 带icon,title,message,textField,textField为YES时需要手动调用hideAnimated隐藏; */ - (instancetype)initWithIcon:(nullable NSString *)icon title:(nullable NSString *)title message:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; /** 类方法, 带icon,title,message,textField,textField为YES时需要手动调用hideAnimated隐藏; */ + (instancetype)alertViewWithIcon:(nullable NSString *)icon title:(nullable NSString *)title message:(nullable NSString *)message textField:(BOOL)textField actionCancelWithTitle:(nullable NSString *)cancelTitle actionConfirmWithTitle:(nullable NSString *)confirmTitle handler:(void (^ __nullable)(NSInteger index))handler; - (void)hideAnimated:(BOOL)animated; + (void)hideAnimated:(BOOL)animated; @end NS_ASSUME_NONNULL_END
41.808219
83
0.664045
3ac31bfd5ca4555a1d0291c40b1fd7e003e7903f
2,255
c
C
src/cc1/constant/constant.c
tomtix/bcc
480bdfc69cbc289da45902689b5c878c0f861776
[ "Apache-2.0" ]
3
2020-04-06T08:42:18.000Z
2020-10-27T17:31:39.000Z
src/cc1/constant/constant.c
tomtix/bcc
480bdfc69cbc289da45902689b5c878c0f861776
[ "Apache-2.0" ]
null
null
null
src/cc1/constant/constant.c
tomtix/bcc
480bdfc69cbc289da45902689b5c878c0f861776
[ "Apache-2.0" ]
null
null
null
#include <string.h> #include "./constant.h" #include "./string_literal.h" #include "../type/type.h" #include "../util/error.h" static struct constant *constant_new(enum constant_type type) { struct constant *c; c = calloc(sizeof*c, 1); c->constant_type = type; return c; } static struct constant *constant_str_integer(const char *string) { long value = 0; struct constant *cst = NULL; value = strtol(string, NULL, 0); cst = constant_new(CONSTANT_INT); cst->type = type_int; cst->integer.longv.signed_ = value; return cst; } struct constant *constant_hex_integer(const char *string) { return constant_str_integer(string); } struct constant *constant_oct_integer(const char *string) { return constant_str_integer(string); } struct constant *constant_dec_integer(const char *string) { return constant_str_integer(string); } struct constant *constant_string_literal(const char *string) { struct constant *cst = NULL; struct literal *lit = NULL; char *str = strdup(string); cst = constant_new(CONSTANT_STRING); struct pointer *ptr = pointer_new(list_new(0), NULL); cst->type = type_get_pointer_type(ptr, type_char); lit = string_get_or_create_literal(str); cst->stringv = lit->value; cst->strliteral = lit; return cst; } struct constant *constant_integer_long(long integer) { struct constant *cst = NULL; cst = constant_new(CONSTANT_LONG); cst->type = type_long; cst->integer.longv.signed_ = integer; return cst; } struct constant *constant_integer_int(int integer) { struct constant *cst = NULL; cst = constant_new(CONSTANT_INT); cst->type = type_int; cst->integer.intv.signed_ = integer; return cst; } struct constant *constant_floating_point(const char *input_string) { struct constant *cst = constant_new(CONSTANT_FLOAT); size_t len = strlen(input_string); if (input_string[len-1] == 'f' || input_string[len-1] == 'F') { cst->type = type_float; cst->floatv = strtof(input_string, NULL); } else { cst->constant_type = CONSTANT_DOUBLE; cst->type = type_double; cst->floatv = strtod(input_string, NULL); } return cst; }
22.326733
66
0.673614
5fbce55fb4880a30419d1e8846e6476989532353
657
h
C
src/qt/viewer/viewer.h
UNI-shibuya-taku/depth_clustering
eb4fdf83dc414ecde816554e874c7c1b7f878267
[ "MIT" ]
756
2018-05-22T08:16:02.000Z
2022-03-30T08:47:52.000Z
src/qt/viewer/viewer.h
UNI-shibuya-taku/depth_clustering
eb4fdf83dc414ecde816554e874c7c1b7f878267
[ "MIT" ]
62
2018-07-13T21:19:30.000Z
2022-02-21T02:23:30.000Z
src/qt/viewer/viewer.h
UNI-shibuya-taku/depth_clustering
eb4fdf83dc414ecde816554e874c7c1b7f878267
[ "MIT" ]
274
2018-05-31T07:37:09.000Z
2022-03-30T17:04:00.000Z
// Copyright (C) 2020 I. Bogoslavskyi, C. Stachniss // // GNU-GPL licence that follows one of libQGLViewer. #ifndef SRC_QT_VIEWER_VIEWER_H_ #define SRC_QT_VIEWER_VIEWER_H_ #include <QGLViewer/qglviewer.h> #include <mutex> #include <vector> #include "qt/drawables/drawable.h" class Viewer : public QGLViewer { public: explicit Viewer(QWidget* parent = 0) : QGLViewer(parent) {} void AddDrawable(Drawable::Ptr drawable); void Clear(); ~Viewer() override {} protected: void draw() override; void init() override; private: std::vector<Drawable::Ptr> _drawables; mutable std::mutex _cloud_mutex; }; #endif // SRC_QT_VIEWER_VIEWER_H_
20.53125
61
0.729072
38b3c2da1987ee3de900b72a5486a0e621246836
487
h
C
Engine/Graphics/GXM/GXMIndexBuffer.h
guimeixen/Engine
fcea39d2099b613b32b20462586e1c932bbb24fc
[ "MIT" ]
null
null
null
Engine/Graphics/GXM/GXMIndexBuffer.h
guimeixen/Engine
fcea39d2099b613b32b20462586e1c932bbb24fc
[ "MIT" ]
17
2021-03-12T18:19:07.000Z
2021-08-06T21:25:35.000Z
Engine/Graphics/GXM/GXMIndexBuffer.h
guimeixen/Engine
fcea39d2099b613b32b20462586e1c932bbb24fc
[ "MIT" ]
null
null
null
#pragma once #include "Graphics/Buffers.h" #include "psp2/types.h" namespace Engine { class GXMIndexBuffer : public Buffer { public: GXMIndexBuffer(const void *data, unsigned int size, BufferUsage usage); ~GXMIndexBuffer(); void BindTo(unsigned int bindingIndex) override; void Update(const void *data, unsigned int size, int offset) override; unsigned short *GetIndicesHandle() const { return indices; } private: SceUID indicesUID; unsigned short *indices; }; }
20.291667
73
0.73922
1696318514e5f92f663deaa6490ca6b7aaff60c5
1,658
h
C
src/utility.h
ATh0m/SimpleHexRiskGame
9e2f08cab510a7916effe9a0a248b7c1bf928488
[ "MIT" ]
1
2017-11-11T23:37:58.000Z
2017-11-11T23:37:58.000Z
src/utility.h
ATh0m/SimpleHexRiskGame
9e2f08cab510a7916effe9a0a248b7c1bf928488
[ "MIT" ]
null
null
null
src/utility.h
ATh0m/SimpleHexRiskGame
9e2f08cab510a7916effe9a0a248b7c1bf928488
[ "MIT" ]
null
null
null
#ifndef SIMPLEHEXRISKGAME_UTILITY_H #define SIMPLEHEXRISKGAME_UTILITY_H #include "defs.h" enum State { CREATE, START, REINFORCEMENT, MOVE, WIN }; enum Race { NEUTRAL, ENEMY, ALLY }; typedef struct Color { Uint8 r, g, b, a; } Color; /** * Tworzenie struktury {Color} */ Color create_color(int r, int g, int b, int a); typedef struct Pair { int x, y; } Pair; /** * Tworzenie struktury {Pair} */ Pair create_pair(int x, int y); typedef struct Triple { int x, y, z; } Triple; /** * Tworzenie struktury {Triple} */ Triple create_triple(int x, int y, int z); /** * Zwraca max z dwóch liczb */ int max(int a, int b); /** * Zwraca min z dwóch liczb */ int min(int a, int b); /** * Zwraca wartość bezwzględną liczby */ int abs(int a); typedef struct PairItem { Pair pair; struct PairItem *prev; } PairItem; /** * Tworzy nową strukturę {PairItem}, alokuje pamięć i ustawia domyślne wartości */ PairItem *create_pair_item(Pair pair, PairItem *prev); typedef struct PairStack { int size; PairItem *top; } PairStack; /** * Tworzy nową strukturę {PairStack}, alokuje pamięć i ustawia domyślne wartości */ PairStack *create_pair_stack(); /** * Wkładanie nowej wartości na koniec do stosu {PairStack} */ void push(PairStack *pair_stack, Pair pair); /** * Usuwanie pierwszego wystąpienia w stosie {PairStack} */ void erase(PairStack *pair_stack, Pair pair); /** * Czyści strukturę {PairStack} i zwalnia pamięć */ void delete_pair_stack(PairStack *pair_stack); /** * Wypisuje strukturę {PairStack} na standardowe wyjście */ void print_stack(PairStack *pair_stack); #endif
16.254902
80
0.677322
753e0950a3649e1af0d7f312cc7d0eeb5f7663c3
3,648
c
C
marching_cube/model/cffi/src/occupancy_connectivity.c
YiyiLiao/deep_marching_cubes
afcad99742435eb0d57d32770befed74faaad2ab
[ "Unlicense" ]
206
2018-06-17T19:52:12.000Z
2022-03-16T02:29:57.000Z
marching_cube/model/cffi/src/occupancy_connectivity.c
ClarenceHoo/deep_marching_cubes
6fce0b26d110a6c839b6d46ea2ab67b5bdb470b2
[ "Unlicense" ]
5
2019-04-18T06:27:11.000Z
2020-11-02T20:06:22.000Z
marching_cube/model/cffi/src/occupancy_connectivity.c
ClarenceHoo/deep_marching_cubes
6fce0b26d110a6c839b6d46ea2ab67b5bdb470b2
[ "Unlicense" ]
32
2018-06-18T09:33:34.000Z
2022-03-01T12:22:43.000Z
#include <TH/TH.h> #include <stdio.h> #include <math.h> /* * Forward function, regularize the neighboring occupancy status to be close * params: * occupancy input, (W+1)x(H+1)x(D+1) * loss output, connectivity loss * */ int occupancy_connectivity_forward( THFloatTensor *occupancy, THFloatTensor *loss ){ int W = THFloatTensor_size(occupancy, 0); int H = THFloatTensor_size(occupancy, 1); int D = THFloatTensor_size(occupancy, 2); // data format check if (THFloatTensor_nDimension(occupancy)!=3 || THFloatTensor_nDimension(loss)!=1){ printf("Invalid nDimension!\n"); printf("Expected 3, 1, received %d, %d\n", THFloatTensor_nDimension(occupancy), THFloatTensor_nDimension(loss)); return 0; } float loss_=0.0; for(int i=0; i<W; i++){ for (int j=0; j<H; j++){ for (int k=0; k<D; k++){ float p1 = THFloatTensor_get3d(occupancy, i, j, k); if (j<H-1){ float p2 = THFloatTensor_get3d(occupancy, i, j+1, k); // l1 loss loss_ += fabs(p1-p2); } if (i<W-1){ float p3 = THFloatTensor_get3d(occupancy, i+1, j, k); // l1 loss loss_ += fabs(p1-p3); } if (k<D-1){ float p4 = THFloatTensor_get3d(occupancy, i, j, k+1); // l1 loss loss_ += fabs(p1-p4); } } } } THFloatTensor_set1d(loss, 0, loss_); return 1; } /* * Backward function, propagate the loss to every occupancy status * params: * grad_output input, 1, gradient on the loss * occupancy input, (W+1)x(H+1)x(D+1) * grad_occupancy output, (W+1)x(H+1)x(D+1), gradient on the occupancy * */ int occupancy_connectivity_backward( THFloatTensor *grad_output, THFloatTensor *occupancy, THFloatTensor *grad_occupancy ){ int W = THFloatTensor_size(occupancy, 0); int H = THFloatTensor_size(occupancy, 1); int D = THFloatTensor_size(occupancy, 2); float curr_grad; for(int i=0; i<W; i++){ for (int j=0; j<H; j++){ for (int k=0; k<D; k++){ float p1 = THFloatTensor_get3d(occupancy, i, j, k); float sign; if (j<H-1){ float p2 = THFloatTensor_get3d(occupancy, i, j+1, k); if (p1-p2>0){ sign = 1.0; } else { sign = -1.0; } curr_grad = THFloatTensor_get3d(grad_occupancy, i, j, k); THFloatTensor_set3d(grad_occupancy, i, j, k, curr_grad + sign); curr_grad = THFloatTensor_get3d(grad_occupancy, i, j+1, k); THFloatTensor_set3d(grad_occupancy, i, j+1, k, curr_grad - sign); } if (i<W-1){ float p3 = THFloatTensor_get3d(occupancy, i+1, j, k); if (p1-p3>0){ sign = 1.0; } else { sign = -1.0; } curr_grad = THFloatTensor_get3d(grad_occupancy, i, j, k); THFloatTensor_set3d(grad_occupancy, i , j, k, curr_grad + sign); curr_grad = THFloatTensor_get3d(grad_occupancy, i+1, j, k); THFloatTensor_set3d(grad_occupancy, i+1, j, k, curr_grad - sign); } if (k<D-1){ float p4 = THFloatTensor_get3d(occupancy, i, j, k+1); if (p1-p4>0){ sign = 1.0; } else { sign = -1.0; } curr_grad = THFloatTensor_get3d(grad_occupancy, i, j, k); THFloatTensor_set3d(grad_occupancy, i , j, k, curr_grad + sign); curr_grad = THFloatTensor_get3d(grad_occupancy, i, j, k+1); THFloatTensor_set3d(grad_occupancy, i, j, k+1, curr_grad - sign); } } } } float grad_output_=THFloatTensor_get1d(grad_output, 0); THFloatTensor_mul(grad_occupancy, grad_occupancy, grad_output_); return 1; }
31.721739
123
0.596217
d4d3f4c0728146427b8a2853a0c350e87f583d74
593
h
C
modules/task_2/rachin_i_mult_mat_by_vec/mult_mat_by_vec.h
GorbunovaVI/pp_2020_autumn_engineer
a2676a9a77e838195af8cc4ae548ecb63fa4bf14
[ "BSD-3-Clause" ]
1
2020-10-30T13:49:58.000Z
2020-10-30T13:49:58.000Z
modules/task_2/rachin_i_mult_mat_by_vec/mult_mat_by_vec.h
GorbunovaVI/pp_2020_autumn_engineer
a2676a9a77e838195af8cc4ae548ecb63fa4bf14
[ "BSD-3-Clause" ]
1
2020-11-01T18:53:35.000Z
2020-11-01T18:53:35.000Z
modules/task_2/rachin_i_mult_mat_by_vec/mult_mat_by_vec.h
GorbunovaVI/pp_2020_autumn_engineer
a2676a9a77e838195af8cc4ae548ecb63fa4bf14
[ "BSD-3-Clause" ]
1
2021-03-14T18:08:22.000Z
2021-03-14T18:08:22.000Z
// Copyright 2020 Rachin Igor #ifndef MODULES_TASK_2_RACHIN_I_MULT_MAT_BY_VEC_MULT_MAT_BY_VEC_H_ #define MODULES_TASK_2_RACHIN_I_MULT_MAT_BY_VEC_MULT_MAT_BY_VEC_H_ #include <vector> #include <string> std::vector<int> getRandomMatrix(int rows, int clmns); std::vector<int> getRandomVector(int vsize); std::vector<int> getParallelMult(std::vector<int> mx, int rows, int clmns, std::vector<int> vec, int vsize); std::vector<int> getSequentialMult(std::vector<int> mx, int rows, int clmns, std::vector<int> vec, int vsize); #endif // MODULES_TASK_2_RACHIN_I_MULT_MAT_BY_VEC_MULT_MAT_BY_VEC_H_
42.357143
110
0.804384
d9dbc46375d182def55271bade972411a57c4e95
4,507
h
C
STEER/ESD/AliESDADfriend.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
52
2016-12-11T13:04:01.000Z
2022-03-11T11:49:35.000Z
STEER/ESD/AliESDADfriend.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
1,388
2016-11-01T10:27:36.000Z
2022-03-30T15:26:09.000Z
STEER/ESD/AliESDADfriend.h
AllaMaevskaya/AliRoot
c53712645bf1c7d5f565b0d3228e3a6b9b09011a
[ "BSD-3-Clause" ]
275
2016-06-21T20:24:05.000Z
2022-03-31T13:06:19.000Z
#ifndef ALIESDADFRIEND_H #define ALIESDADFRIEND_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /////////////////////////////////////////////////////////////////////////////// /// /// This is a class for containing all the AD DDL raw data /// It is written to the ESD-friend file /// /////////////////////////////////////////////////////////////////////////////// #include <TObject.h> class AliESDADfriend: public TObject { public : AliESDADfriend(); virtual ~AliESDADfriend(); AliESDADfriend(const AliESDADfriend& adfriend); AliESDADfriend& operator = (const AliESDADfriend& adfriend); void Reset(); // Getters of various scalers and Minimum Bias flags : ULong64_t GetBBScalers(Int_t channel) const { return fBBScalers[channel]; } ULong64_t GetBGScalers(Int_t channel) const { return fBGScalers[channel]; } UInt_t GetTriggerScalers(Int_t num_scaler) const { return fScalers[num_scaler]; } // Getters of ADC signals, ADC pedestals, time information and corresponding flags : Float_t GetADC(Int_t channel) const { return fADC[channel][kNEvOfInt/2]; } Float_t GetPedestal(Int_t channel, Int_t event) const { return fADC[channel][event]; } Bool_t GetIntegratorFlag(Int_t channel, Int_t event) const { return fIsInt[channel][event]; } Bool_t GetBBFlag(Int_t channel, Int_t event) const { return fIsBB[channel][event]; } Bool_t GetBGFlag(Int_t channel, Int_t event) const { return fIsBG[channel][event]; } Float_t GetTime(Int_t channel) const { return fTime[channel]; } Float_t GetWidth(Int_t channel) const { return fWidth[channel]; } // Setters void SetBBScalers(Int_t channel, ULong64_t scalers) { fBBScalers[channel] = scalers; } void SetBGScalers(Int_t channel, ULong64_t scalers) { fBGScalers[channel] = scalers; } void SetTriggerScalers(Int_t num_scaler, UInt_t scaler) { fScalers[num_scaler] = scaler; } void SetPedestal(Int_t channel, Int_t event, Float_t adc) { fADC[channel][event] = adc; } void SetIntegratorFlag(Int_t channel, Int_t event, Bool_t flag) { fIsInt[channel][event] = flag; } void SetBBFlag(Int_t channel, Int_t event, Bool_t flag) { fIsBB[channel][event] = flag; } void SetBGFlag(Int_t channel, Int_t event, Bool_t flag) { fIsBG[channel][event] = flag; } void SetTime(Int_t channel, Float_t time) { fTime[channel] = time; } void SetWidth(Int_t channel, Float_t width) { fWidth[channel] = width; } UShort_t GetTriggerInputs() const { return fTrigger; } UShort_t GetTriggerInputsMask() const { return fTriggerMask; } void SetTriggerInputs(UShort_t inputs) { fTrigger = inputs; } void SetTriggerInputsMask(UShort_t mask) { fTriggerMask = mask; } enum EESDADfriendParams { kNChannels = 16, // number of electronic channels in AD (FEE numbering) kNEvOfInt = 21, // number of events of interest kNScalers = 16, // number of scalers }; private: ULong64_t fBBScalers[kNChannels]; // 'Beam-Beam' scalers for all channels ULong64_t fBGScalers[kNChannels]; // 'Beam-Gas' scalers for all channels UInt_t fScalers[kNScalers]; // Trigger scalers Float_t fADC[kNChannels][kNEvOfInt]; // ADC counts for all channels and all events of interest Bool_t fIsInt[kNChannels][kNEvOfInt]; // 'Integrator' flag for all channels Bool_t fIsBB[kNChannels][kNEvOfInt]; // 'Beam-Beam' flag for all channels Bool_t fIsBG[kNChannels][kNEvOfInt]; // 'Beam-Gas' flag for all channels Float_t fTime[kNChannels]; // leading time for all channels - from HPTDC - in nanoseconds Float_t fWidth[kNChannels]; // pulse width for all channels - from HPTDC - in nanoseconds UShort_t fTrigger; // AD trigger inputs UShort_t fTriggerMask; // AD trigger inputs mask ClassDef(AliESDADfriend, 2) // container class for AD DDL raw data }; #endif
41.731481
111
0.601509