blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
333
content_id
stringlengths
40
40
detected_licenses
listlengths
0
58
license_type
stringclasses
2 values
repo_name
stringlengths
5
113
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
604 values
visit_date
timestamp[us]date
2016-08-02 21:20:34
2023-09-06 10:17:08
revision_date
timestamp[us]date
1970-01-01 00:00:00
2023-09-05 20:12:54
committer_date
timestamp[us]date
1970-01-01 00:00:00
2023-09-05 20:12:54
github_id
int64
966
664M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
23 values
gha_event_created_at
timestamp[us]date
2012-06-18 16:43:44
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-02-03 21:17:16
2023-07-07 15:57:14
gha_language
stringclasses
121 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
128
17.8k
extension
stringclasses
134 values
content
stringlengths
128
8.19k
authors
listlengths
1
1
author_id
stringlengths
1
143
15ffcaa5ad23f5ad5d3e5b90f346dc43ed241165
49fc9092d53d1c06843986e57cf3b7e63007acdf
/include/eventmusic.h
bd688aa5bec9cc235ac983cdf569a4e520c54e96
[]
no_license
ptitSeb/freespace2
8615e5c55b9a19bdf280bc0e0b164f9e33640045
500ee249f7033aac9b389436b1737a404277259c
refs/heads/master
2020-09-20T19:13:59.618314
2019-01-02T10:51:59
2019-01-02T10:51:59
67,286,355
9
3
null
null
null
null
UTF-8
C
false
false
7,435
h
/* * Copyright (C) Volition, Inc. 1999. All rights reserved. * * All source code herein is the property of Volition, Inc. You may not sell * or otherwise commercially exploit the source or things you created based on * the source. */ /* * $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $ * $Revision: 307 $ * $Date: 2010-02-08 09:09:13 +0100 (Mon, 08 Feb 2010) $ * $Author: taylor $ * * Header file for high-level control of event driven music * * $Log$ * Revision 1.3 2003/05/25 02:30:42 taylor * Freespace 1 support * * Revision 1.2 2002/06/09 04:41:13 relnev * added copyright header * * Revision 1.1.1.1 2002/05/03 03:28:12 root * Initial import. * * * 5 8/11/99 5:33p Jefff * added 3rd debrief music track * * 4 6/20/99 12:06a Alanl * new event music changes * * 3 11/20/98 4:08p Dave * Fixed flak effect in multiplayer. * * 2 10/07/98 10:52a Dave * Initial checkin. * * 1 10/07/98 10:48a Dave * * 27 9/18/98 1:22p Dave * Added new event music stuff defines. * * 26 5/18/98 5:22p Lawrance * Support new briefing music * * 25 5/03/98 1:54a Lawrance * Fix event music problems related to respawning * * 24 12/30/97 11:46a Lawrance * Support a success debriefing music. * * 23 12/28/97 5:52p Lawrance * Add support for debriefing success/fail music. * * 22 12/26/97 10:01p Lawrance * Add goal failure music... remove unused arrival music patterns * * 21 9/19/97 5:13p Lawrance * add support for specifying music in the mission file * * 20 9/09/97 5:24p Lawrance * added ability to switch soundtracks, gave soundtracks real names * * 19 9/06/97 2:13p Mike * Replace support for TEAM_NEUTRAL * * 18 5/14/97 9:54a Lawrance * supporting mission-specific briefing music * * 17 4/21/97 5:36p Lawrance * add in hooks to play death music when pilot dies * * 16 4/17/97 3:28p Lawrance * documented functions * * 15 4/14/97 1:52p Lawrance * making transitions happen on measure boundries * * 14 4/07/97 1:39p Lawrance * added event_music_first_pattern(); * * 13 4/03/97 4:26p Lawrance * getting digital event music working * * 12 3/07/97 8:53a Lawrance * Read event at time 0 when music first starts * * 11 2/25/97 11:10a Lawrance * using text of the mission name to match up which midi file gets played * for which mission * * 10 2/18/97 9:43a Lawrance * make BTTL_2 play after 2 enemy arrivals in battle mode. Then switch * back to default BTTL_1 until 2 more. * * 9 2/14/97 11:50a Lawrance * added BTTL_2 track * * 8 2/11/97 4:22p Lawrance * adding song switching request to the event music level * * 7 2/11/97 9:15a Lawrance * taking out BTTL_2 and BTTL_3 * * 6 2/10/97 9:26a Lawrance * * 5 2/05/97 3:12p Lawrance * supporting changes in MIDI system that remove any high-level * dependencies * * 4 2/04/97 11:58p Lawrance * volume change code, and fixing some bugs * * 3 2/04/97 12:02p Lawrance * fixed temp bug, integrating music.tbl * * 2 2/03/97 6:49p Lawrance * Event Music interface working * * $NoKeywords: $ */ #ifndef __EVENT_MUSIC_H__ #define __EVENT_MUSIC_H__ #include "parselo.h" // Identifies songs in the Soundtrack_filenames[] structure. The order matches up with // what is in music.tbl. Do not modify without synching music.tbl. #ifdef MAKE_FS1 #define SONG_NRML_1 0 // Normal Song 1 #define SONG_NRML_2 1 // Normal Song 2 #define SONG_NRML_3 2 // Normal Song 3 #define SONG_AARV_1 3 // Allied Arrival 1 #define SONG_EARV_1 4 // Enemy Arrival 1 #define SONG_BTTL_1 5 // Battle Song 1 #define SONG_BTTL_2 6 // Battle Song 2 #define SONG_BTTL_3 7 // Battle Song 3 #define SONG_AARV_2 8 // Allied Arrival 2 #define SONG_EARV_2 9 // Enemy Arrival 2 #define SONG_VICT_1 10 // Victory Song 1 #define SONG_VICT_2 11 // Victory Song 2 #define SONG_FAIL_1 12 // Goal Failed #define SONG_DEAD_1 13 // Death Song 1 #define MAX_PATTERNS 14 #else #define SONG_NRML_1 0 // Normal Song 1 #define SONG_AARV_1 1 // Allied Arrival 1 #define SONG_EARV_1 2 // Enemy Arrival 1 #define SONG_BTTL_1 3 // Battle Song 1 #define SONG_BTTL_2 4 // Battle Song 2 #define SONG_BTTL_3 5 // Battle Song 3 #define SONG_AARV_2 6 // Allied Arrival 2 #define SONG_EARV_2 7 // Enemy Arrival 2 #define SONG_VICT_1 8 // Victory Song 1 #define SONG_VICT_2 9 // Victory Song 2 #define SONG_FAIL_1 10 // Goal Failed #define SONG_DEAD_1 11 // Death Song 1 #define MAX_PATTERNS 12 #endif // if player targets a hostile ship at less than this range, switch to battle track #define BATTLE_START_MIN_TARGET_DIST 500 extern int Event_Music_battle_started; // flag that will tell us if we've started a battle in the current mission extern int Event_music_enabled; extern float Master_event_music_volume; // range is 0->1 ///////////////////////////////////////////////////////////////////////////// // Used to track what briefing and debriefing music is played for the mission ///////////////////////////////////////////////////////////////////////////// #define NUM_SCORES 4 #define SCORE_BRIEFING 0 #define SCORE_DEBRIEF_SUCCESS 1 #define SCORE_DEBRIEF_AVERAGE 2 #define SCORE_DEBRIEF_FAIL 3 extern int Mission_music[NUM_SCORES]; // indicies into Spooled_music[] ///////////////////////////////////////////////////////////////////////////// extern int Current_soundtrack_num; // index into Soundtracks[] // menu music storage typedef struct menu_music { char name[NAME_LENGTH]; // name music is known by char filename[MAX_FILENAME_LEN]; // name music is stored on disk as } menu_music; #define MAX_SPOOLED_MUSIC 20 extern menu_music Spooled_music[MAX_SPOOLED_MUSIC]; extern int Num_music_files; // event music soundtrack storage typedef struct tagSOUNDTRACK_INFO { int num_patterns; char name[NAME_LENGTH]; char pattern_fnames[MAX_PATTERNS][MAX_FILENAME_LEN]; } SOUNDTRACK_INFO; #define MAX_SOUNDTRACKS 10 extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS]; extern int Num_soundtracks; void event_music_init(); void event_music_close(); void event_music_level_init(int force_soundtrack = -1); void event_music_level_close(); void event_music_do_frame(); void event_music_disable(); void event_music_enable(); void event_music_pause(); void event_music_unpause(); void event_music_set_volume_all(float volume); void event_music_parse_musictbl(); void event_music_change_pattern(int new_pattern); int event_music_return_current_pattern(); void event_music_first_pattern(); int event_music_battle_start(); int event_music_enemy_arrival(); int event_music_friendly_arrival(); void event_music_arrival(int team); int event_music_primary_goals_met(); int event_music_primary_goal_failed(); int event_music_player_death(); void event_music_start_default(); void event_music_get_info(char *outbuf); void event_music_get_soundtrack_name(char *outbuf); int event_music_next_soundtrack(int delta); void event_music_set_soundtrack(char *name); void event_music_set_score(int score_index, const char *name); int event_music_get_spooled_music_index(const char *name); void event_music_reset_choices(); int event_music_player_respawn(); int event_music_player_respawn_as_observer(); void event_music_hostile_ship_destroyed(); #endif /* __EVENT_MUSIC_H__ */
[ "sebastien.chev@gmail.com" ]
sebastien.chev@gmail.com
785009f2b47ab82155bb032d0672425c5ef4895b
3f5022154cbec1bb4643a50316e297f979b53184
/gcc-7.4.0-amd64/usr/lib/gcc/x86_64-astraeus-linux-gnu/7.4.0/plugin/include/config/i386/linux-common.h
b79f82c8c20c9ec9aa7de45035f825e6ecc92b5b
[]
no_license
ahyangyi/astraeus-toolchain-binary
45b011d3a247e67fa86f0572a183dca3fbf6abd5
4c56bf133c52ddba4e357d39fc13b2755dce0583
refs/heads/master
2020-07-31T06:35:10.026719
2019-09-25T15:12:19
2019-09-25T15:12:19
210,516,474
0
0
null
null
null
null
UTF-8
C
false
false
129
h
version https://git-lfs.github.com/spec/v1 oid sha256:0aebc4f471ae1b1e7f3dcf14c4d72cb2656f4f00580868228caa0e1fb38457df size 3884
[ "ahyangyi@gmail.com" ]
ahyangyi@gmail.com
ad488be8e7fc8a1d8412d524b85eaba0b0a7e5f6
8c346cd85cc75fe9a4ba4399df38f940cc8e264c
/versions/libft_0/srcs/ft_strclr.c
47b391d4a4b43f49d8fe9eba4ad9fb8bdec7740d
[]
no_license
tcajee/libft
ff144ce4d587af8419d8ff2e3c4c494e72c67334
822dae85be4597786f4631873835673e3a6c348a
refs/heads/master
2020-05-23T22:35:50.940691
2019-10-10T12:47:36
2019-10-10T12:47:36
186,977,004
0
0
null
null
null
null
UTF-8
C
false
false
989
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strclr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tcajee <tcajee@student.wethinkcode.co.za> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/05/29 14:15:01 by tcajee #+# #+# */ /* Updated: 2019/08/16 12:21:08 by tcajee ### ########.fr */ /* */ /* ************************************************************************** */ #include "../incs/libft.h" void ft_strclr(char *as) { if (as) while (*as) *as++ = '\0'; }
[ "tcajee@c4r16s1.wethinkcode.co.za" ]
tcajee@c4r16s1.wethinkcode.co.za
4fe83bbb64aa0c4d6bd8734cd1becd9d50e1be46
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
/source/linux/drivers/net/ethernet/huawei/hinic/extr_hinic_hw_eqs.c_aeq_irq_handler.c
34439b428bf750b34ed4f640cd3ba741fca7a51f
[]
no_license
isabella232/AnghaBench
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
9a5f60cdc907a0475090eef45e5be43392c25132
refs/heads/master
2023-04-20T09:05:33.024569
2021-05-07T18:36:26
2021-05-07T18:36:26
null
0
0
null
null
null
null
UTF-8
C
false
false
3,120
c
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ u32 ; struct pci_dev {int /*<<< orphan*/ dev; } ; struct hinic_hwif {struct pci_dev* pdev; } ; struct hinic_hw_event_cb {unsigned long hwe_state; int /*<<< orphan*/ handle; int /*<<< orphan*/ (* hwe_handler ) (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;} ; struct hinic_eq {int q_len; int wrapped; int cons_idx; } ; struct hinic_aeqs {struct hinic_hw_event_cb* hwe_cb; struct hinic_hwif* hwif; } ; struct hinic_aeq_elem {int /*<<< orphan*/ data; int /*<<< orphan*/ desc; } ; typedef enum hinic_aeq_type { ____Placeholder_hinic_aeq_type } hinic_aeq_type ; /* Variables and functions */ struct hinic_aeq_elem* GET_CURR_AEQ_ELEM (struct hinic_eq*) ; unsigned long HINIC_EQE_ENABLED ; unsigned long HINIC_EQE_RUNNING ; int HINIC_EQ_ELEM_DESC_GET (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int HINIC_MAX_AEQ_EVENTS ; int /*<<< orphan*/ SIZE ; int /*<<< orphan*/ SRC ; int /*<<< orphan*/ TYPE ; int /*<<< orphan*/ WRAPPED ; struct hinic_aeqs* aeq_to_aeqs (struct hinic_eq*) ; int /*<<< orphan*/ be32_to_cpu (int /*<<< orphan*/ ) ; unsigned long cmpxchg (unsigned long*,unsigned long,unsigned long) ; int /*<<< orphan*/ dev_err (int /*<<< orphan*/ *,char*,int) ; int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void aeq_irq_handler(struct hinic_eq *eq) { struct hinic_aeqs *aeqs = aeq_to_aeqs(eq); struct hinic_hwif *hwif = aeqs->hwif; struct pci_dev *pdev = hwif->pdev; struct hinic_aeq_elem *aeqe_curr; struct hinic_hw_event_cb *hwe_cb; enum hinic_aeq_type event; unsigned long eqe_state; u32 aeqe_desc; int i, size; for (i = 0; i < eq->q_len; i++) { aeqe_curr = GET_CURR_AEQ_ELEM(eq); /* Data in HW is in Big endian Format */ aeqe_desc = be32_to_cpu(aeqe_curr->desc); /* HW toggles the wrapped bit, when it adds eq element */ if (HINIC_EQ_ELEM_DESC_GET(aeqe_desc, WRAPPED) == eq->wrapped) break; event = HINIC_EQ_ELEM_DESC_GET(aeqe_desc, TYPE); if (event >= HINIC_MAX_AEQ_EVENTS) { dev_err(&pdev->dev, "Unknown AEQ Event %d\n", event); return; } if (!HINIC_EQ_ELEM_DESC_GET(aeqe_desc, SRC)) { hwe_cb = &aeqs->hwe_cb[event]; size = HINIC_EQ_ELEM_DESC_GET(aeqe_desc, SIZE); eqe_state = cmpxchg(&hwe_cb->hwe_state, HINIC_EQE_ENABLED, HINIC_EQE_ENABLED | HINIC_EQE_RUNNING); if ((eqe_state == HINIC_EQE_ENABLED) && (hwe_cb->hwe_handler)) hwe_cb->hwe_handler(hwe_cb->handle, aeqe_curr->data, size); else dev_err(&pdev->dev, "Unhandled AEQ Event %d\n", event); hwe_cb->hwe_state &= ~HINIC_EQE_RUNNING; } eq->cons_idx++; if (eq->cons_idx == eq->q_len) { eq->cons_idx = 0; eq->wrapped = !eq->wrapped; } } }
[ "brenocfg@gmail.com" ]
brenocfg@gmail.com
7925fd8cdd11f15221488b837887b4c5ab9796b1
6eb10fe55f231b8ebe9eff7d517bba471a6efe1b
/4UserLayer/Task/HandShake_Task.c
160d0325083cde6f8d1638312e9d3fc1e169052e
[]
no_license
liuchaonuaa/SingleDoorApp
bf04cec0aace9a1e303989ccd1d76e1d24753e31
0bc7b8e936825dfcc8417cfd13ad420f35273105
refs/heads/master
2023-07-14T23:08:11.332310
2021-07-29T06:09:35
2021-07-29T06:09:35
null
0
0
null
null
null
null
GB18030
C
false
false
3,775
c
/****************************************************************************** 版权所有 (C), 2013-2023, 深圳博思高科技有限公司 ****************************************************************************** 文 件 名 : HandShake_Task.c 版 本 号 : 初稿 作 者 : 生成日期 : 2020年2月26日 最近修改 : 功能描述 : 握手任务处理 函数列表 : 修改历史 : 1.日 期 : 2020年2月26日 作 者 : 修改内容 : 创建文件 ******************************************************************************/ /*----------------------------------------------* * 包含头文件 * *----------------------------------------------*/ #include "handshake_task.h" #include "easyflash.h" #include "stdlib.h" #include "tool.h" #include "bsp_ds1302.h" #include "ini.h" #define LOG_TAG "handShake" #include "elog.h" /*----------------------------------------------* * 宏定义 * *----------------------------------------------*/ #define HANDSHAKE_TASK_PRIO ( tskIDLE_PRIORITY) #define HANDSHAKE_STK_SIZE (configMINIMAL_STACK_SIZE*2) /*----------------------------------------------* * 常量定义 * *----------------------------------------------*/ const char *handShakeTaskName = "vHandShakeTask"; //看门狗任务名 /*----------------------------------------------* * 模块级变量 * *----------------------------------------------*/ TaskHandle_t xHandleTaskHandShake = NULL; //LED灯 /*----------------------------------------------* * 内部函数原型说明 * *----------------------------------------------*/ static void vTaskHandShake(void *pvParameters); static void DisplayDevInfo (void); static void vTaskHandShake(void *pvParameters) { // uint32_t i_boot_times = NULL; // char *c_old_boot_times, c_new_boot_times[12] = {0}; // uint8_t bcdbuf[6] = {0}; // log_d("start vTaskHandShake\r\n"); // // /* get the boot count number from Env */ // c_old_boot_times = ef_get_env("boot_times"); // i_boot_times = atol(c_old_boot_times); // // /* boot count +1 */ // i_boot_times ++; // /* interger to string */ // sprintf(c_new_boot_times,"%012ld", i_boot_times); // // /* set and store the boot count number to Env */ // ef_set_env("boot_times", c_new_boot_times); // asc2bcd(bcdbuf,(uint8_t *)c_new_boot_times , 12, 0); //读取本地时间 log_i("bsp_ds1302_readtime= %s\r\n",bsp_ds1302_readtime()); //读取模板数据 // eraseUserDataAll(); initRecordIndex(); initDevBaseParam(); initTemplateParam(); DisplayDevInfo(); vTaskDelay(500); vTaskDelete( NULL ); //删除自己 } void CreateHandShakeTask(void) { //跟android握手 xTaskCreate((TaskFunction_t )vTaskHandShake, (const char* )handShakeTaskName, (uint16_t )HANDSHAKE_STK_SIZE, (void* )NULL, (UBaseType_t )HANDSHAKE_TASK_PRIO, (TaskHandle_t* )&xHandleTaskHandShake); } static void DisplayDevInfo(void) { printf("\r\n==========Version==========\r\n"); printf("Softversion :%s\r\n",gDevinfo.SoftwareVersion); printf("HardwareVersion :%s\r\n", gDevinfo.HardwareVersion); printf("Model :%s\r\n", gDevinfo.Model); printf("ProductBatch :%s\r\n", gDevinfo.ProductBatch); printf("BulidDate :%s\r\n", gDevinfo.BulidDate); printf("DevSn :%s\r\n", gDevinfo.GetSn()); printf("Devip :%s\r\n", gDevinfo.GetIP()); printf("DevID :%s\r\n", gDevBaseParam.deviceCode.qrSn); }
[ "zdsurge@163.com" ]
zdsurge@163.com
56b3176c865f9d08b7ae6c6e27fd40abeb9c39b9
c149f1263b41f89eb03201044c16e47476f7e79f
/Rootfs/usr/lib/openmpi/include/openmpi/orte/util/comm/comm.h
44345b1bd4d7410d198422af42f5468021650b07
[]
no_license
BasJ93/Zybo_Ubuntu
d596511dd7820aeb545a426e9c395b27b60028f9
2a50f4171a5469e0e96f0c0e75c528af0908758c
refs/heads/master
2022-12-22T00:17:54.522038
2017-02-02T13:15:16
2017-02-02T13:15:16
72,639,835
2
1
null
2022-12-16T08:57:26
2016-11-02T12:54:53
C++
UTF-8
C
false
false
2,281
h
/* * Copyright (c) 2004-2008 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. * Copyright (c) 2004-2006 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, * University of Stuttgart. All rights reserved. * Copyright (c) 2004-2005 The Regents of the University of California. * All rights reserved. * $COPYRIGHT$ * * Additional copyrights may follow * * $HEADER$ */ /** @file: * * Populates global structure with system-specific information. * * Notes: add limits.h, compute size of integer and other types via sizeof(type)*CHAR_BIT * */ #ifndef _ORTE_UTIL_COMM_H_ #define _ORTE_UTIL_COMM_H_ #include "orte_config.h" #include "orte/types.h" #include "orte/runtime/orte_globals.h" BEGIN_C_DECLS typedef uint8_t orte_comm_event_t; #define ORTE_COMM_EVENT OPAL_UINT8 #define ORTE_COMM_EVENT_ALLOCATE 0x01 #define ORTE_COMM_EVENT_MAP 0x02 #define ORTE_COMM_EVENT_LAUNCH 0x04 ORTE_DECLSPEC int orte_util_comm_connect_tool(char *uri); ORTE_DECLSPEC int orte_util_comm_report_event(orte_comm_event_t ev); ORTE_DECLSPEC int orte_util_comm_query_job_info(const orte_process_name_t *hnp, orte_jobid_t job, int *num_jobs, orte_job_t ***job_info_array); ORTE_DECLSPEC int orte_util_comm_query_node_info(const orte_process_name_t *hnp, char *node, int *num_nodes, orte_node_t ***node_info_array); ORTE_DECLSPEC int orte_util_comm_query_proc_info(const orte_process_name_t *hnp, orte_jobid_t job, orte_vpid_t vpid, int *num_procs, orte_proc_t ***proc_info_array); ORTE_DECLSPEC int orte_util_comm_spawn_job(const orte_process_name_t *hnp, orte_job_t *jdata); ORTE_DECLSPEC int orte_util_comm_terminate_job(const orte_process_name_t *hnp, orte_jobid_t job); ORTE_DECLSPEC int orte_util_comm_halt_vm(const orte_process_name_t *hnp); END_C_DECLS #endif
[ "r.halvaei@gmail.com" ]
r.halvaei@gmail.com
3ca30868580759f5c5b2cb81b962486736783ddc
7e659e7c700dc477c8f08ea31d00c322b1d589eb
/CaLib/macros/runsets/TAPSTime.C
ed8b66a2e174910f24cb60f4b1f3afa728a6f609
[]
no_license
collicott/acqu
e7b64f33ba4969936792076bed36d673c4ac4ca5
f6daadba5ede5c2e8648fa5ed76f58ae5c93c263
refs/heads/master
2020-12-25T09:09:05.408607
2014-11-10T12:00:47
2014-11-10T12:00:47
null
0
0
null
null
null
null
UTF-8
C
false
false
6,094
c
// SVN Info: $Id: TAPSTime.C 912 2011-05-18 22:09:17Z werthm $ /************************************************************************* * Author: Dominik Werthmueller *************************************************************************/ ////////////////////////////////////////////////////////////////////////// // // // TAPSTime.C // // // // Make run sets depending on the stability in time of a calibration. // // // ////////////////////////////////////////////////////////////////////////// TCanvas* gCFit; TH1* gHOverview; TH1* gH; TH2* gH2; TFile* gFile; TF1* gFitFunc; TLine* gLine; //______________________________________________________________________________ void Fit(Int_t run) { // Perform fit. Char_t tmp[256]; // delete old function if (gFitFunc) delete gFitFunc; sprintf(tmp, "fTime_%i", run); gFitFunc = new TF1(tmp, "gaus"); gFitFunc->SetLineColor(2); // estimate peak position Double_t fPi0Pos = gH->GetBinCenter(gH->GetMaximumBin()); // configure fitting function gFitFunc->SetRange(fPi0Pos - 0.5, fPi0Pos + 0.5); gFitFunc->SetLineColor(2); gFitFunc->SetParameters(gH->GetMaximum(), 0, 5); Int_t fitres = gH->Fit(gFitFunc, "RB0Q"); // get position fPi0Pos = gFitFunc->GetParameter(1); Double_t fwhm = 2.35*gFitFunc->GetParameter(2); // check failed fits if (fitres) { printf("Run %d: fit failed\n", run); return; } // indicator line gLine->SetX1(fPi0Pos); gLine->SetX2(fPi0Pos); gLine->SetY1(0); gLine->SetY2(gH->GetMaximum()); // draw gCFit->cd(); gH->GetXaxis()->SetRangeUser(-3, 3); gH->Draw(); gFitFunc->Draw("same"); gLine->Draw("same"); // fill overview histogram gHOverview->SetBinContent(run+1, fPi0Pos); //gHOverview->SetBinError(run+1, fwhm / 2.); gHOverview->SetBinError(run+1, 0.000001); } //______________________________________________________________________________ void TAPSTime() { // Main method. Char_t tmp[256]; // load CaLib gSystem->Load("libCaLib.so"); // general configuration Bool_t watch = kTRUE; const Char_t* data = "Data.TAPS.T0"; const Char_t* hName = "CaLib_TAPS_Time_Neut"; Double_t yMin = -50; Double_t yMax = 50; // configuration (December 2007) //const Char_t calibration[] = "LD2_Dec_07"; //const Char_t* fLoc = "/Users/fulgur/Desktop/calib/Dec_07"; //const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/Dec_07/AR/out"; // configuration (February 2009) const Char_t calibration[] = "LD2_Feb_09"; const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/Feb_09/AR/out"; //const Char_t* fLoc = "/Users/fulgur/Desktop/calib/Feb_09"; // configuration (May 2009) //const Char_t calibration[] = "LD2_May_09"; //const Char_t* fLoc = "/usr/puma_scratch0/werthm/A2/May_09/AR/out"; // create histogram gHOverview = new TH1F("Overview", "Overview", 40000, 0, 40000); TCanvas* cOverview = new TCanvas(); gHOverview->GetYaxis()->SetRangeUser(yMin, yMax); gHOverview->Draw("E1"); // create line gLine = new TLine(); gLine->SetLineColor(kBlue); gLine->SetLineWidth(2); // init fitting function gFitFunc = 0; // create fitting canvas gCFit = new TCanvas(); // get number of sets Int_t nSets = TCMySQLManager::GetManager()->GetNsets(data, calibration); // total number of runs Int_t nTotRuns = 0; // first and last runs Int_t first_run, last_run; // loop over sets for (Int_t i = 0; i < nSets; i++) { // get runs of set Int_t nRuns; Int_t* runs = TCMySQLManager::GetManager()->GetRunsOfSet(data, calibration, i, &nRuns); // loop over runs for (Int_t j = 0; j < nRuns; j++) { // save first and last runs if (i == 0 && j == 0) first_run = runs[j]; if (i == nSets-1 && j == nRuns-1) last_run = runs[j]; // clean-up if (gH) delete gH; if (gH2) delete gH2; if (gFile) delete gFile; gH = 0; gH2 = 0; gFile = 0; // load ROOT file sprintf(tmp, "%s/ARHistograms_CB_%d.root", fLoc, runs[j]); gFile = new TFile(tmp); // check file if (!gFile) continue; if (gFile->IsZombie()) continue; // load histogram gH2 = (TH2*) gFile->Get(hName); if (!gH2) continue; if (!gH2->GetEntries()) continue; // project histogram sprintf(tmp, "Proj_%d", runs[j]); //gH = gH2->ProjectionX(tmp, 1, 1); gH = gH2->ProjectionX(tmp, 13, 15); // fit the histogram Fit(runs[j]); // update canvases and sleep if (watch) { cOverview->Update(); gCFit->Update(); gSystem->Sleep(100); } // count run nTotRuns++; } // clean-up delete runs; // draw runset markers cOverview->cd(); // get first run of set Int_t frun = TCMySQLManager::GetManager()->GetFirstRunOfSet(data, calibration, i); // draw line TLine* aLine = new TLine(frun, yMin, frun, yMax); aLine->SetLineColor(kBlue); aLine->SetLineWidth(2); aLine->Draw("same"); } // adjust axis gHOverview->GetXaxis()->SetRangeUser(first_run-10, last_run+10); TFile* fout = new TFile("runset_overview.root", "recreate"); cOverview->Write(); delete fout; printf("%d runs analyzed.\n", nTotRuns); gSystem->Exit(0); }
[ "neiser@kph.uni-mainz.de" ]
neiser@kph.uni-mainz.de
f03fc824910d356833d04e39717bc90d990a5b68
d5589d9fbc5a1e3989ed3740b0bcc22a20da2de0
/xinu/include/limits.h
48382a34fbc107ab00d3dd21491449100a439944
[]
no_license
gyanranjanh/Prototype-IOT-solution-to-externalize-sensor-based-platform-services-to-the-cloud
5efe57f8f67ed68344f3323922790c8d8df219fc
fd24d25df30b2a6a9068306ba9a35159a2ef987b
refs/heads/master
2021-05-02T05:34:03.355763
2016-12-20T23:38:45
2016-12-20T23:38:45
76,999,384
1
2
null
null
null
null
UTF-8
C
false
false
1,453
h
/** * @file limits.h * * $Id: limits.h 2020 2009-08-13 17:50:08Z mschul $ */ /* Embedded Xinu, Copyright (C) 2009. All rights reserved. */ #ifndef _LIMITS_H_ #define _LIMITS_H_ #ifdef __cplusplus extern "C" { #endif #define CHAR_BIT 8 /**< bits in a char */ #define CHAR_MAX 127 /**< maximum value of char */ #define CHAR_MIN (-128) /**< minimum value of char */ #define SCHAR_MAX 127 /**< maximum value of signed char */ #define SCHAR_MIN (-128) /**< minimum value of signed char */ #define UCHAR_MAX 255 /**< maximum value of unsigned char */ #define INT_MAX 2147483647 /**< maximum value of int */ #define INT_MIN (-INT_MAX-1) /**< minimum value of int */ #define UINT_MAX (2U*INT_MAX+1) /**< maximum value of unsigned int */ #define LONG_MAX 2147483647 /**< maximum value of int32 */ #define LONG_MIN (-LONG_MAX-1) /**< minimum value of int32 */ #define ULONG_MAX (2UL*LONG_MAX+1) /**< maximum value of unsigned int32 */ #define SHRT_MAX 32767 /**< maximum value of int16 */ #define SHRT_MIN (-SHRT_MAX-1) /**< minimum value of int16 */ #define USHRT_MAX 65535 /**< maximum value of unsigned int16 */ #ifdef __cplusplus } //end extern "C" #endif #endif /* _LIMITS_H_ */
[ "gyanranjanh@gmail.com" ]
gyanranjanh@gmail.com
9d873059a9709fe3615047312b826e33c174a09d
3a56b1155d39c8e4dfaff52f0ec2e43b64304c28
/frames/01413.h
d92a88bc6703572a2f223cf41c0175772bddd2de
[]
no_license
RippedOrigami/GBA-Rick
6a610bde18e8dda978730b2d754565e9cdcbfe1d
0953de71ad0a392f5d3a0bcedc54d55e478925b7
refs/heads/master
2021-05-28T17:10:33.260039
2014-11-28T17:14:04
2014-11-28T17:14:04
null
0
0
null
null
null
null
UTF-8
C
false
false
660
h
//{{BLOCK(_1413) //====================================================================== // // _1413, 40x40@8, // + palette 256 entries, not compressed // + 25 tiles lz77 compressed // Total size: 512 + 1420 = 1932 // // Time-stamp: 2014-11-28, 05:19:45 // Exported by Cearn's GBA Image Transmogrifier, v0.8.12 // ( http://www.coranac.com/projects/#grit ) // //====================================================================== #ifndef GRIT__1413_H #define GRIT__1413_H #define _1413TilesLen 1420 extern const unsigned int _1413Tiles[355]; #define _1413PalLen 512 extern const unsigned short _1413Pal[256]; #endif // GRIT__1413_H //}}BLOCK(_1413)
[ "mtinc2@gmail.com" ]
mtinc2@gmail.com
d74a469530138ba0255b144b1fa19520497155f9
5c255f911786e984286b1f7a4e6091a68419d049
/vulnerable_code/13f3442b-c10f-42bf-ad07-bac16858e5df.c
da879e81c1437355f929142fdac0d94be22241d9
[]
no_license
nmharmon8/Deep-Buffer-Overflow-Detection
70fe02c8dc75d12e91f5bc4468cf260e490af1a4
e0c86210c86afb07c8d4abcc957c7f1b252b4eb2
refs/heads/master
2021-09-11T19:09:59.944740
2018-04-06T16:26:34
2018-04-06T16:26:34
125,521,331
0
0
null
null
null
null
UTF-8
C
false
false
576
c
#include <string.h> #include <stdio.h> int main() { int i=0; int j=12; int k; int l; k = 53; l = 64; k = i/j; l = i%j; l = l+(i-j); k = k-k*i; i = i%j; l = l-j; k = k-k*i; //variables /* START VULNERABILITY */ int a; long b[73]; long c[21]; a = 0; while (b[( a - 1 )] != 0) { a++; /* START BUFFER SET */ *((long *)c + ( a - 1 )) = *((long *)b + ( a - 1 )); /* END BUFFER SET */ } /* END VULNERABILITY */ printf("%d%d\n",k,l); return 0; }
[ "nharmon8@gmail.com" ]
nharmon8@gmail.com
c687763fb5f9b8d43c009f2c3e0fea329da4f064
a556c07ecfa1031dae46fd3433762941ceca68b1
/d/northmountain/heishan/heishane3.c
4f2616c52734f87837475e09f32603656d27b948
[]
no_license
yqzcabao/pkuxkx-utf8
53c3c24f4e3a9125372bca72b6a4b10aa6293a7f
0eaf237c9970795a51aa4cc04b5b762003300cbd
refs/heads/main
2023-04-01T21:16:23.894845
2021-04-09T13:33:24
2021-04-09T13:33:24
null
0
0
null
null
null
null
UTF-8
C
false
false
588
c
inherit ROOM; #include <ansi.h> void create() { set("short", "入山道"+NOR); set("long", @LONG 这里是进入黑山的山间路。 LONG ); set("outdoors", "heishan"); set("exits", ([ "northwest" : __DIR__"heishane2", "southeast" : "/d/changbai/guandao9", //"northeast" : __DIR__"wall1", //"eastdown" : __DIR__"fengshu", ])); set("objects", ([ __DIR__"npc/laoliehu2" : 1, //__DIR__"npc/songbing_y" : 2, ])); setup(); } int valid_leave(object me,string dir) { if (!userp(me)&&dir=="southeast") return notify_fail(""); return ::valid_leave(me,dir); }
[ "i@oiuv.cn" ]
i@oiuv.cn
49673d8e08ca7f380da7513f00e266b34cfbc464
1bb50a07c12c16e8c3c4f38a63cf70cddbf468db
/example.general/hal.stm.stm32PeripheralLib/Project/STM32F4xx_StdPeriph_Examples/USART/USART_SmartCard/stm32f4xx_it.h
3447a60a0425978243c15a57a38a85a0b076cd55
[ "Apache-2.0", "LicenseRef-scancode-st-mcd-2.0" ]
permissive
MikeStitt/lowLevelProgrammingByExample
17aa479fd46e1f2c1b15130e1c59450055b5d5c5
0a3d14a2514b176d7f0ee0dd5392ba6705308cca
refs/heads/master
2021-06-28T16:29:02.509548
2017-07-30T12:40:46
2017-07-30T12:40:46
98,252,494
0
0
Apache-2.0
2020-09-17T13:03:13
2017-07-25T01:56:33
C
UTF-8
C
false
false
2,239
h
/** ****************************************************************************** * @file USART/USART_SmartCard/stm32f4xx_it.h * @author MCD Application Team * @version V1.4.0 * @date 04-August-2014 * @brief This file contains the headers of the interrupt handlers. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2013 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (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.st.com/software_license_agreement_liberty_v2 * * 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. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F4xx_IT_H #define __STM32F4xx_IT_H /* Includes ------------------------------------------------------------------*/ #include "stm32f4xx.h" #include "smartcard.h" #include "main.h" /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); void SC_USART_IRQHandler(void); void SC_OFF_EXTI_IRQHandler(void); #endif /* __STM32F4xx_IT_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
[ "mike@stitt.cc" ]
mike@stitt.cc
9258566de8d8c1618b08594665f579929f0f9410
1743e42b94e5833ee16118947671cbbd016da73d
/STM32 with LCD/include/STD_TYPE.h
dd0641b0d9494d803c27d71ce63f1bdbbf751a73
[]
no_license
Nada8773/RTOS
264f021515319ecbb4fd8c00100dc34bacf6e30b
6fa71d5efbf9645f1a9ec536a62e3241cc85324a
refs/heads/master
2022-12-28T18:23:28.380261
2020-10-12T22:36:13
2020-10-12T22:36:13
261,793,850
2
0
null
null
null
null
UTF-8
C
false
false
348
h
typedef unsigned char u8 ; typedef unsigned short int u16 ; typedef unsigned long int u32 ; typedef signed char s8 ; typedef signed short int s16 ; typedef signed long int s32 ; typedef float f32 ; typedef double f64 ; typedef long double f96 ;
[ "nada2478@gmail.com" ]
nada2478@gmail.com
7b10b910840653b38156d23fd9def5a0f8d1b4f7
d84844bae553f526e253003844a196efd5d791ab
/stat.d/hilo.c
79e1b0afaecaf61d822adc104eaa7f5fab206c4b
[]
no_license
BobMorlock/AT-T-System-III
62d25187b8b8d707368ac3e59ae395a05ca5eeaa
efaba1936fdb8cd690b98ce696e7c47dea65858c
refs/heads/main
2023-08-17T22:59:57.004551
2021-09-19T05:41:11
2021-09-19T05:41:11
408,042,235
0
0
null
null
null
null
UTF-8
C
false
false
1,904
c
/* <:t-5 d:> */ #include "stdio.h" #include "s.h" struct options { char ch; /* char prepended to option keyletter */ int oflag; /* option form */ int lflag; /* low value */ int hflag; /* high value */ } op = { 0, 0, 0, 0, }; main(argc,argv) /*list elements */ int argc; char *argv[]; { FILE *fdi; FILE *fopen(); int ac, argf, i; char **av, *cp; double high=NEGINFIN, low=POSINFIN; nodename = *argv; for( ac=argc-1,av=argv+1; ac>0; ac--,av++ ) if( *(cp=av[0])=='-' && *++cp!='\0' ) { while(*cp != '\0') switch(*cp++) { case 'l': op.lflag++; break; case 'h': op.hflag++; break; case 'o': op.oflag++; switch(*cp++) { case 'x': op.ch='x'; break; case 'y': op.ch='y'; break; default: cp--; break; }; break; case ' ': case ',': break; default: ERRPR1(%c?,*(cp-1)); } --argc; } if(argc <= 1) { argc=2; argf=0; } /* no args, use stdin */ else argf=1; while(argc-- > 1) { if( strcmp(*++argv,"-")==0 || !argf ) fdi=stdin; else if( **argv!='-' ) { if( (fdi=fopen(*argv,"r"))==NULL ) { ERRPR1(cannot open %s, *argv); continue; } } else { argc++; continue; } hilo(fdi,&high,&low); fclose(fdi); } pr(high,low); exit(0); } hilo(fdi,high,low) FILE *fdi; double *high, *low; { double tmp; int i; while(getdoub(fdi,&tmp) != EOF) { *high = (tmp > *high) ? tmp : *high; *low = (tmp < *low) ? tmp : *low; } } pr(high,low) double high, low; { if(op.lflag || op.hflag) { if(op.lflag) if(op.oflag) op.ch ? printf("%cl%g,",op.ch,low) : printf("l%g,",low); else printf("%g\t",low); if(op.hflag) if(op.oflag) op.ch ? printf("%ch%g,",op.ch,high) : printf("h%g,",high); else printf("%g\t",high); } else if(op.oflag) op.ch ? printf("%cl%g,%ch%g",op.ch,low,op.ch,high) : printf("l%g,h%g,",low,high); else printf("low=%g\thigh=%g",low,high); putchar('\n'); }
[ "bobm@remlazar.localdomain" ]
bobm@remlazar.localdomain
70259d812a3af8857c55966aa0853d20cea78ee9
da5516da390b884d915932e640441dd334235751
/SuperStar1/Src/adc.c
fe508ae00dd953aea7344560b7c7e45ba7194a75
[]
no_license
habworks/SuperStar1
382ced8ef675a56741e4d856d9bc00a526e07557
3d3f9041840a5d2fd782e1fd2855d802ebbb01fc
refs/heads/master
2022-12-29T18:27:37.526964
2020-10-15T13:52:53
2020-10-15T13:52:53
279,559,684
0
0
null
2020-10-15T13:52:54
2020-07-14T10:55:11
C
UTF-8
C
false
false
3,511
c
/** ****************************************************************************** * File Name : ADC.c * Description : This file provides code for the configuration * of the ADC instances. ****************************************************************************** * @attention * * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics. * All rights reserved.</center></h2> * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * opensource.org/licenses/BSD-3-Clause * ****************************************************************************** */ /* Includes ------------------------------------------------------------------*/ #include "adc.h" /* USER CODE BEGIN 0 */ /* USER CODE END 0 */ ADC_HandleTypeDef hadc; /* ADC init function */ void MX_ADC_Init(void) { ADC_ChannelConfTypeDef sConfig = {0}; /** Configure the global features of the ADC (Clock, Resolution, Data Alignment and number of conversion) */ hadc.Instance = ADC1; hadc.Init.OversamplingMode = DISABLE; hadc.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV4; hadc.Init.Resolution = ADC_RESOLUTION_10B; hadc.Init.SamplingTime = ADC_SAMPLETIME_160CYCLES_5; hadc.Init.ScanConvMode = ADC_SCAN_DIRECTION_FORWARD; hadc.Init.DataAlign = ADC_DATAALIGN_RIGHT; hadc.Init.ContinuousConvMode = DISABLE; hadc.Init.DiscontinuousConvMode = DISABLE; hadc.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE; hadc.Init.ExternalTrigConv = ADC_SOFTWARE_START; hadc.Init.DMAContinuousRequests = DISABLE; hadc.Init.EOCSelection = ADC_EOC_SINGLE_CONV; hadc.Init.Overrun = ADC_OVR_DATA_OVERWRITTEN; hadc.Init.LowPowerAutoWait = DISABLE; hadc.Init.LowPowerFrequencyMode = DISABLE; hadc.Init.LowPowerAutoPowerOff = DISABLE; if (HAL_ADC_Init(&hadc) != HAL_OK) { Error_Handler(); } /** Configure for the selected ADC regular channel to be converted. */ sConfig.Channel = ADC_CHANNEL_3; sConfig.Rank = ADC_RANK_CHANNEL_NUMBER; if (HAL_ADC_ConfigChannel(&hadc, &sConfig) != HAL_OK) { Error_Handler(); } } void HAL_ADC_MspInit(ADC_HandleTypeDef* adcHandle) { GPIO_InitTypeDef GPIO_InitStruct = {0}; if(adcHandle->Instance==ADC1) { /* USER CODE BEGIN ADC1_MspInit 0 */ /* USER CODE END ADC1_MspInit 0 */ /* ADC1 clock enable */ __HAL_RCC_ADC1_CLK_ENABLE(); __HAL_RCC_GPIOA_CLK_ENABLE(); /**ADC GPIO Configuration PA3 ------> ADC_IN3 */ GPIO_InitStruct.Pin = Vbat_Level_Pin; GPIO_InitStruct.Mode = GPIO_MODE_ANALOG; GPIO_InitStruct.Pull = GPIO_NOPULL; HAL_GPIO_Init(Vbat_Level_GPIO_Port, &GPIO_InitStruct); /* USER CODE BEGIN ADC1_MspInit 1 */ /* USER CODE END ADC1_MspInit 1 */ } } void HAL_ADC_MspDeInit(ADC_HandleTypeDef* adcHandle) { if(adcHandle->Instance==ADC1) { /* USER CODE BEGIN ADC1_MspDeInit 0 */ /* USER CODE END ADC1_MspDeInit 0 */ /* Peripheral clock disable */ __HAL_RCC_ADC1_CLK_DISABLE(); /**ADC GPIO Configuration PA3 ------> ADC_IN3 */ HAL_GPIO_DeInit(Vbat_Level_GPIO_Port, Vbat_Level_Pin); /* USER CODE BEGIN ADC1_MspDeInit 1 */ /* USER CODE END ADC1_MspDeInit 1 */ } } /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
[ "hab.collector@imrengineering.com" ]
hab.collector@imrengineering.com
3b7e4d21cb8ae3a2b5bf89895a920d43c27a630a
fc44dae7630ed5b6076e3fb9ee8cecec1e41eb35
/GD32/Libraries/GD32F10x_Firmware_Library/Example/MCUDBG/MCUDBG_Timer1 Stop/gd32f10x_it.h
64a260e6d5bfbd0c26d27a16c8b7fcc1f8704cd9
[]
no_license
zhouzp1/Library-Document
76ae75c2426a390b6ffb5ed20c6fa2a91dda9a68
73b3163a395bf23387106be2a6d11e824487d8e7
refs/heads/master
2021-05-17T19:45:46.749259
2018-05-30T03:30:18
2018-05-30T03:30:18
null
0
0
null
null
null
null
UTF-8
C
false
false
1,047
h
/** ****************************************************************************** * @file MCUDGB/MCUDBG_Timer1 stop/gd32f10x_it.h * @author MCU SD * @version V1.0 * @date 26-Dec-2014 * @brief Headfile of the Interrupt Service Routines. ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __GD32F10X_IT_H #define __GD32F10X_IT_H /* Includes ------------------------------------------------------------------*/ #include "gd32f10x.h" /* Exported functions ------------------------------------------------------- */ void NMI_Handler(void); void HardFault_Handler(void); void MemManage_Handler(void); void BusFault_Handler(void); void UsageFault_Handler(void); void SVC_Handler(void); void DebugMon_Handler(void); void PendSV_Handler(void); void SysTick_Handler(void); #endif /* __GD32F10X_IT_H */ /******************* (C) COPYRIGHT 2014 GIGADEVICE *****END OF FILE****/
[ "mr_zouyong@163.com" ]
mr_zouyong@163.com
56b46119ecc6206508d5fd3bfabb54c91df33962
e2e996662fde8ac0e1509995468b725d47d8ea10
/program_repo/Codeflaws/version/v1322/test_data/true_root/source/tcas.c
036d213d0b2a7ad7937e0a714ab5715d9da4d17f
[]
no_license
HOM-CISE/HOM-MBFL
b5c27ba9268b2bf7cd4faccece2ff479147ebf81
38806a5971736ab98e1d6f4b22952cf4d9b328b2
refs/heads/master
2023-05-05T20:24:44.228132
2021-06-01T13:58:28
2021-06-01T13:58:28
285,776,568
1
0
null
null
null
null
UTF-8
C
false
false
694
c
int n; char f[1<<18]; double ans[1<<18][18],a[18][18]; void dfs(mask) { if(f[mask])return; int i,j,w=__builtin_popcount(mask); double tmp; f[mask]=1; if(w==1) { ans[mask][__builtin_popcount(mask-1)]=1; return; } for(i=0; i<n; i++) if(mask&(1<<i)) { dfs(mask-(1<<i)); tmp=0; for(j=0; j<n; j++) if(j!=i && mask&(1<<j)) tmp+=a[j][i]; for(j=0; j<n; j++) ans[mask][j]+=tmp*ans[mask-(1<<i)][j]; } for(j=0; j<n; j++) ans[mask][j]/=w/2.0; } int main(int argc, char *argv[]) { int i,j; scanf("%d",&n); for(i=0; i<n; i++) for(j=0; j<n; j++) scanf("%lf",&a[i][j]); dfs((1<<n)-1); for(i=0; i<n; i++) printf("%.6lf ",ans[(1<<n)-1][i]); return 0; }
[ "LK464841764@163.com" ]
LK464841764@163.com
47beb332b2f7298be5f18ffecf0e5b8d026bebae
5af0ad6b10289dc2417c999a8f1711ffc247a4b0
/external/mit/xf86-video-nsc/dist/src/nsc_galstub.c
f0fb639a7881fc310109d862d450849fb8d7512a
[]
no_license
iquiw/xsrc
0f4396a99bb616e973d0815c992128443a66d128
15f9569d14a61e0b58a0925ad8ad3a1b0ef4a41e
refs/heads/master
2021-01-22T10:08:33.138679
2019-10-28T03:20:13
2019-10-28T03:20:13
41,230,059
1
0
null
null
null
null
UTF-8
C
false
false
6,482
c
/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/nsc_galstub.c,v 1.1 2002/12/10 15:12:23 alanh Exp $ */ /* * $Workfile: nsc_galstub.c $ * $Revision: 1.1 $ * $Author: mrg $ * * File Contents: This file contains the file inclusions of the GAL * * Project: Geode Xfree Frame buffer device driver. * */ /* * NSC_LIC_ALTERNATIVE_PREAMBLE * * Revision 1.0 * * National Semiconductor Alternative GPL-BSD License * * National Semiconductor Corporation licenses this software * ("Software"): * * Geode Xfree frame buffer driver * * under one of the two following licenses, depending on how the * Software is received by the Licensee. * * If this Software is received as part of the Linux Framebuffer or * other GPL licensed software, then the GPL license designated * NSC_LIC_GPL applies to this Software; in all other circumstances * then the BSD-style license designated NSC_LIC_BSD shall apply. * * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ /* NSC_LIC_BSD * * National Semiconductor Corporation Open Source License for * * Geode Xfree frame buffer driver * * (BSD License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * 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 National Semiconductor Corporation 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 * NATIONAL SEMICONDUCTOR CORPORATION OR 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, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * END_NSC_LIC_BSD */ /* NSC_LIC_GPL * * National Semiconductor Corporation Gnu General Public License for * * Geode Xfree frame buffer driver * * (GPL License with Export Notice) * * Copyright (c) 1999-2001 * National Semiconductor Corporation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted 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 * * In addition to the terms of the GNU General Public License, neither * the name of the National Semiconductor Corporation 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 * NATIONAL SEMICONDUCTOR CORPORATION OR 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, * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY * OF SUCH DAMAGE. See the GNU General Public License for more details. * * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF * YOUR JURISDICTION. It is licensee's responsibility to comply with * any export regulations applicable in licensee's jurisdiction. Under * CURRENT (2001) U.S. export regulations this software * is eligible for export from the U.S. and can be downloaded by or * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed * destinations which include Cuba, Iraq, Libya, North Korea, Iran, * Syria, Sudan, Afghanistan and any other country to which the U.S. * has embargoed goods and services. * * You should have received a copy of the GNU General Public License * along with this file; if not, write to the Free Software Foundation, * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * END_NSC_LIC_GPL */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #if defined(STB_X) /* all driver need this */ #include "xf86.h" #include "xf86_OSproc.h" /* pci stuff */ #include "xf86PciInfo.h" #include "xf86Pci.h" #include "xf86cmap.h" #include "asm/page.h" /* #define for PAGE_* */ #define makedev(major, minor) ((((unsigned int) (major)) << 8) \ | ((unsigned int) (minor))) #include "nsc_galfns.c" #endif /* STB_X */
[ "mrg" ]
mrg
867349bd3a306559d4af88d8dfdc8af0018eed19
1de61735f408246f09faaf95d6db39ef4f5b0a47
/libft/ft_strcmp.c
d5803206c950482590cd5e0cbdd5fa0dd18cbc73
[]
no_license
golliet/42-Ft_ls
520fe80eaae265b1c1dc200cbc6979a6209dd57c
98f54d5d90c3c6bd98019f5e16f8b731aef61d65
refs/heads/master
2021-05-11T13:13:41.197402
2018-03-01T14:54:29
2018-03-01T14:54:29
117,675,230
0
0
null
null
null
null
UTF-8
C
false
false
1,121
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strcmp.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: golliet <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/11/08 15:00:56 by golliet #+# #+# */ /* Updated: 2017/12/21 11:28:13 by golliet ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" int ft_strcmp(const char *s1, const char *s2) { if (*s1 == '\0' && *s2 == '\0') return (0); while (*s1 == *s2 && *s2 && *s1) { s1++; s2++; } return (*(unsigned char *)s1 - *(unsigned char *)s2); }
[ "golliet@student.42.fr" ]
golliet@student.42.fr
5d72cf235b7aff47e7f51d63c4ec236c8df0efdd
6b40e9dccf2edc767c44df3acd9b626fcd586b4d
/NT/windows/advcore/ctf/cicload/private.h
e8eacafcfc301a5722e0cc9ede36e2ce56b78d8b
[]
no_license
jjzhang166/WinNT5_src_20201004
712894fcf94fb82c49e5cd09d719da00740e0436
b2db264153b80fbb91ef5fc9f57b387e223dbfc2
refs/heads/Win2K3
2023-08-12T01:31:59.670176
2021-10-14T15:14:37
2021-10-14T15:14:37
586,134,273
1
0
null
2023-01-07T03:47:45
2023-01-07T03:47:44
null
UTF-8
C
false
false
558
h
//+--------------------------------------------------------------------------- // // File: private.h // // Contents: Private header for aimmload project. // //---------------------------------------------------------------------------- #ifndef _PRIVATE_H_ #define _PRIVATE_H_ #define _OLEAUT32_ #define WINBASE_DECLARE_GET_SYSTEM_WOW64_DIRECTORY #include <windows.h> #include <regstr.h> #include <ccstock.h> #include <debug.h> #include "msctf.h" #include "mem.h" // must be last #include "tchar.h" #endif // _PRIVATE_H_
[ "seta7D5@protonmail.com" ]
seta7D5@protonmail.com
a084fde738e70b128ac96902f9d95e448decc734
5c255f911786e984286b1f7a4e6091a68419d049
/code/ab61db80-12a8-4b18-b0e3-de030094a3dc.c
65a07086f4b924cfec84f60bfcac9acd1138e124
[]
no_license
nmharmon8/Deep-Buffer-Overflow-Detection
70fe02c8dc75d12e91f5bc4468cf260e490af1a4
e0c86210c86afb07c8d4abcc957c7f1b252b4eb2
refs/heads/master
2021-09-11T19:09:59.944740
2018-04-06T16:26:34
2018-04-06T16:26:34
125,521,331
0
0
null
null
null
null
UTF-8
C
false
false
241
c
#include <stdio.h> int main() { int i=4; int j=12; int k; int l; k = 53; l = 64; k = i/j; l = i/j; l = l/j; l = j/j; l = i-j; l = j-j*k; printf("vulnerability"); printf("%d%d\n",k,l); return 0; }
[ "nharmon8@gmail.com" ]
nharmon8@gmail.com
35a8a9eab283190a750c6d97059ba2f763c4bb3f
561588907a0191b9d0a3cf18204a2159ffa13eac
/src/lib/avrcp/avrcp_profile_handler.h
a873e4ab7fa2c9575a6d0066c900f325f96435a7
[]
no_license
symeen/Qualcomm-_ADK4.4
bbe9388de0efc4bfdb3f790f5be3d908b85fca26
f06d5c0e4a23dd94f968b1bd112178ba31710c0b
refs/heads/master
2022-03-22T13:31:14.498281
2019-11-30T17:17:05
2019-11-30T17:17:05
null
0
0
null
null
null
null
UTF-8
C
false
false
1,996
h
/**************************************************************************** Copyright (c) 2004 - 2015 Qualcomm Technologies International, Ltd. Part of ADK_CSR867x.WIN. 4.4 FILE NAME avrcp_profile_handler.h DESCRIPTION Header file for the AVRCP profile library. */ #ifndef AVRCP_PROFILE_HANDLER_H_ #define AVRCP_PROFILE_HANDLER_H_ #include <message.h> /****************************************************************** NAME avrcpInitHandler DESCRIPTION All Initialization messages are handled here */ void avrcpInitHandler(Task task, MessageId id, Message message); /**************************************************************************** NAME avrcpProfileHandler DESCRIPTION All messages for the profile lib instance are handled by this function. */ void avrcpProfileHandler(Task task, MessageId id, Message message); /**************************************************************************** NAME avrcpDataCleanUp DESCRIPTION This function is called when a source becomes empty and all it does is free the memory allocated and turned into a source using StreamRegionSource. */ void avrcpDataCleanUp(Task task, MessageId id, Message message); /**************************************************************************** NAME avbpProfileHandler DESCRIPTION profileHandler function for Browsing channel */ void avbpProfileHandler(Task task, MessageId id, Message message); /**************************************************************************** * NAME * avrcpCheckForUnreleasedRegionSource * * DESCRIPTION * Checks that the library doesn't have a stale request pending. If it finds * there is a pending RegionSource left over from a previous connection, * empty it, so the Stream manager can dispose the Source. *****************************************************************************/ void avrcpCheckForUnreleasedRegionSource(AVRCP *avrcp); #endif /* AVRCP_PROFILE_HANDLER_H */
[ "gongdezhi900220@outlook.com" ]
gongdezhi900220@outlook.com
2972f369c07e2edfc06c31e9b4f6634015b100b4
364ac73696914553408fb4f677267fa84617acf3
/0x05-pointers_arrays_strings/1-swap.c
0487310778bd621700de8d0b6a1ab9c0df5ab5fd
[]
no_license
anguiclavijods/holbertonschool-low_level_programming
25411c57fffd3926fdab10cf8689ba8b386b774f
86ebf4211013f3f1150873a108e04e135d068b7f
refs/heads/main
2023-07-16T21:49:19.887447
2021-09-02T01:53:46
2021-09-02T01:53:46
null
0
0
null
null
null
null
UTF-8
C
false
false
187
c
#include "holberton.h" /** *swap_int - swaps the values. *@a: value swaps. *@b: value swaps. *Return: none. */ void swap_int(int *a, int *b) { int i; i = *a; *a = *b; *b = i; }
[ "angiedesarrollo@gmail.com" ]
angiedesarrollo@gmail.com
9c2c35ed4d4d2093652d06e78be4480570ea0306
b7eb404bbf7e9f001d4f875585032e00d8bb8980
/libft/srcs/bigint/ft_bigint_shiftleft.c
7a138d46b78823d797c1df2a36b542635ec8a92f
[]
no_license
apft/lem_in
f74d388fb95e067e2e85d1a2461fa9f545655669
a3d3caec78a5aa324348617d75a1420b05b7669c
refs/heads/master
2020-05-16T18:31:05.164816
2019-07-26T17:38:20
2019-07-26T17:38:20
183,226,682
0
0
null
null
null
null
UTF-8
C
false
false
1,702
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_bigint_shiftleft.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: jkettani <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/03/17 22:47:49 by jkettani #+# #+# */ /* Updated: 2019/06/14 11:42:19 by jkettani ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" t_bigint *ft_bigint_shiftleft(t_bigint *result, t_uint shift) { t_uint i; int block_size; if (!shift) return (result); i = BIGINT_SIZE; block_size = BIGINT_BLOCK_SIZE; if (!(shift % block_size)) while (--i >= (shift / block_size)) result->blocks[i] = result->blocks[i - (shift / block_size)]; else { while (--i >= (shift / block_size + 1)) result->blocks[i] = (result->blocks[i - (shift / block_size + 1)] >> (block_size - (shift % block_size))) | (result->blocks[i - shift / block_size] << (shift % block_size)); result->blocks[i] = result->blocks[i - shift / block_size] << (shift % block_size); } i = !(shift % block_size) ? i + 1 : i; while (i--) result->blocks[i] = 0; result->length = ft_bigint_size(result); return (result); }
[ "jkettani@e2r2p3.42.fr" ]
jkettani@e2r2p3.42.fr
b61ccc2c13ba3ee17cdbb3404ddc67353836d9b5
e2d492ca3543bede57d88fdfd5bc69dbd7d26655
/0x06-signals/2-handle_sigaction.c
5c7f1f8772b867788e7691eeba06d05831648fbf
[]
no_license
wassimbel/holbertonschool-system_linux
df7758230ae1606123aecefd3e27397080dc3f40
a68cc55a38d2d565df4ee74eb4e554737adc5b5f
refs/heads/main
2023-08-23T19:03:50.237568
2021-10-20T03:34:12
2021-10-20T03:34:12
357,172,631
0
0
null
2021-07-07T05:44:15
2021-04-12T11:47:15
C
UTF-8
C
false
false
412
c
#include "signals.h" /** * handle_sigaction - sets a handler for the signal SIGINT * Return: return 0 on success, or -1 on error **/ int handle_sigaction(void) { struct sigaction act; act.sa_handler = handler; return (sigaction(SIGINT, &act, NULL)); } /** * handler - handler for SIGINT * @signum: signal number **/ void handler(int signum) { printf("Gotcha! [%d]\n", signum); fflush(stdout); }
[ "wassim.belhedi1@gmail.com" ]
wassim.belhedi1@gmail.com
bab0023e5adbe82a2a1573b7dc87202a6a9799f9
a33aac97878b2cb15677be26e308cbc46e2862d2
/program_data/PKU_raw/39/794.c
69b1bf6e0eed23c3a6af8540a0ea52f9ba075099
[]
no_license
GabeOchieng/ggnn.tensorflow
f5d7d0bca52258336fc12c9de6ae38223f28f786
7c62c0e8427bea6c8bec2cebf157b6f1ea70a213
refs/heads/master
2022-05-30T11:17:42.278048
2020-05-02T11:33:31
2020-05-02T11:33:31
null
0
0
null
null
null
null
UTF-8
C
false
false
931
c
struct Student {char name[30]; int q; int b; char s; char x; int w; int money; }; int main() { struct Student stu[100]; struct Student temp; int n,sum=0,i,j,k; scanf("%d",&n); for(i=0;i<n;i++){ scanf("%s%d%d %c %c%d",&stu[i].name,&stu[i].q,&stu[i].b,&stu[i].s,&stu[i].x,&stu[i].w); stu[i].money=0; if(stu[i].q>80&&stu[i].w>0) stu[i].money=stu[i].money+8000; if(stu[i].q>85&&stu[i].b>80) stu[i].money=stu[i].money+4000; if(stu[i].q>90) stu[i].money=stu[i].money+2000; if(stu[i].q>85&&stu[i].x=='Y') stu[i].money=stu[i].money+1000; if(stu[i].b>80&&stu[i].s=='Y') stu[i].money=stu[i].money+850; } for(i=0;i<n;i++){ sum=sum+stu[i].money; } for(i=0;i<n;i++){ k=i; for(j=i+1;j<n;j++) if(stu[j].money>stu[k].money) k=j; temp=stu[k];stu[k]=stu[i];stu[i]=temp; } printf("%s\n%d\n%d\n",stu[0].name,stu[0].money,sum); return 0; }
[ "bdqnghi@gmail.com" ]
bdqnghi@gmail.com
ba9e17124acb4c1d802c4178a5cffb118723834d
7e45abc2361dd4cb31474b4442f93aef4b833d8a
/StdC/day03/exec03.c
7483d11ca3595ff81d23566e27b8c73b7b58b773
[]
no_license
qyqgit/MyDoc
187da579fc920f9f9e2bd238cfa11387060eeb57
92f23732efa2ada09a4311520ebd1c8fd3e86e86
refs/heads/master
2020-06-12T05:40:27.691706
2019-11-17T08:49:44
2019-11-17T08:49:44
194,210,236
0
0
null
null
null
null
UTF-8
C
false
false
190
c
#include<stdio.h> int main(){ int a = 0; scanf("%d",&a); if(a > 0) printf("正数\n"); else if(a < 0) printf("负数\n"); else printf("零\n"); }
[ "qyqm@live.cn" ]
qyqm@live.cn
6147ab4ce4197e8f79219c29d143156449e666a5
d69553dc406e672ff2acf857db56ea9fe1beba6a
/haskell/matrix/.stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/test/autogen/cabal_macros.h
a49259d2617e4850d12e8bc94871021fec658b39
[]
no_license
guilhermehas/exercism
86fef09dc9bd02d42b4eebbc520523c0e5b77366
55b6ab7632ef8431deccb7e42f099392d9bd76ca
refs/heads/master
2020-03-27T06:49:03.296627
2019-03-09T15:14:03
2019-03-09T15:14:03
146,137,742
1
2
null
null
null
null
UTF-8
C
false
false
6,560
h
/* DO NOT EDIT: This file is automatically generated by Cabal */ /* package matrix-1.0.0.6 */ #ifndef VERSION_matrix #define VERSION_matrix "1.0.0.6" #endif /* VERSION_matrix */ #ifndef MIN_VERSION_matrix #define MIN_VERSION_matrix(major1,major2,minor) (\ (major1) < 1 || \ (major1) == 1 && (major2) < 0 || \ (major1) == 1 && (major2) == 0 && (minor) <= 0) #endif /* MIN_VERSION_matrix */ /* package base-4.11.1.0 */ #ifndef VERSION_base #define VERSION_base "4.11.1.0" #endif /* VERSION_base */ #ifndef MIN_VERSION_base #define MIN_VERSION_base(major1,major2,minor) (\ (major1) < 4 || \ (major1) == 4 && (major2) < 11 || \ (major1) == 4 && (major2) == 11 && (minor) <= 1) #endif /* MIN_VERSION_base */ /* package hspec-2.5.5 */ #ifndef VERSION_hspec #define VERSION_hspec "2.5.5" #endif /* VERSION_hspec */ #ifndef MIN_VERSION_hspec #define MIN_VERSION_hspec(major1,major2,minor) (\ (major1) < 2 || \ (major1) == 2 && (major2) < 5 || \ (major1) == 2 && (major2) == 5 && (minor) <= 5) #endif /* MIN_VERSION_hspec */ /* package matrix-1.0.0.6 */ #ifndef VERSION_matrix #define VERSION_matrix "1.0.0.6" #endif /* VERSION_matrix */ #ifndef MIN_VERSION_matrix #define MIN_VERSION_matrix(major1,major2,minor) (\ (major1) < 1 || \ (major1) == 1 && (major2) < 0 || \ (major1) == 1 && (major2) == 0 && (minor) <= 0) #endif /* MIN_VERSION_matrix */ /* package vector-0.12.0.1 */ #ifndef VERSION_vector #define VERSION_vector "0.12.0.1" #endif /* VERSION_vector */ #ifndef MIN_VERSION_vector #define MIN_VERSION_vector(major1,major2,minor) (\ (major1) < 0 || \ (major1) == 0 && (major2) < 12 || \ (major1) == 0 && (major2) == 12 && (minor) <= 0) #endif /* MIN_VERSION_vector */ /* tool alex-3.2.3 */ #ifndef TOOL_VERSION_alex #define TOOL_VERSION_alex "3.2.3" #endif /* TOOL_VERSION_alex */ #ifndef MIN_TOOL_VERSION_alex #define MIN_TOOL_VERSION_alex(major1,major2,minor) (\ (major1) < 3 || \ (major1) == 3 && (major2) < 2 || \ (major1) == 3 && (major2) == 2 && (minor) <= 3) #endif /* MIN_TOOL_VERSION_alex */ /* tool cpphs-1.18.9 */ #ifndef TOOL_VERSION_cpphs #define TOOL_VERSION_cpphs "1.18.9" #endif /* TOOL_VERSION_cpphs */ #ifndef MIN_TOOL_VERSION_cpphs #define MIN_TOOL_VERSION_cpphs(major1,major2,minor) (\ (major1) < 1 || \ (major1) == 1 && (major2) < 18 || \ (major1) == 1 && (major2) == 18 && (minor) <= 9) #endif /* MIN_TOOL_VERSION_cpphs */ /* tool gcc-7 */ #ifndef TOOL_VERSION_gcc #define TOOL_VERSION_gcc "7" #endif /* TOOL_VERSION_gcc */ #ifndef MIN_TOOL_VERSION_gcc #define MIN_TOOL_VERSION_gcc(major1,major2,minor) (\ (major1) < 7 || \ (major1) == 7 && (major2) < 0 || \ (major1) == 7 && (major2) == 0 && (minor) <= 0) #endif /* MIN_TOOL_VERSION_gcc */ /* tool ghc-8.4.3 */ #ifndef TOOL_VERSION_ghc #define TOOL_VERSION_ghc "8.4.3" #endif /* TOOL_VERSION_ghc */ #ifndef MIN_TOOL_VERSION_ghc #define MIN_TOOL_VERSION_ghc(major1,major2,minor) (\ (major1) < 8 || \ (major1) == 8 && (major2) < 4 || \ (major1) == 8 && (major2) == 4 && (minor) <= 3) #endif /* MIN_TOOL_VERSION_ghc */ /* tool ghc-pkg-8.4.3 */ #ifndef TOOL_VERSION_ghc_pkg #define TOOL_VERSION_ghc_pkg "8.4.3" #endif /* TOOL_VERSION_ghc_pkg */ #ifndef MIN_TOOL_VERSION_ghc_pkg #define MIN_TOOL_VERSION_ghc_pkg(major1,major2,minor) (\ (major1) < 8 || \ (major1) == 8 && (major2) < 4 || \ (major1) == 8 && (major2) == 4 && (minor) <= 3) #endif /* MIN_TOOL_VERSION_ghc_pkg */ /* tool haddock-2.20.0 */ #ifndef TOOL_VERSION_haddock #define TOOL_VERSION_haddock "2.20.0" #endif /* TOOL_VERSION_haddock */ #ifndef MIN_TOOL_VERSION_haddock #define MIN_TOOL_VERSION_haddock(major1,major2,minor) (\ (major1) < 2 || \ (major1) == 2 && (major2) < 20 || \ (major1) == 2 && (major2) == 20 && (minor) <= 0) #endif /* MIN_TOOL_VERSION_haddock */ /* tool happy-1.19.8 */ #ifndef TOOL_VERSION_happy #define TOOL_VERSION_happy "1.19.8" #endif /* TOOL_VERSION_happy */ #ifndef MIN_TOOL_VERSION_happy #define MIN_TOOL_VERSION_happy(major1,major2,minor) (\ (major1) < 1 || \ (major1) == 1 && (major2) < 19 || \ (major1) == 1 && (major2) == 19 && (minor) <= 8) #endif /* MIN_TOOL_VERSION_happy */ /* tool hpc-0.67 */ #ifndef TOOL_VERSION_hpc #define TOOL_VERSION_hpc "0.67" #endif /* TOOL_VERSION_hpc */ #ifndef MIN_TOOL_VERSION_hpc #define MIN_TOOL_VERSION_hpc(major1,major2,minor) (\ (major1) < 0 || \ (major1) == 0 && (major2) < 67 || \ (major1) == 0 && (major2) == 67 && (minor) <= 0) #endif /* MIN_TOOL_VERSION_hpc */ /* tool hsc2hs-0.68.3 */ #ifndef TOOL_VERSION_hsc2hs #define TOOL_VERSION_hsc2hs "0.68.3" #endif /* TOOL_VERSION_hsc2hs */ #ifndef MIN_TOOL_VERSION_hsc2hs #define MIN_TOOL_VERSION_hsc2hs(major1,major2,minor) (\ (major1) < 0 || \ (major1) == 0 && (major2) < 68 || \ (major1) == 0 && (major2) == 68 && (minor) <= 3) #endif /* MIN_TOOL_VERSION_hsc2hs */ /* tool hscolour-1.24 */ #ifndef TOOL_VERSION_hscolour #define TOOL_VERSION_hscolour "1.24" #endif /* TOOL_VERSION_hscolour */ #ifndef MIN_TOOL_VERSION_hscolour #define MIN_TOOL_VERSION_hscolour(major1,major2,minor) (\ (major1) < 1 || \ (major1) == 1 && (major2) < 24 || \ (major1) == 1 && (major2) == 24 && (minor) <= 0) #endif /* MIN_TOOL_VERSION_hscolour */ /* tool pkg-config-0.29.1 */ #ifndef TOOL_VERSION_pkg_config #define TOOL_VERSION_pkg_config "0.29.1" #endif /* TOOL_VERSION_pkg_config */ #ifndef MIN_TOOL_VERSION_pkg_config #define MIN_TOOL_VERSION_pkg_config(major1,major2,minor) (\ (major1) < 0 || \ (major1) == 0 && (major2) < 29 || \ (major1) == 0 && (major2) == 29 && (minor) <= 1) #endif /* MIN_TOOL_VERSION_pkg_config */ /* tool runghc-8.4.3 */ #ifndef TOOL_VERSION_runghc #define TOOL_VERSION_runghc "8.4.3" #endif /* TOOL_VERSION_runghc */ #ifndef MIN_TOOL_VERSION_runghc #define MIN_TOOL_VERSION_runghc(major1,major2,minor) (\ (major1) < 8 || \ (major1) == 8 && (major2) < 4 || \ (major1) == 8 && (major2) == 4 && (minor) <= 3) #endif /* MIN_TOOL_VERSION_runghc */ /* tool strip-2.30 */ #ifndef TOOL_VERSION_strip #define TOOL_VERSION_strip "2.30" #endif /* TOOL_VERSION_strip */ #ifndef MIN_TOOL_VERSION_strip #define MIN_TOOL_VERSION_strip(major1,major2,minor) (\ (major1) < 2 || \ (major1) == 2 && (major2) < 30 || \ (major1) == 2 && (major2) == 30 && (minor) <= 0) #endif /* MIN_TOOL_VERSION_strip */ #ifndef CURRENT_COMPONENT_ID #define CURRENT_COMPONENT_ID "matrix-1.0.0.6-JjsS7wmKPnC2o6c0FW70Dz-test" #endif /* CURRENT_COMPONENT_ID */ #ifndef CURRENT_PACKAGE_VERSION #define CURRENT_PACKAGE_VERSION "1.0.0.6" #endif /* CURRENT_PACKAGE_VERSION */
[ "guilhermehas@hotmail.com" ]
guilhermehas@hotmail.com
f4d7633a2b50cd2da71f45bb339ffa5b67ea2788
9b33c5657304a2962e59ef067ecc886cc87173f4
/utils/ringbuf/inc/ringbuf.h
4d25fdd4a4794e4f1733f56814c1f80ab9cfd872
[ "Apache-2.0" ]
permissive
junlon2006/voice-sdk
aed2306ad02d7ef764d68d7aa339b31fac8bbb19
f395d01ce490b628bbcbf71c5c468e3e1ebbf6c5
refs/heads/master
2022-12-29T19:00:56.259790
2020-10-16T08:30:46
2020-10-16T08:30:46
271,428,729
1
0
Apache-2.0
2020-07-20T06:37:07
2020-06-11T02:04:09
C
UTF-8
C
false
false
1,786
h
/************************************************************************** * Copyright (C) 2018-2019 Junlon2006 * * 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, write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ************************************************************************** * * Description : ringbuf.h * Author : junlon2006@163.com * Date : 2019.03.17 * **************************************************************************/ #ifndef VOICE_SDK_UTILS_RINGBUF_INC_RINGBUF_H_ #define VOICE_SDK_UTILS_RINGBUF_INC_RINGBUF_H_ #ifdef __cplusplus extern "C" { #endif typedef void* RingBufferHandle; RingBufferHandle RingBufferCreate(int size); int RingBufferDestroy(RingBufferHandle handle); int RingBufferPeek(char *dst, int readlen, RingBufferHandle handle); int RingBufferClear(RingBufferHandle handle); int RingBufferGetFreeSize(RingBufferHandle handle); int RingBufferGetDataSize(RingBufferHandle handle); int RingBufferWrite(RingBufferHandle handle, char *src, int writelen); int RingBufferRead(char *dst, int readlen, RingBufferHandle handle); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* VOICE_SDK_UTILS_RINGBUF_INC_RINGBUF_H_ */
[ "shangjinlong@unisound.com" ]
shangjinlong@unisound.com
f55dc0c1daa1364150051e5ded774a2a89e6f48b
0c5d3b088080577388f5766431487534f93a2c40
/Github-Projects-Origin/linux-master/scripts/dtc/fdtdump.c.bak.c
33744b63323681e6a16db06b30049dc493efec46
[]
no_license
zhiyuanjia/WoBench
878255ce45e76ef57f88743c7f43acdfa59e93e7
6b337780cbd598de98fc0eabd19efaf1a01b6012
refs/heads/master
2021-09-23T03:12:08.091319
2018-06-14T10:17:59
2018-06-14T10:17:59
null
0
0
null
null
null
null
UTF-8
C
false
false
3,816
c
#include <assert.h> #include <string.h> #define INCLUDEMAIN // SPDX-License-Identifier: GPL-2.0 /* * fdtdump.c - Contributed by Pantelis Antoniou <pantelis.antoniou AT gmail.com> */ #include <stdint.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <fdt.h> #include <libfdt_env.h> #include "util.h" #define ALIGN(x, a) (((x) + ((a) - 1)) & ~((a) - 1)) #define PALIGN(p, a) ((void *)(ALIGN((unsigned long)(p), (a)))) #define GET_CELL(p) (p += 4, *((const uint32_t *)(p-4))) static void print_data(const char *data, int len) { int i; const char *p = data; /* no data, don't print */ if (len == 0) return; if (util_is_printable_string(data, len)) { printf(" = \"%s\"", (const char *)data); } else if ((len % 4) == 0) { printf(" = <"); for (i = 0; i < len; i += 4) printf("0x%08x%s", fdt32_to_cpu(GET_CELL(p)), i < (len - 4) ? " " : ""); printf(">"); } else { printf(" = ["); for (i = 0; i < len; i++) printf("%02x%s", *p++, i < len - 1 ? " " : ""); printf("]"); } } static void dump_blob(void *blob) { struct fdt_header *bph = blob; uint32_t off_mem_rsvmap = fdt32_to_cpu(bph->off_mem_rsvmap); uint32_t off_dt = fdt32_to_cpu(bph->off_dt_struct); uint32_t off_str = fdt32_to_cpu(bph->off_dt_strings); struct fdt_reserve_entry *p_rsvmap = (struct fdt_reserve_entry *)((char *)blob + off_mem_rsvmap); const char *p_struct = (const char *)blob + off_dt; const char *p_strings = (const char *)blob + off_str; uint32_t version = fdt32_to_cpu(bph->version); uint32_t totalsize = fdt32_to_cpu(bph->totalsize); uint32_t tag; const char *p, *s, *t; int depth, sz, shift; int i; uint64_t addr, size; depth = 0; shift = 4; printf("/dts-v1/;\n"); printf("// magic:\t\t0x%x\n", fdt32_to_cpu(bph->magic)); printf("// totalsize:\t\t0x%x (%d)\n", totalsize, totalsize); printf("// off_dt_struct:\t0x%x\n", off_dt); printf("// off_dt_strings:\t0x%x\n", off_str); printf("// off_mem_rsvmap:\t0x%x\n", off_mem_rsvmap); printf("// version:\t\t%d\n", version); printf("// last_comp_version:\t%d\n", fdt32_to_cpu(bph->last_comp_version)); if (version >= 2) printf("// boot_cpuid_phys:\t0x%x\n", fdt32_to_cpu(bph->boot_cpuid_phys)); if (version >= 3) printf("// size_dt_strings:\t0x%x\n", fdt32_to_cpu(bph->size_dt_strings)); if (version >= 17) printf("// size_dt_struct:\t0x%x\n", fdt32_to_cpu(bph->size_dt_struct)); printf("\n"); for (i = 0; ; i++) { addr = fdt64_to_cpu(p_rsvmap[i].address); size = fdt64_to_cpu(p_rsvmap[i].size); if (addr == 0 && size == 0) break; printf("/memreserve/ %llx %llx;\n", (unsigned long long)addr, (unsigned long long)size); } p = p_struct; while ((tag = fdt32_to_cpu(GET_CELL(p))) != FDT_END) { /* printf("tag: 0x%08x (%d)\n", tag, p - p_struct); */ if (tag == FDT_BEGIN_NODE) { s = p; p = PALIGN(p + strlen(s) + 1, 4); if (*s == '\0') s = "/"; printf("%*s%s {\n", depth * shift, "", s); depth++; continue; } if (tag == FDT_END_NODE) { depth--; printf("%*s};\n", depth * shift, ""); continue; } if (tag == FDT_NOP) { printf("%*s// [NOP]\n", depth * shift, ""); continue; } if (tag != FDT_PROP) { fprintf(stderr, "%*s ** Unknown tag 0x%08x\n", depth * shift, "", tag); break; } sz = fdt32_to_cpu(GET_CELL(p)); s = p_strings + fdt32_to_cpu(GET_CELL(p)); if (version < 16 && sz >= 8) p = PALIGN(p, 8); t = p; p = PALIGN(p + sz, 4); printf("%*s%s", depth * shift, "", s); print_data(t, sz); printf(";\n"); } } int main(int argc, char *argv[]) { char *buf; if (argc < 2) { fprintf(stderr, "supply input filename\n"); return 5; } buf = utilfdt_read(argv[1]); if (buf) dump_blob(buf); else return 10; return 0; }
[ "wangcong15@mails.tsinghua.edu.cn" ]
wangcong15@mails.tsinghua.edu.cn
7742378e5e910f835e56f7d031fb6dd4331ce1d5
da0899519f0722acbcdd5e0aaf08849db887d42d
/vendor/marvell/generic/ttc_telephony/drivers/hwmap/hwmap.c
f0caa56e37824512213b1d141d52084b5bf63fe3
[]
no_license
ljvblfz/TD100
5ac9968a823008b9c55440a85606a22adf1599e2
89b962ee3056d076220b8a972762f23367567a9f
refs/heads/master
2023-08-19T20:02:49.540718
2017-04-29T13:10:05
2017-04-29T13:10:05
null
0
0
null
null
null
null
UTF-8
C
false
false
3,839
c
/* * 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. *(C) Copyright 2008 Marvell International Ltd. * All Rights Reserved */ #include <linux/errno.h> #include <linux/init.h> #include <linux/module.h> #include <linux/wait.h> #include <linux/tty.h> #include <linux/tty_driver.h> #include <linux/tty_flip.h> #include <linux/serial.h> #include <asm/uaccess.h> #include <linux/tty_ldisc.h> #include <linux/module.h> #include <linux/kernel.h> #include <linux/fs.h> #include <linux/string.h> #include <linux/module.h> #include <linux/errno.h> #include <linux/mm.h> #include <linux/vmalloc.h> #include <linux/mman.h> #include <linux/slab.h> #include <asm/io.h> #include <asm/uaccess.h> #include <asm/pgtable.h> //#define HWMAP_DEBUG #define HWMAP_MAJOR 237 #define DRIVER_VERSION "v1.0" #define DRIVER_AUTHOR "Marvell" #define DRIVER_DESC "Driver for HW access via physical address" /* Module information */ MODULE_AUTHOR( DRIVER_AUTHOR ); MODULE_DESCRIPTION( DRIVER_DESC ); MODULE_LICENSE("GPL"); static void hwmap_vma_open(struct vm_area_struct *vma) { #if defined(HWMAP_DEBUG) printk("HWMAP OPEN 0x%lx -> 0x%lx (0x%lx)\n",vma->vm_start, vma->vm_pgoff<<PAGE_SHIFT, vma->vm_page_prot); #endif } static void hwmap_vma_close(struct vm_area_struct *vma) { #if defined(HWMAP_DEBUG) printk("HWMAP CLOSE 0x%lx -> 0x%lx\n",vma->vm_start, vma->vm_pgoff<<PAGE_SHIFT); #endif } // These are mostly for debug: do nothing useful otherwise static struct vm_operations_struct vm_ops = { .open=hwmap_vma_open, .close=hwmap_vma_close }; /* device memory map method */ /* vma->vm_end, vma->vm_start : specify the user space process address range assigned when mmap has been called; vma->vm_pgoff - is the physical address supplied by user to mmap in the last argument (off) However, mmap restricts the offset, so we pass this shifted 12 bits right. */ int hwmap_mmap(struct file *file, struct vm_area_struct *vma) { unsigned long size = vma->vm_end - vma->vm_start; unsigned long pa=vma->vm_pgoff; /* we do not want to have this area swapped out, lock it */ vma->vm_flags |= (VM_RESERVED|VM_IO); vma->vm_page_prot=pgprot_noncached(vma->vm_page_prot); // see linux/drivers/char/mem.c // TBD: without this vm_page_prot=0x53 and write seem to not reach the destination: // - no fault on write // - read immediately (same user process) return the new value // - read after a second by another user process instance return original value // Why PROT_WRITE specified by mmap caller does not take effect? // MAP_PRIVATE used by app results in copy-on-write behaviour, which is irrelevant for this application //vma->vm_page_prot|=L_PTE_WRITE; if(io_remap_pfn_range(vma, vma->vm_start, pa,/* physical page index */ size, vma->vm_page_prot)) { printk("remap page range failed\n"); return -ENXIO; } vma->vm_ops=&vm_ops; hwmap_vma_open(vma); return(0); } static const struct file_operations hwmap_fops = { .owner = THIS_MODULE, .mmap = hwmap_mmap }; static int __init hwmap_init(void) { int err = 0; err = register_chrdev (HWMAP_MAJOR, "hwmap", &hwmap_fops); if (err) { printk(KERN_ERR "%s can't register device\n",__FUNCTION__); return -ENOMEM; } return 0; } static void __exit hwmap_exit(void) { unregister_chrdev (HWMAP_MAJOR, "hwmap"); printk(KERN_DEBUG "%s unregistering chrdev done\n",__FUNCTION__); } #ifdef MODULE module_init(hwmap_init); module_exit(hwmap_exit); MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("HW memory mapped access"); #else subsys_initcall(hwmap_init); #endif
[ "342981011@qq.com" ]
342981011@qq.com
e5cfa41f4d04e920a0fd2dc0e103cbd07ab111e4
ba72657d57053c4b5427c94886f98aa95ccb5f63
/numeric/AKWF_1865.h
e2e40899b17fc94d9f003ae8ce057b3e44d790a9
[ "CC-BY-3.0" ]
permissive
reverbrick/AKWF_WaveForms
d1ebbc2b35e7c85f558315c0c1cf1ac13e44de16
ba4819c84c180e437b3d556fe6effd5075b33590
refs/heads/master
2021-05-27T00:15:22.063748
2014-07-19T00:18:37
2014-07-19T00:18:37
null
0
0
null
null
null
null
UTF-8
C
false
false
1,967
h
// Converted by AKWF2Teensy from AKWF_1865.wav. // AKWF2Teensy - Beerware by Datanoise.net. // Length: 257 const int16_t AKWF_1865[257] = { 618, 2242, 4086, 5765, 7276, 8646, 9885, 11387, 12965, 14336, 15647, 17229, 18815, 20199, 21479, 22609, 23648, 24566, 25411, 26158, 26844, 27452, 28009, 28504, 28954, 29356, 29722, 30047, 30344, 30608, 30845, 31062, 31253, 31426, 31580, 31720, 31845, 31957, 32057, 32147, 32226, 32298, 32360, 32417, 32466, 32512, 32550, 32585, 32615, 32642, 32664, 32685, 32702, 32717, 32728, 32739, 32747, 32755, 32758, 32763, 32765, 32767, 32766, 32767, 32766, 32764, 32760, 32759, 32754, 32751, 32746, 32740, 32737, 32728, 32726, 32713, 32716, 32660, 32196, 31631, 31119, 30188, 29260, 28404, 27676, 26822, 25662, 24578, 23620, 22727, 21965, 21077, 19876, 18776, 17417, 15947, 14380, 12554, 10630, 8487, 6278, 3872, 1461, -961, -3503, -5829, -7891, -9870,-12062, -14147,-15976,-17683,-18976,-19771,-20499,-21137,-21742,-22113,-22032, -21954,-21861,-21809,-21446,-20802,-20271,-19753,-19321,-18885,-18645, -18838,-19067,-19258,-19441,-19598,-19742,-19872,-19981,-20105,-20004, -19514,-19097,-18648,-17841,-16954,-16213,-15235,-14024,-12978,-11994, -11145,-10335, -9655, -8974, -8644, -8676, -8750, -9186, -9908,-10909, -12134,-13572,-14907,-16525,-18149,-19574,-20885,-22045,-23112,-24056, -24923,-25692,-26396,-27020,-27591,-28097,-28563,-28973,-29351,-29683, -29988,-30265,-30374,-30012,-29741,-29260,-28486,-27413,-26193,-24845, -23285,-21714,-19870,-18219,-16711,-15359,-14135,-13030,-12036,-11135, -10322, -9651, -9490, -9416, -9438, -9889,-10375,-10794,-11186,-11523, -11920,-12741,-13312,-13435,-13574,-13676,-13783,-13870,-13954,-14025, -14090,-14151,-14198,-14254,-14278,-14435,-15005,-15554,-16058,-16488, -17138,-18087,-18896,-19662,-20323,-20945,-21484,-21987,-22427,-22833, -23176,-23098,-22821,-22591,-21979,-20955,-19706,-18225,-16563,-14691, -12857,-10786, -8818, -6830, -4637, -2719, -931, 618 };
[ "github@ext.no-route.org" ]
github@ext.no-route.org
7944ae7bf637cab2a34aa600d22038b2fe165e2a
764e17f550d035345ea7668031b5230c17437018
/例程一:基本直立/User/jiaodu.c
6d1ed52910f7d9cabc7988cd2d7f58a83b39da9b
[]
no_license
koenzhao/Two-River-Cup
afc7734cf5bc0a0e0bf51ed633b1804dae434bb6
238d6b515d2540a11f4300651d18c22ac622d57c
refs/heads/master
2021-05-28T16:43:21.929161
2015-05-09T08:31:31
2015-05-09T08:31:31
null
0
0
null
null
null
null
GB18030
C
false
false
8,145
c
#include "System_init.h" #include "math.h" /******************************************************************** 变量定义 ********************************************************************/ extern int PWM_kongzhi; extern int zhuanwan_pwm; #define FILTER_COUNT 16 float g_fAngle = 0; // 滤波之后的角度 float g_fAngle_Dot = 0; // 滤波之后的角速度 s16 g_nStandCtrOut = 0; // 直立PWM输出 s16 gx_buf[FILTER_COUNT], ax_buf[FILTER_COUNT], ay_buf[FILTER_COUNT],az_buf[FILTER_COUNT],gy_buf[FILTER_COUNT]; s16 Accel_x,Accel_y,Accel_z,iGyro_y; float Angle,Gyro_y,Angle_ax,Angle_gy,Gyro; #define DEAD 30 int speedl; int speedr; float kp = 0.0; //360 200 210 265 //float kd = 14.5; float jiaodu_PWM; float speed_right,speed_left,RotateError,IRotateError,RotateCompen; /*********速度闭环所需参数************/ float fSpeed_Vechile; float fSpeed_Vechile_F; double fPosition; float sudu_pwm; /******************************************************************** 电机占空比输出(外部调用) ********************************************************************/ int speedL=0; int speedR=0; void SpeedL(int SpeedL) { if (SpeedL>3590) SpeedL=3590; if (SpeedL<-3590) SpeedL=-3590; TIM3->CCR1 = 3600+SpeedL; TIM3->CCR2 = 3600-SpeedL; } void SpeedR(int SpeedR) { if (SpeedR>3590) SpeedR=3590; if (SpeedR<-3590) SpeedR=-3590; TIM3->CCR3 = 3600+SpeedR; TIM3->CCR4 = 3600-SpeedR; } /******************************************************************** 加速度计数据滤波(内部调用) ********************************************************************/ void acc_filter(void) { u8 i; s32 ax_sum = 0, ay_sum = 0, az_sum = 0; for(i = 1 ; i < FILTER_COUNT; i++) { ax_buf[i - 1] = ax_buf[i]; ay_buf[i - 1] = ay_buf[i]; az_buf[i - 1] = az_buf[i]; } ax_buf[FILTER_COUNT - 1] = Accel_x; ay_buf[FILTER_COUNT - 1] = Accel_y; az_buf[FILTER_COUNT - 1] = Accel_z; for(i = 0 ; i < FILTER_COUNT; i++) { ax_sum += ax_buf[i]; ay_sum += ay_buf[i]; az_sum += az_buf[i]; } Accel_x = (s16)(ax_sum / FILTER_COUNT); Accel_y = (s16)(ay_sum / FILTER_COUNT); Accel_z = (s16)(az_sum / FILTER_COUNT); } /******************************************************************** 陀螺仪加速度采集函数(外部调用) ********************************************************************/ void Angle_Calculate(void) { static uint8_t DataBuffer[2]; //数据缓存 static uint8_t x_DataBuffer[2]; static uint8_t y_DataBuffer[2]; static uint8_t z_DataBuffer[2]; /****************************加速度Y轴 加速度计*****************************/ I2C_ReadBuffer(x_DataBuffer, ACCEL_XOUT_H, 2); I2C_ReadBuffer(y_DataBuffer, ACCEL_YOUT_H, 2); I2C_ReadBuffer(z_DataBuffer, ACCEL_ZOUT_H, 2); /****************************角速度陀螺仪 x 轴 ********************************/ I2C_ReadBuffer(DataBuffer, GYRO_XOUT_H, 2); // Accel_x = (short)((x_DataBuffer[0]<<8)+ x_DataBuffer[1]); //读取x轴加速度 Accel_y = (short)((y_DataBuffer[0]<<8)+ y_DataBuffer[1]); //读取y轴加速度 Accel_z = (short)((z_DataBuffer[0]<<8)+ z_DataBuffer[1]); //读取z轴加速度 // iGyro_y = (short)((DataBuffer[0]<<8)+DataBuffer[1]); //滤波 acc_filter(); //利用加速度计计算倾角 Angle_gy = (float)(Accel_y); Angle_ax = ((float)(acos((Accel_y) / sqrt(Accel_x * Accel_x + Accel_y * Accel_y + Accel_z*Accel_z)))); Angle = (90.0-((Angle_ax )*(180.0)/3.14)); //弧度转换为度, //陀螺仪积分倾角 Gyro = (float)(iGyro_y); Gyro_y = (((float)(iGyro_y+29.0)/16.4)); Kalman_Filter(Angle,Gyro_y); } /******************************************************************** 速度闭环+位置闭环函数(内部调用) ********************************************************************/ float sudu_p = 0.0; // float weizhi_p = 0.0; //0.04 void pid_sudu(float p,float i,float d) { speed_right = Get_Speed_R(); speed_left = Get_Speed_L(); fSpeed_Vechile = ((speed_right)+(speed_left))*0.5; fSpeed_Vechile_F = fSpeed_Vechile_F * 0.7 + fSpeed_Vechile * 0.3; /*累加求位移*/ fPosition += fSpeed_Vechile_F; /*位移调节量*/ fPosition -= PWM_kongzhi; /*位移限制,上下限待调节*/ if(fPosition > 50000.0) { //5000 fPosition = 50000.0; } else if(fPosition < -50000.0) { fPosition = -50000.0; } RotateError = speed_left - speed_right; IRotateError += RotateError; RotateCompen = RotateError * 0.5 + IRotateError * 0.0; speed_right =0; speed_left =0; if((40.0>=Angle)&&(-40.0<=Angle)) { kp =p+ Fuzzy(g_fAngle,g_fAngle_Dot); jiaodu_PWM = kp * (g_fAngle) + d * g_fAngle_Dot; sudu_pwm = sudu_p * fSpeed_Vechile_F + weizhi_p * fPosition + RotateCompen; } else { jiaodu_PWM =0; sudu_pwm = 0; } } /******************************************************************** 电机累加函数(内部调用) ********************************************************************/ void PWM_out(void) { int pwm_out; int left_pwm_out=0,right_pwm_out=0; pwm_out = (int)(-jiaodu_PWM - sudu_pwm); left_pwm_out = pwm_out + zhuanwan_pwm; right_pwm_out = pwm_out - zhuanwan_pwm; if (left_pwm_out>0) left_pwm_out+=DEAD; else left_pwm_out-=(DEAD); if (right_pwm_out>0) right_pwm_out+=DEAD; else right_pwm_out-=(DEAD); SpeedL(left_pwm_out); SpeedR(right_pwm_out); } /******************************************************************** 卡尔曼滤波函数(内部调用) ********************************************************************/ void Kalman_Filter(float Angle_Kal,float Gyro_Kal) { float Q_angle=0.003; float Q_gyro=0.001; float R_angle=0.01; float dt=0.01;//10ms static float P[2][2] = { { 1, 0 }, { 0, 1 } }; static float q_bias=0; static float angle_err=0; static float PCt_0=0; static float PCt_1=0; static float K_1=0; static float t_0=0; static float t_1=0; static float E=0; static float K_0=0; static float Pdot[4] ={0,0,0,0}; static const char C_0 = 1; g_fAngle += (Gyro_Kal - q_bias) * dt; //先验估计 Pdot[0] = Q_angle - P[0][1] - P[1][0]; // Pk-' 先验估计误差协方差的微分 Pdot[1] =- P[1][1]; Pdot[2] =- P[1][1]; Pdot[3] = Q_gyro; P[0][0] += Pdot[0] * dt; // Pk- 先验估计误差协方差微分的积分 = 先验估计误差协方差 P[0][1] += Pdot[1] * dt; P[1][0] += Pdot[2] * dt; P[1][1] += Pdot[3] * dt; angle_err = Angle_Kal - g_fAngle; //zk-先验估计 PCt_0 = C_0 * P[0][0]; PCt_1 =C_0 * P[1][0]; E = R_angle+ C_0 *PCt_0; K_0 = PCt_0 / E; //Kk K_1 = PCt_1 / E; t_0 = PCt_0; t_1 = P[0][1]; //C_0 * P[0][0] -= K_0 * t_0; //后验估计误差协方差 P[0][1] -= K_0 * t_1; P[1][0] -= K_1 * t_0; P[1][1] -= K_1 * t_1; g_fAngle += K_0 * angle_err; //后验估计 q_bias += K_1 * angle_err; //后验估计 g_fAngle_Dot = Gyro_Kal - q_bias; //输出值(后验估计)的微分 = 角速度 } void upright_Adjust(float p,float i,float d) { Angle_Calculate();//角速度 陀螺仪 pid_sudu(p,i,d); PWM_out(); }
[ "koen.chiu@gmail.com" ]
koen.chiu@gmail.com
65fb726951aec458c2fc6820460dbb8516f967a1
1f83a8615021b6686030f14d182a537706cfa4f7
/sys/arch/i386/stand/efiboot/efiboot.c
614d1e74a494f6b2e648f0ce558214ce78a2f677
[]
no_license
ach84/netbsd-9.1
b792ae300afd072f35ca1f14200304a1bf8cd8c6
0b531b792493c076fa4fd26c5a9f0104a511f625
refs/heads/master
2023-03-16T16:01:32.036323
2021-03-07T01:41:13
2021-03-07T01:41:13
343,806,155
0
0
null
null
null
null
UTF-8
C
false
false
5,202
c
/* $NetBSD: efiboot.c,v 1.10.2.2 2020/02/10 18:59:48 martin Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka <nonaka@netbsd.org> * 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 REGENTS 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 REGENTS OR 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. */ #include "efiboot.h" #include "bootinfo.h" #include "devopen.h" EFI_HANDLE IH; EFI_DEVICE_PATH *efi_bootdp; enum efi_boot_device_type efi_bootdp_type = BOOT_DEVICE_TYPE_HD; EFI_LOADED_IMAGE *efi_li; uintptr_t efi_main_sp; physaddr_t efi_loadaddr, efi_kernel_start; u_long efi_kernel_size; bool efi_cleanuped; struct btinfo_efimemmap *btinfo_efimemmap = NULL; static EFI_PHYSICAL_ADDRESS heap_start = EFI_ALLOCATE_MAX_ADDRESS; static UINTN heap_size = 1 * 1024 * 1024; /* 1MB */ static struct btinfo_efi btinfo_efi; static void efi_heap_init(void); EFI_STATUS EFIAPI efi_main(EFI_HANDLE, EFI_SYSTEM_TABLE *); EFI_STATUS EFIAPI efi_main(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE *systemTable) { EFI_STATUS status; EFI_DEVICE_PATH *dp0, *dp; extern char twiddle_toggle; IH = imageHandle; InitializeLib(IH, systemTable); efi_main_sp = (uintptr_t)&status; twiddle_toggle = 1; /* no twiddling until we're ready */ cninit(); efi_heap_init(); efi_md_init(); status = uefi_call_wrapper(BS->HandleProtocol, 3, IH, &LoadedImageProtocol, (void **)&efi_li); if (EFI_ERROR(status)) panic("HandleProtocol(LoadedImageProtocol): %" PRIxMAX, (uintmax_t)status); status = uefi_call_wrapper(BS->HandleProtocol, 3, efi_li->DeviceHandle, &DevicePathProtocol, (void **)&dp0); if (EFI_ERROR(status)) panic("HandleProtocol(DevicePathProtocol): %" PRIxMAX, (uintmax_t)status); efi_bootdp = dp0; for (dp = dp0; !IsDevicePathEnd(dp); dp = NextDevicePathNode(dp)) { if (DevicePathType(dp) == MEDIA_DEVICE_PATH && DevicePathSubType(dp) == MEDIA_CDROM_DP) { efi_bootdp_type = BOOT_DEVICE_TYPE_CD; break; } if (DevicePathType(dp) == MESSAGING_DEVICE_PATH && DevicePathSubType(dp) == MSG_MAC_ADDR_DP) { efi_bootdp_type = BOOT_DEVICE_TYPE_NET; break; } } efi_memory_probe(); efi_disk_probe(); efi_pxe_probe(); efi_net_probe(); status = uefi_call_wrapper(BS->SetWatchdogTimer, 4, 0, 0, 0, NULL); if (EFI_ERROR(status)) panic("SetWatchdogTimer: %" PRIxMAX, (uintmax_t)status); boot(); return EFI_SUCCESS; } void efi_cleanup(void) { EFI_STATUS status; EFI_MEMORY_DESCRIPTOR *desc; UINTN NoEntries, MapKey, DescriptorSize; UINT32 DescriptorVersion; size_t allocsz; memset(&btinfo_efi, 0, sizeof(btinfo_efi)); btinfo_efi.systblpa = (intptr_t)ST; #ifdef __i386__ /* bootia32.efi */ btinfo_efi.flags |= BI_EFI_32BIT; #endif BI_ADD(&btinfo_efi, BTINFO_EFI, sizeof(btinfo_efi)); NoEntries = 0; desc = efi_memory_get_map(&NoEntries, &MapKey, &DescriptorSize, &DescriptorVersion, true); status = uefi_call_wrapper(BS->ExitBootServices, 2, IH, MapKey); if (EFI_ERROR(status)) { FreePool(desc); desc = efi_memory_get_map(&NoEntries, &MapKey, &DescriptorSize, &DescriptorVersion, true); status = uefi_call_wrapper(BS->ExitBootServices, 2, IH, MapKey); if (EFI_ERROR(status)) panic("ExitBootServices failed"); } efi_cleanuped = true; efi_memory_compact_map(desc, &NoEntries, DescriptorSize); allocsz = sizeof(struct btinfo_efimemmap) - 1 + NoEntries * DescriptorSize; btinfo_efimemmap = alloc(allocsz); btinfo_efimemmap->num = NoEntries; btinfo_efimemmap->version = DescriptorVersion; btinfo_efimemmap->size = DescriptorSize; memcpy(btinfo_efimemmap->memmap, desc, NoEntries * DescriptorSize); BI_ADD(btinfo_efimemmap, BTINFO_EFIMEMMAP, allocsz); } static void efi_heap_init(void) { EFI_STATUS status; u_int sz = EFI_SIZE_TO_PAGES(heap_size); status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateMaxAddress, EfiLoaderData, sz, &heap_start); if (EFI_ERROR(status)) Panic(L"%a: AllocatePages() failed: %d page(s): %r", __func__, sz, status); setheap((void *)(UINTN)heap_start, (void *)(UINTN)(heap_start + heap_size)); }
[ "adrian.chomicki@gmail.com" ]
adrian.chomicki@gmail.com
f9e9d3bcfd2681cf00f05394c202f49a0a3d01e9
8a0dc206f1e46cb686bab0f1925d49737b264eff
/第十七天/tolset/MyOS46/winhelo3.c
e548fd9da2926c56c12f3466c2713cae39808854
[]
no_license
JingyuHan/MyOS
852f5928e25ff40d339e5550fa32ea5de8ddcd6b
4ca9ed0446502875d1d040e421a38ae69a900156
refs/heads/master
2020-06-25T08:03:15.120613
2017-08-03T06:49:22
2017-08-03T06:49:22
96,967,505
1
1
null
null
null
null
UTF-8
C
false
false
568
c
int api_openwin(char *buf, int xsiz, int ysiz, int col_inv, char *title); void api_putstrwin(int win, int x, int y, int col, int len, char *str); void api_boxfilwin(int win, int x0, int y0, int x1, int y1, int col); void api_initmalloc(void); char *api_malloc(int size); void api_end(void); void HariMain(void) { char *buf; int win; api_initmalloc(); buf = api_malloc(150 * 50); win = api_openwin(buf, 150, 50, -1, "hello"); api_boxfilwin(win, 8, 36, 141, 43, 6 /* 浅蓝色 */); api_putstrwin(win, 28, 28, 0 /* 黑色 */, 12, "hello, world"); api_end(); }
[ "1292124563@qq.com" ]
1292124563@qq.com
c88a6a4b0a33cd72c42ef4f436810813804ece50
06909b9c8c12f3514c10e1c355166bcad734257f
/codes/Sort/RadixSort/C/ListBaseQueue.h
cf638e0dcc10356bacd0b7b03fd2301a35f3860d
[]
no_license
Oneul1213/DatastructureNAlgorithm
b51139f1a2668b4741cbf20552c88ef98ba65089
b4d455ad977128785660d19fa4a057c0b9c7446d
refs/heads/main
2023-04-05T07:34:30.483761
2021-04-26T15:03:20
2021-04-26T15:03:20
345,888,926
1
0
null
null
null
null
UTF-8
C
false
false
395
h
#ifndef __LB_QUEUE_H__ #define __LB_QUEUE_H__ #define TRUE 1 #define FALSE 0 typedef int Data; typedef struct _node { Data data; struct _node* next; } Node; typedef struct _lQueue { Node* front; Node* rear; } LQueue; typedef LQueue Queue; void QueueInit(Queue* pq); int QIsEmpty(Queue* pq); void Enqueue(Queue* pq, Data data); Data Dequeue(Queue* pq); Data QPeek(Queue* pq); #endif
[ "toda1213@naver.com" ]
toda1213@naver.com
a12bfd1d40261bd2bf00b2dd440ec872d87ead41
e887709db8d9f2bd247090b410c3ab286c8a6d8d
/PROJECT_TWO/main.c
84bf487af5256c4dea1e713fb46e962bb35630e4
[]
no_license
AbdullahAbdelhakeem6484/Workspace-Embedded-System
b1aef442d437c681015cf3efd2336c1a4c5c8d7b
f08fd847abd76cb64d0cc44da760dbd1c0e3e59a
refs/heads/master
2021-06-16T04:28:35.270176
2021-02-25T19:09:31
2021-02-25T19:09:31
164,325,269
0
0
null
null
null
null
WINDOWS-1252
C
false
false
3,711
c
/* * main.c * * Created on: ??þ/??þ/???? * Author: Fly labs */ #include"STD_Types.h" #include"macros.h" #include "DIO_interface.h" #include "LCD_interface.h" #include "keypad_interface.h" #include "UART_interface.h" #include "EEPROM_interface.h" #include "I2C_interface.h" #include "SERVO_interface.h" #include<avr/io.h> #define F_CPU 12000000 #include<util/delay.h> void getPassword(u8 array[]); u8 password[6]; u8 compare=0; //u32 i; //u32 getPassword(void); int main(void) { UART_voidInit(); KEYPAD_voidInit(); LCD_voidInit(); I2C_voidInit(); EEPROM_voidInit(); LCD_voidClear(); LCD_voidSetCursor (0,0); LCD_voidWriteString("PLS Enter Pass"); getPassword(password); compare=strcmp(password,"1234"); if(compare==0) { LCD_voidSetCursor (1 ,8); LCD_voidWriteString("correct"); SERVO_voidAngle(90); _delay_ms(3000); SERVO_voidAngle(0); } else{ LCD_voidSetCursor (1 ,8); LCD_voidWriteString("error"); } while(1) {} return 0; } void getPassword(u8 array[]) { s8 i; u8 key; for (i = 0; i < 4; i++) { key = KEYPAD_u8GetKey(); if (key == '*') { LCD_voidSetCursor(1, 0); LCD_voidWriteString(" "); i = -1; continue; } else if ((key >= 0) && (key <= 9)) { array[i] = key; } else { i -= 1; continue; } _delay_ms(400); LCD_voidSetCursor(1, i + 3); //LCD_voidWriteCharacter(key); LCD_voidWriteCharacter('*'); //LCD_voidWrite(array); if (i == 4) { key = KEYPAD_u8GetKey(); if (key == 13) { break; } else if (key == '*') { LCD_voidSetCursor(1, 0); LCD_voidWriteString(" "); i = -1; continue; } } } } /*u32 getPassword(void) { LCD_voidSetCursor (0,0); LCD_voidWriteString("PLS Enter Pass"); for(i=0;i<4;i++) { while(password[i]==0) { password[i]=KEYPAD_u8GetKey(); } if(password[i]==1) password[i]='1'; if(password[i]==2) password[i]='2'; if(password[i]==3) password[i]='3'; if(password[i]==4) password[i]='4'; if(password[i]==5) password[i]='5'; if(password[i]==6) password[i]='6'; if(password[i]==7) password[i]='7'; if(password[i]==8) password[i]='8'; if(password[i]==9) password[i]='9'; _delay_ms(1000); LCD_voidSetCursor (1 ,i+1); LCD_voidWriteCharacter('*'); } if(strcmp(password,"1234")==0) { return 1; /*LCD_voidSetCursor (1 ,6); LCD_voidWriteString("correct");*/ /* } else { LCD_voidSetCursor (1 ,6); LCD_voidWriteString("correct"); } } */ //#define BUTTON_DELAY 400 /*define a time value of each button press */ /*void getPassword(u8 array[]); void prepareToSend(u8 array[], u8 array2[]); int main (void) { u8 key=0; u8 i=0; u32 pass[4]; KEYPAD_voidInit(); LCD_voidInit(); I2C_voidInit(); EEPROM_voidInit(); while(1) { getPassword(pass[4]); } return 0; } void getPassword(u8 array[]) { s8 i; u8 key; for (i = 0; i < 5; i++) { key = KEYPAD_u8GetKey(); if (key == '*') { LCD_voidSetCursor (1, 0); LCD_voidWriteString(" "); i = -1; continue; } else if ((key >= 0) && (key <= 9)) { array[i] = key; } else { i -= 1; continue; } _delay_ms(BUTTON_DELAY); LCD_voidSetCursor(1, i + 3); LCD_voidWriteCharacter('*'); if (i == 4) { key = KEYPAD_u8GetKey(); if (key == 13) { break; } else if (key == '*') { LCD_voidSetCursor (1, 0); LCD_voidWriteString(" "); i = -1; continue; } } } } void prepareToSend(u8 array[], u8 array2[]) { s8 i = 0; for (i = 0; i < 6; i++) { array2[i] = array[i]; if (i == 5) { array2[i] = '#'; //break; } } } */
[ "abdullah.abdelhakeem657@gmail.com" ]
abdullah.abdelhakeem657@gmail.com
5ac592fc8ee18f32b5066104a320156b27fc5d74
5c255f911786e984286b1f7a4e6091a68419d049
/vulnerable_code/c596a320-56cf-4ff1-a222-d4b960708fb1.c
2cc07e9bb771c0355737e28c6a217c83f2ab2867
[]
no_license
nmharmon8/Deep-Buffer-Overflow-Detection
70fe02c8dc75d12e91f5bc4468cf260e490af1a4
e0c86210c86afb07c8d4abcc957c7f1b252b4eb2
refs/heads/master
2021-09-11T19:09:59.944740
2018-04-06T16:26:34
2018-04-06T16:26:34
125,521,331
0
0
null
null
null
null
UTF-8
C
false
false
579
c
#include <string.h> #include <stdio.h> int main() { int i=0; int j=12; int k; int l; k = 533; l = 64; k = i/j; l = i/j; l = l/j; l = j%j; l = l%j; k = k-k*i; //variables /* START VULNERABILITY */ int a; int b[85]; int c[11]; a = 0; while (a > -1) { //random /* START BUFFER SET */ *((int *)c + a) = *((int *)b + a); /* END BUFFER SET */ //random a--; } /* END VULNERABILITY */ //random printf("%d%d\n",k,l); return 0; }
[ "nharmon8@gmail.com" ]
nharmon8@gmail.com
bf6bd3f644dbcaaca5838ce51cf2c0fd4db42627
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
/source/libsodium/src/libsodium/crypto_core/ed25519/ref10/extr_ed25519_ref10.c_fe25519_pow22523.c
efee817a3e955936a0def9f71d94c54c1b463cdc
[]
no_license
isabella232/AnghaBench
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
9a5f60cdc907a0475090eef45e5be43392c25132
refs/heads/master
2023-04-20T09:05:33.024569
2021-05-07T18:36:26
2021-05-07T18:36:26
null
0
0
null
null
null
null
UTF-8
C
false
false
1,873
c
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ const fe25519 ; /* Variables and functions */ int /*<<< orphan*/ fe25519_mul (int /*<<< orphan*/ const,int /*<<< orphan*/ const,int /*<<< orphan*/ const) ; int /*<<< orphan*/ fe25519_sq (int /*<<< orphan*/ const,int /*<<< orphan*/ const) ; __attribute__((used)) static void fe25519_pow22523(fe25519 out, const fe25519 z) { fe25519 t0; fe25519 t1; fe25519 t2; int i; fe25519_sq(t0, z); fe25519_sq(t1, t0); fe25519_sq(t1, t1); fe25519_mul(t1, z, t1); fe25519_mul(t0, t0, t1); fe25519_sq(t0, t0); fe25519_mul(t0, t1, t0); fe25519_sq(t1, t0); for (i = 1; i < 5; ++i) { fe25519_sq(t1, t1); } fe25519_mul(t0, t1, t0); fe25519_sq(t1, t0); for (i = 1; i < 10; ++i) { fe25519_sq(t1, t1); } fe25519_mul(t1, t1, t0); fe25519_sq(t2, t1); for (i = 1; i < 20; ++i) { fe25519_sq(t2, t2); } fe25519_mul(t1, t2, t1); fe25519_sq(t1, t1); for (i = 1; i < 10; ++i) { fe25519_sq(t1, t1); } fe25519_mul(t0, t1, t0); fe25519_sq(t1, t0); for (i = 1; i < 50; ++i) { fe25519_sq(t1, t1); } fe25519_mul(t1, t1, t0); fe25519_sq(t2, t1); for (i = 1; i < 100; ++i) { fe25519_sq(t2, t2); } fe25519_mul(t1, t2, t1); fe25519_sq(t1, t1); for (i = 1; i < 50; ++i) { fe25519_sq(t1, t1); } fe25519_mul(t0, t1, t0); fe25519_sq(t0, t0); fe25519_sq(t0, t0); fe25519_mul(out, t0, z); }
[ "brenocfg@gmail.com" ]
brenocfg@gmail.com
61fc31a825e97d6626de4e4e30d3afc3085236f3
3d0951ebddd285ddec727a4d3796096501e226ff
/Chapter 17 Advance uses of Pointers/Introduction to linked list/Linked_list_inserting.c
2c60a7615a9fcd99e6df222fb867696f4d61ccb1
[]
no_license
Yuandjom/C-programming-a-modern-approach
cf341b878302eb901796e9c9d649081047257ebb
e6d6726af35d9fa0eeedbfd4d7542a261f42384a
refs/heads/master
2023-04-20T07:17:39.704132
2021-05-04T14:16:54
2021-05-04T14:16:54
304,856,315
0
0
null
2021-04-15T04:07:34
2020-10-17T10:51:34
C
UTF-8
C
false
false
1,065
c
//Linked list: Inserting a node at the nth position #include <stdio.h> #include <stdlib.h> struct Node{ int data; struct Node* next; //pointer type }Node; struct Node* head; //global variable void Insert(int data, int n); void Print(); int main(void) { head = NULL ; //empty list Insert(2,1); Insert(3,2); Insert(4,1); Insert(5,2); Print(); } void Insert(int data, int n ) { struct Node* temp1 = (struct Node*)malloc(sizeof(struct Node));//creating a Node for new temp variable temp1 -> data = data; temp1 -> next = NULL; if(n == 1){ temp1 -> next = head; head = temp1; return; // this will exit the function of Insert } struct Node* temp2 = head; //starting at the address of the head for( int i = 0; i < n-2; i ++){ temp2 = temp2->next; } temp1-> next = temp2-> next; temp2-> next = temp1; } void Print(){ struct Node* temp = head; while( temp != NULL){ printf("%d ", temp->data); temp = temp -> next; } printf("\n"); }
[ "ziyangjohn@gmail.com" ]
ziyangjohn@gmail.com
229f6b25d0949c39aeb3965e03b9c2d3105a6657
66bef660d7e88ca7141b814da4206fbe37d1c46e
/mudlib/d/1tlny/working/areas/plateau/rooms/jump1.c
9fb04ea41e37906cfdfa1a137340d0a9465b48d3
[]
no_license
Tlny/DarkeLIB
e1975bf5b2c436fa35a1b18b8c9d8a6ae2a270f9
903121f782b9ce9dec01a3197c2f0d69589fc7bf
refs/heads/master
2022-11-11T09:53:06.895952
2022-10-30T23:13:44
2022-10-30T23:13:44
234,828,979
0
1
null
2020-01-19T02:36:45
2020-01-19T02:36:44
null
UTF-8
C
false
false
586
c
#include <std.h> #include "/wizards/garetjax/plateau/defs.h" inherit ROOM; void create() { ::create(); set_property("light", 2); set_property("indoors", 1); set("short", "A Hermit's Hut"); set_long( "You are on a bare patch of ground, surrounded by mist so thick, you cant" " see the edge of your eyeball." ); add_exit("plat28", "out"); set_smell("default", "The air is odorless."); set_listen("default", "There is no sound here."); } void reset() { ::reset(); new(PLATMON + "specguard") -> move(this_object()); }
[ "60052985+Tlny@users.noreply.github.com" ]
60052985+Tlny@users.noreply.github.com
ba1793d5e7102a1215177df47998b223224e8506
10e64f8dca0b596b339169f80c8706edb51eed9f
/linux-devkit/sysroots/armv7ahf-neon-linux-gnueabi/usr/share/ti/ti-linalg-tree/packages/ti/linalg/blasblisacc/src/ti_cblas_cblas_dtpsv.c
0f2abb2e7f723e627b595d699a805b3e9c0bb816
[]
no_license
wangy2000/LeezBoard_TI5708
264cea03d04402cf14714e35f1ca9efd4a1ef7cb
1c0e92c5b61de16f8d8aeb86852c9d53ed99ac58
refs/heads/master
2020-06-16T22:01:26.340391
2019-04-23T13:21:54
2019-04-23T13:21:54
null
0
0
null
null
null
null
UTF-8
C
false
false
5,977
c
/****************************************************************************** * Copyright (c) 2013-2015, Texas Instruments Incorporated - http://www.ti.com/ * 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 Texas Instruments Incorporated 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 OR 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. *****************************************************************************/ #include "ti_cblas_acc.h" #include "../../ticblas/ticblas.h" #ifdef __cplusplus extern "C" { #endif void __real_cblas_dtpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int N, const double *Ap, double *X, const int incX) ; #ifdef __cplusplus } extern "C" #endif void cblas_dtpsv(const enum CBLAS_ORDER order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int N, const double *Ap, double *X, const int incX) { /* Do an init on first use */ if (!ti_cblas_init_done) ti_cblas_init(); TI_CBLAS_DEBUG_PRINT("Intercepted call to %s\n", "cblas_dtpsv"); TI_CBLAS_PROFILE_START(); /* Dynamic condtional offload to ARM */ if ((TI_CBLAS_L2_OFFLOAD == TI_CBLAS_OFFLOAD_NONE)) { TI_CBLAS_DEBUG_PRINT("Executing ARM %s\n", "cblas_dtpsv"); __real_cblas_dtpsv(order,Uplo,TransA,Diag,N,Ap,X,incX); TI_CBLAS_PROFILE_REPORT(" Entire %s call (ARM) took %8.2f us\n","cblas_dtpsv", (float) clock_diff); return ; } /* End ARM offload */ /******************************************************************/ /* DSP offload WILL be done if control reaches here */ TI_CBLAS_DEBUG_PRINT("Offloading to DSP %s\n", "cblas_dtpsv"); /* Lookup kernel pointer from global table */ #ifdef __cplusplus Event e; Kernel* __K; #else cl_kernel __K; #endif __K = ti_cblas_get_kernel("ocl_cblas_dtpsv"); #ifdef __cplusplus try #else cl_int err = CL_SUCCESS; #endif { #ifdef __cplusplus __K->setArg(0, order); #else err |= clSetKernelArg(__K, 0, sizeof(order), &order); #endif #ifdef __cplusplus __K->setArg(1, Uplo); #else err |= clSetKernelArg(__K, 1, sizeof(Uplo), &Uplo); #endif #ifdef __cplusplus __K->setArg(2, TransA); #else err |= clSetKernelArg(__K, 2, sizeof(TransA), &TransA); #endif #ifdef __cplusplus __K->setArg(3, Diag); #else err |= clSetKernelArg(__K, 3, sizeof(Diag), &Diag); #endif #ifdef __cplusplus __K->setArg(4, N); #else err |= clSetKernelArg(__K, 4, sizeof(N), &N); #endif /* For const arguments we use CL_MEM_USE_READ_ONLY */ int size_bufAp; size_bufAp = N*(N+1)/2*sizeof(double); size_bufAp = MAX(size_bufAp,1); #ifdef __cplusplus Buffer buf_Ap(*ti_cblas_ocl_context, CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR, size_bufAp, (void *)Ap); __K->setArg(5, buf_Ap); #else cl_mem buf_Ap = clCreateBuffer(ti_cblas_ocl_context, CL_MEM_READ_ONLY|CL_MEM_USE_HOST_PTR, size_bufAp, (void *)Ap, &err); TI_CBLAS_OCL_CHKERROR("clCreateBuffer",err); err |= clSetKernelArg(__K, 5, sizeof(buf_Ap), &buf_Ap); TI_CBLAS_OCL_CHKERROR("clSetKernelArg",err); #endif int size_bufX; size_bufX = (1+(N-1)*abs(incX))*sizeof(double); size_bufX = MAX(size_bufX,1); #ifdef __cplusplus Buffer buf_X(*ti_cblas_ocl_context, CL_MEM_READ_WRITE|CL_MEM_USE_HOST_PTR, size_bufX, (void *)X); __K->setArg(6, buf_X); #else cl_mem buf_X = clCreateBuffer(ti_cblas_ocl_context, CL_MEM_READ_WRITE|CL_MEM_USE_HOST_PTR, size_bufX, (void *)X, &err); TI_CBLAS_OCL_CHKERROR("clCreateBuffer",err); err |= clSetKernelArg(__K, 6, sizeof(buf_X), &buf_X); TI_CBLAS_OCL_CHKERROR("clSetKernelArg",err); #endif #ifdef __cplusplus __K->setArg(7, incX); #else err |= clSetKernelArg(__K, 7, sizeof(incX), &incX); #endif #ifdef __cplusplus ti_cblas_ocl_Q->enqueueTask(*__K, 0, &e); e.wait(); #else cl_event e; err |= clEnqueueTask(ti_cblas_ocl_Q, __K, 0, 0, &e); TI_CBLAS_OCL_CHKERROR("clEnqueueTask",err); err |= clWaitForEvents(1, &e); TI_CBLAS_OCL_CHKERROR("clWaitForEvents",err); err |= clReleaseEvent(e); TI_CBLAS_OCL_CHKERROR("clReleaseEvent",err); #endif ti_cblas_delete_kernel(__K); TI_CBLAS_DEBUG_PRINT("Finished executing %s\n", "cblas_dtpsv"); TI_CBLAS_PROFILE_REPORT(" Entire %s call (DSP) took %8.2f us\n","cblas_dtpsv", (float) clock_diff); return ; } #ifdef __cplusplus catch (Error err) { /* delete __K if it has not been deleted */ if(__K!=NULL) { ti_cblas_delete_kernel(__K); } ti_cblas_error(err.what(),err.err()); return ; } #endif }
[ "82796620@qq.com" ]
82796620@qq.com
849a89481016a5fdd4a8e17835c4a7a99a565f6d
6dc16ea694c442f68b6b403fe07cf8f2a2638a5c
/Zigbee/cc2430/app/exploder/src/med_Main.c
a0ab512b11ab73eff078b9434651d502ef97a2bb
[]
no_license
hezfproject/TofCode
6ac411c36e7c51753a9ba8f7745176eebdfe26b8
617f4038f38bc3a3093e1d17bb4310ff9e47673a
refs/heads/master
2020-04-26T03:13:44.490606
2019-03-01T08:27:55
2019-03-01T08:27:55
173,260,210
0
4
null
null
null
null
UTF-8
C
false
false
3,812
c
/************************************************************************************************** Filename: med_Main.c Revised: $Date: 2012/02/09 20:52:56 $ Revision: $Revision: 1.1.4.3 $ Description: This file contains the main and callback functions **************************************************************************************************/ /************************************************************************************************** * Includes **************************************************************************************************/ /* Hal Drivers */ #include "hal_types.h" #include "hal_key.h" #include "hal_timer.h" #include "hal_drivers.h" /* MAC Application Interface */ #include "mac_api.h" /* Application */ #include "med.h" /* OSAL */ #include "OSAL.h" #include "OSAL_Tasks.h" #include "OSAL_Nv.h" #include "OnBoard.h" #include "OSAL_PwrMgr.h" /************************************************************************************************** * FUNCTIONS **************************************************************************************************/ /* This callback is triggered when the timer finish its tick */ void MED_Main_TimerCallBack(uint8 timerId, uint8 channel, uint8 channelMode); /* This callback is triggered when a key is pressed */ void MED_Main_KeyCallback(uint8 keys, uint8 state); /************************************************************************************************** * @fn main * * @brief Start of application. * * @param none * * @return none ************************************************************************************************** */ int main(void) { /* Initialize hardware */ HAL_BOARD_INIT(); /* Initialze the HAL driver */ HalDriverInit(); /* Initialize MAC */ MAC_Init(); /* initialize NV */ osal_nv_init( NULL ); /* Initialize the operating system */ osal_init_system(); /* Enable interrupts */ HAL_ENABLE_INTERRUPTS(); /* Start OSAL */ osal_start_system(); // No Return from here } /************************************************************************************************** CALL-BACKS **************************************************************************************************/ /************************************************************************************************** * @fn MED_KeyCallback * * @brief Callback service for keys * * @param keys - keys that were pressed * state - shifted * * @return void **************************************************************************************************/ void MED_Main_KeyCallback(uint8 keys, uint8 state) { if ( MED_TaskId != TASK_NO_TASK ) { // MED_HandleKeys (keys, state); } } /************************************************************************************************** * * @fn MED_PowerMgr * * @brief Enable/Disable and setup power saving related stuff * * @param mode - PWRMGR_ALWAYS_ON or PWRMGR_BATTERY * * @return void * **************************************************************************************************/ void MED_PowerMgr(uint8 enable) { /* enable OSAL power management */ if (enable) osal_pwrmgr_device(PWRMGR_BATTERY); else osal_pwrmgr_device(PWRMGR_ALWAYS_ON); } /************************************************************************************************* **************************************************************************************************/
[ "981715113@qq.com" ]
981715113@qq.com
384866ed671d8358840e70aaf459090a92cfbf40
30126e04e0886ed61a917905dfb9deb330a6e03a
/virtual/srcs/decrement_values.c
c9b6172a15a1fa029c2dfe63d2a82f9379ea3fee
[]
no_license
eldaroid/Corewar
aa2cbddd840c67838cc003bc67cf659b5088a4bb
2f73b64ad51bd07e1c602c29b1007f6935de9f50
refs/heads/master
2023-02-26T02:35:36.070051
2021-02-03T18:09:09
2021-02-03T18:09:09
317,636,484
0
0
null
null
null
null
UTF-8
C
false
false
1,151
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* decrement_values.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: gdorcas <gdorcas@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/12/01 15:18:46 by gdorcas #+# #+# */ /* Updated: 2020/12/01 18:04:32 by gdorcas ### ########.fr */ /* */ /* ************************************************************************** */ #include "vm.h" void dec_values(t_vm *vm) { size_t i; t_fieldelem *elems; elems = vm->field; i = -1; while (++i < sizeof(vm->field) / sizeof(vm->field[0])) { if (elems[i].fresh) elems[i].fresh--; if (elems[i].live) elems[i].live--; } }
[ "fgracefo@il-k1.msk.21-school.ru" ]
fgracefo@il-k1.msk.21-school.ru
f685db735bf30fda8e88a41786a72553d32ce600
25673e50c8bbc5582b9ddead25f5a733915d63fd
/SUSYBSMAnalysis/HSCP/test/UsefulScripts/StabilityCheck/allRunsLanGausLastVersionWithStrip/Run2012C_198488_198919/pictures/HSCPHLTTriggerHtDeDxFilter_Profile_ImS.C
286f30027d94bea385b270d64fabc3d5c481e360
[]
no_license
telenz/StabilityCode
9c8417647b4a755c3e55417ac10a95e04e00a366
00db6b9f2e4bbfc4a80d2f901cbb78f119cbc57d
refs/heads/master
2021-03-12T23:19:38.070585
2014-09-23T09:06:19
2014-09-23T09:06:19
null
0
0
null
null
null
null
UTF-8
C
false
false
2,834
c
{ //=========Macro generated from canvas: c1/c1 //========= (Thu Aug 21 17:35:54 2014) by ROOT version5.32/00 TCanvas *c1 = new TCanvas("c1", "c1",0,0,600,600); gStyle->SetOptFit(1); gStyle->SetOptTitle(0); c1->Range(0,0,1,1); c1->SetFillColor(0); c1->SetBorderMode(0); c1->SetBorderSize(2); c1->SetGridx(); c1->SetTickx(1); c1->SetTicky(1); c1->SetLeftMargin(0.07); c1->SetRightMargin(0.03); c1->SetTopMargin(0.06); c1->SetBottomMargin(0.15); c1->SetFrameFillStyle(0); c1->SetFrameBorderMode(0); TProfile *HSCPHLTTriggerHtDeDxFilterdEdxMSProf = new TProfile("HSCPHLTTriggerHtDeDxFilterdEdxMSProf","",1,0,1,""); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetBinEntries(1,7); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetBinContent(1,23.44287); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetBinError(1,8.868049); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetEntries(7); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetStats(0); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetFillColor(1); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetLineStyle(0); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetMarkerStyle(20); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->SetMarkerSize(0.4); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetXaxis()->SetBinLabel(1,"198522"); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetXaxis()->SetBit(TAxis::kLabelsVert); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetXaxis()->SetNdivisions(505); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetXaxis()->SetLabelFont(42); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetXaxis()->SetLabelOffset(0.007); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetXaxis()->SetTitleOffset(1.1); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetXaxis()->SetTitleFont(42); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetYaxis()->SetTitle("dE/dx estimator"); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetYaxis()->SetLabelFont(42); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetYaxis()->SetLabelOffset(0.007); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetYaxis()->SetLabelSize(0.05); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetYaxis()->SetTitleOffset(0.9); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetYaxis()->SetTitleFont(42); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetZaxis()->SetLabelFont(42); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetZaxis()->SetLabelOffset(0.007); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetZaxis()->SetLabelSize(0.05); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->GetZaxis()->SetTitleFont(42); HSCPHLTTriggerHtDeDxFilterdEdxMSProf->Draw("E1"); TPaveText *pt = new TPaveText(5.882876e-316,4.678664e-316,4.678545e-316,5.882877e-316,"brNDC"); pt->SetFillColor(0); pt->SetTextAlign(12); pt->SetTextFont(43); pt->SetTextSize(21); TText *text = pt->AddText("f"); pt->Draw(); c1->Modified(); c1->cd(); c1->SetSelected(c1); }
[ "teresa.lenz@desy.de" ]
teresa.lenz@desy.de
eb7f96552a5a4f002d7dfb676fcb18d07f182baa
e6c80d747be1496b9c0ebcc8a8bc33bd64eb17dd
/Codes/C Programs/Arrays/C Program to Find the Summation of Node values at Row or Level.c
226fe7cf0123f903b9f3fce326c270ac57b14a10
[]
no_license
developersbk/Universal_Code_Snippets
56b25fb43cc2c67113e97e691cc48f8a0b0193f6
0001535476a5743c0557c5ce2c3ffc13c6ee8791
refs/heads/master
2023-02-24T08:16:57.240264
2020-02-29T01:21:46
2020-02-29T01:21:46
null
0
0
null
null
null
null
UTF-8
C
false
false
4,571
c
/* * C Program to Find the Summation of Node values at level/row and print it */ #include <stdio.h> #include <stdlib.h> struct btnode { int value; struct btnode *r,*l; }*root = NULL, *temp = NULL; void create(); void insert(); void add(struct btnode *t); void computesum(struct btnode *t); void display(); int count = 0, sum[100] = {0}, max = 0; void main() { int ch; printf("\n OPERATIONS ---"); printf("\n 1] Insert an element into tree"); printf("\n 2] Display the sum of the elements at the same level"); printf("\n 3] Exit "); while (1) { printf("\nEnter your choice : "); scanf("%d", &ch); switch (ch) { case 1: insert(); break; case 2: count = 0; max = 0; computesum(root); display(); break; case 3: exit(0); default : printf("Wrong choice, Please enter correct choice "); break; } } } /* To create a new node with the data from the user */ void create() { int data; printf("Enter the data of node : "); scanf("%d", &data); temp = (struct btnode* ) malloc(1*(sizeof(struct btnode))); temp->value = data; temp->l = temp->r = NULL; } /* To check for root node and then create it */ void insert() { create(); if (root == NULL) root = temp; else add(root); } /* Search for the appropriate position to insert the new node */ void add(struct btnode *t) { if ((temp->value > t->value) && (t->r != NULL)) /* value more than root node value insert at right */ add(t->r); else if ((temp->value > t->value) && (t->r == NULL)) t->r = temp; else if ((temp->value < t->value) && (t->l != NULL)) /* value less than root node value insert at left */ add(t->l); else if ((temp->value < t->value) && (t->l==NULL)) t->l = temp; } /* Function to find the sum of nodes at same distance */ void computesum(struct btnode *t) { if (root == NULL) { printf("Tree is empty "); return; } if (t->l != NULL) { count++; computesum(t->l); } sum[count] = sum[count] + t->value; /* addition of elelment by row wise */ if (max < count) max = count; if (t->r != NULL) { count++; computesum(t->r); } count--; } /* To display the sum of the nodes at the same distance */ void display() { int i; printf("Sum of nodes : \n Level \t Sum "); for (i = 0; i <= max; i++) printf("\n %d \t: %d ", i, sum[i]); } /* OPERATIONS --- 1] Insert an element into tree 2] Display the sum of the elements at the same level 3] Exit Enter your choice : 1 Enter the data of node : 40 Enter your choice : 1 Enter the data of node : 20 Enter your choice : 1 Enter the data of node : 60 Enter your choice : 1 Enter the data of node : 10 Enter your choice : 1 Enter the data of node : 30 Enter your choice : 1 Enter the data of node : 80 Enter your choice : 1 Enter the data of node : 90 Enter your choice : 2 Sum of nodes : Level Sum 0 : 40 1 : 80 2 : 120 3 : 90 Enter your choice : 3 40 /\ / \ 20 60 / \ \ 10 30 80 \ 90 $ ./a.out OPERATIONS --- 1] Insert an element into tree 2] Display the sum of the elements at the same level 3] Exit Enter your choice : 1 Enter the data of node : 50 Enter your choice : 1 Enter the data of node : 30 Enter your choice : 1 Enter the data of node : 20 Enter your choice : 1 Enter the data of node : 40 Enter your choice : 1 Enter the data of node : 35 Enter your choice : 1 Enter the data of node : 100 Enter your choice : 1 Enter the data of node : 70 Enter your choice : 1 Enter the data of node : 120 Enter your choice : 1 Enter the data of node : 140 Enter your choice : 2 Sum of nodes : Level Sum 0 : 50 1 : 130 2 : 250 3 : 175 Enter your choice : 3 50 /\ / \ 30 100 / \ / \ 20 40 70 120 / \ 35 140
[ "sbkannath1996@gmail.com" ]
sbkannath1996@gmail.com
9ee281f3bc03ef44f0fa6bc28c1598b574b7f22e
4a923e6d1e08736f57c525685289a890e78a4bb7
/include/tk/sysdepend/asm_common.h
0879220f49f050fea92e993207f5fc5bb55da4d4
[]
no_license
jg1uaa/uT-Kernel-16bit-experiment
25cbadb828bfd6af141da519a5d42edbdca65a44
ab57b989ceb1a460233ba4808aa6001d3f437057
refs/heads/master
2021-01-01T18:07:13.849294
2012-08-13T14:24:55
2012-08-13T14:24:55
5,386,498
1
0
null
null
null
null
UTF-8
C
false
false
702
h
/* *---------------------------------------------------------------------- * micro T-Kernel * * Copyright (C) 2006-2011 by Ken Sakamura. All rights reserved. * micro T-Kernel is distributed under the T-License 2.0. *---------------------------------------------------------------------- * * Version: 1.01.01 * Released by T-Engine Forum(http://www.t-engine.org) at 2011/12/12. * *---------------------------------------------------------------------- */ /* * @(#)asm_common.h (tk) * * Assembler Macro */ #ifndef __TK_ASM_COMMON_H__ #define __TK_ASM_COMMON_H__ #if APP_H83664 # include <tk/sysdepend/app_h83664/asm_depend.h> #endif #endif /* __TK_ASM_COMMON_H__ */
[ "uaa@uaa.org.uk" ]
uaa@uaa.org.uk
ae5cdbda8472f2ddb4cf1447b8f5ef7f894d7387
52f086fefba24f16d596a26c7b3daf678469ac55
/0x0B-malloc_free/3-alloc_grid.c
15e92fe6018ec6582ceec35eb9948bfee75b13d3
[]
no_license
Mass-V/alx-low_level_programming
064bf4f5680c7e26c1a9962d7327ee1805586353
e4ad9df6eafdc3d01a0f0998db1070357b73bfea
refs/heads/master
2023-08-21T20:29:21.297806
2021-10-25T12:04:11
2021-10-25T12:04:11
400,023,134
0
0
null
null
null
null
UTF-8
C
false
false
665
c
#include "main.h" #include <stdio.h> #include <stdlib.h> /** * alloc_grid - returns a pointer to a 2 dimensional array of integers * @width: width input * @height: height input * Return: pointer to 2 dim. array */ int **alloc_grid(int width, int height) { int **array; int n, x; if (width <= 0 || height <= 0) return (NULL); array = malloc(sizeof(int) * height); if (array == NULL) { free(array); return (NULL); } for (n = 0; n < height; n++) { array[n] = malloc(sizeof(int) * width); if (array == NULL) { free(array); return (NULL); } for (x = 0; x < width; x++) { array[n][x] = 0; } } return (array); }
[ "84704932+Mass-V@users.noreply.github.com" ]
84704932+Mass-V@users.noreply.github.com
d38f3ea9add1a723db67b4fe26babe8c7df95cfd
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
/source/linux/fs/ceph/extr_super.h___ceph_dir_clear_ordered.c
6dd964317c629c4091d71b309895a6030a873662
[]
no_license
isabella232/AnghaBench
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
9a5f60cdc907a0475090eef45e5be43392c25132
refs/heads/master
2023-04-20T09:05:33.024569
2021-05-07T18:36:26
2021-05-07T18:36:26
null
0
0
null
null
null
null
UTF-8
C
false
false
650
c
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct ceph_inode_info {int /*<<< orphan*/ i_ordered_count; } ; /* Variables and functions */ int /*<<< orphan*/ atomic64_inc (int /*<<< orphan*/ *) ; __attribute__((used)) static inline void __ceph_dir_clear_ordered(struct ceph_inode_info *ci) { atomic64_inc(&ci->i_ordered_count); }
[ "brenocfg@gmail.com" ]
brenocfg@gmail.com
2dec64f6f45601e2ba8b006872a42f528682adef
d0802ecde768592816f9032c1dc9cb45fd7374ae
/libft/ft_putstr.c
2a71a1d589a27dfd2bf61be2f18c9c92f16b6b31
[]
no_license
K1L3UR/Get_Next_Line
37dcd6127e08891592412864b07cfa02d96bd92e
193b2f560204bf06e02ddfbf7aed3d4a70a4f5e0
refs/heads/master
2020-03-15T09:46:00.151431
2018-05-04T03:46:01
2018-05-04T03:46:01
132,082,912
0
0
null
null
null
null
UTF-8
C
false
false
983
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_putstr.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: ardurand <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/15 16:00:26 by ardurand #+# #+# */ /* Updated: 2016/12/15 16:05:16 by ardurand ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" void ft_putstr(char const *s) { if (s) write(1, s, ft_strlen(s)); }
[ "ardurand@e2r10p11.42.fr" ]
ardurand@e2r10p11.42.fr
088c829f572135a2445548fef25620d5aeea04e0
7b1d05ddd3c6465daaa918b063c421be5cbd9b35
/libft/src/ft_strsplit.c
106e65f8fa8006870a95b2d65ab0259db45d5c52
[]
no_license
chabaud/fra
d03243c7481ed05a5d2a650fe018258a32a99c2d
5b247c927d2f561d2611fce5e18cbab740d87da0
refs/heads/master
2021-08-08T05:28:23.352807
2017-11-09T17:21:18
2017-11-09T17:21:18
110,144,943
0
0
null
null
null
null
UTF-8
C
false
false
1,775
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strsplit.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: schabaud <schabaud@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2100/01/01 00:00:00 by schabaud #+# #+# */ /* Updated: 2016/08/19 15:54:55 by schabaud ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" static int ft_nb_of_words(char const *s, char c) { int i; i = 0; while (*s) { while (*s && *s == c) s++; if (*s && *s != c) { i += 1; while (*s && *s != c) s++; } } return (i); } static char *ft_dup_word(char const *s, char c) { char *word; int len; int i; len = 0; while (s[len] && s[len] != c) len++; word = (char *)malloc(sizeof(char) * len + 1); i = -1; while (++i < len) word[i] = s[i]; word[i] = '\0'; return (word); } char **ft_strsplit(char const *s, char c) { char **tab; int nb_of_w; int i; nb_of_w = ft_nb_of_words(s, c); if (!s || !(tab = (char **)malloc(sizeof(char *) * nb_of_w + 1))) return (NULL); i = -1; while (*s) { while (*s && *s == c) s++; if (*s && *s != c) tab[++i] = ft_dup_word(s, c); while (*s && *s != c) s++; } tab[++i] = NULL; return (tab); }
[ "schabaud@e1r4p9.42.fr" ]
schabaud@e1r4p9.42.fr
b0dcd0df3a8b231c9fedd954a69b00c747a2e34c
ac8e27210d8ae1c79e7d0d9db1bcf4e31c737718
/tools/flang/runtime/flangrti/x86_64-Linux/x86_daz.c
656d8057094e20d786dc7c3fb026db92c5a77aa9
[ "Apache-2.0", "NCSA", "LLVM-exception" ]
permissive
steleman/flang9
d583d619bfb67d27a995274e30c8c1a642696ec1
4ad7c213b30422e1e0fcb3ac826640d576977d04
refs/heads/master
2020-11-27T09:50:18.644313
2020-03-07T14:37:32
2020-03-07T14:37:32
229,387,867
0
0
Apache-2.0
2019-12-21T06:35:35
2019-12-21T06:35:34
null
UTF-8
C
false
false
1,010
c
/* * Copyright (c) 2017, NVIDIA CORPORATION. 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. * */ /* -Mdaz run-time support. * For fortran and C main programs, the compiler will add the address of * the support routine to ctors */ void __daz(void) { #ifdef TARGET_LINUX_X8664 __asm__("pushq %rax"); __asm__("stmxcsr (%rsp)"); __asm__("popq %rax"); __asm__("orq $64, %rax"); __asm__("pushq %rax"); __asm__("ldmxcsr (%rsp)"); __asm__("popq %rax"); #endif }
[ "stefan.teleman@cavium.com" ]
stefan.teleman@cavium.com
5bf7305a26d30eb343070a78b6ce10b66bd79487
1564c5b7255ac64cdb930ae41810d358f8255953
/d/jingzhou/afang.c
1f46aa6890f64cf8836e77881f6188108b34c69e
[]
no_license
klajie/mud
9f531cc845389ed1d4beea8ea5c1146af086dd41
8d16bbc725a0d3fa53c71488f6c90e199b723a17
refs/heads/master
2020-03-19T04:19:28.506756
2018-06-02T12:30:23
2018-06-02T12:30:23
135,816,231
2
0
null
2018-06-02T12:34:54
2018-06-02T12:34:54
null
GB18030
C
false
false
1,792
c
#include <ansi.h>; inherit KNOWER; inherit F_DEALER; void create() { set_name("阿芳", ({ "afang", "fang" })); set("title", "茶僚老板"); //set("nickname", "荆州老姑娘"); set("nickname", HIC "消息灵通" NOR); set("shen_type", 1); set("str", 30); set("gender", "女性"); set("age", 20); set("long", "阿芳貌似鲜花,可不知道的原因,迟迟不嫁,惹得爷儿们心痒痒。\n"); set("combat_exp", 500); set("attitude", "friendly"); set("inquiry", ([ "结婚" : "结婚?你有几万两黄金??筹够了来找我吧。嘻嘻!\n", "生意" : "这个么……。还将就。\n", ])); set("vendor_goods", ({ __DIR__"obj/peanut", __DIR__"obj/tofu", })); setup(); carry_object("/clone/misc/cloth")->wear(); } void init() { object ob; ::init(); if (interactive(ob = this_player()) && ! is_fighting()) { remove_call_out("greeting"); call_out("greeting", 1, ob); } add_action("do_list", "list"); add_action("do_buy", "buy"); } void greeting(object ob) { if ( ! ob || environment(ob) != environment()) return; switch(random(2)) { case 0 : say(CYN "阿芳笑眯眯地说道:这位" + RANK_D->query_respect(ob) + CYN + ",快请进来喝杯热茶。\n" NOR); break; case 1 : say(CYN "阿芳说道:哟!这位" + RANK_D->query_respect(ob) + CYN + "您来了啊!\n" NOR); break; } }
[ "i@oiuv.cn" ]
i@oiuv.cn
0ade430c4b588185e2e148eab17d98840d7a3bda
a0367d26bf357725ab97c36c930ecb2ae3521355
/brain-algorithm/Graph/MST.h
479e9a77f25f54395c579f3275727aec937a4253
[]
no_license
fidemin/algorithm-study
c511a59cb8f3bd227922d87465b2d8a529a1f7a8
41277da10c1ec966a20664b961f8e75434ac517f
refs/heads/main
2022-06-13T00:43:54.223348
2022-06-02T16:37:40
2022-06-02T16:37:40
163,795,704
0
0
null
null
null
null
UTF-8
C
false
false
320
h
#ifndef MST_H #define MST_H #include <stdio.h> #include <stdlib.h> #include "ALGraph.h" #include "PriorityQueue.h" #include "DisjointSet.h" void mst_prim(alg_graph_t* graph, alg_vertex_t* start_v, alg_graph_t* mst_graph); void mst_kruskal(alg_graph_t* graph, alg_vertex_t* start_v, alg_graph_t* mst_graph); #endif
[ "yhmin84@gmail.com" ]
yhmin84@gmail.com
2b098e5fcb859938443b5a959281af3e72fd77c6
a280aa9ac69d3834dc00219e9a4ba07996dfb4dd
/regularexpress/home/weilaidb/work/kernel/linux-3.0.8/arch/powerpc/kvm/book3s_64_mmu.c
cb26f310e7fbcd8fb274e409fb9d1ec8f6de1da9
[]
no_license
weilaidb/PythonExample
b2cc6c514816a0e1bfb7c0cbd5045cf87bd28466
798bf1bdfdf7594f528788c4df02f79f0f7827ce
refs/heads/master
2021-01-12T13:56:19.346041
2017-07-22T16:30:33
2017-07-22T16:30:33
68,925,741
4
2
null
null
null
null
UTF-8
C
false
false
1,558
c
#define dprintk(X...) printk(KERN_INFO X) #define dprintk(X...) do while(0) static void kvmppc_mmu_book3s_64_reset_msr(struct kvm_vcpu *vcpu) static struct kvmppc_slb *kvmppc_mmu_book3s_64_find_slbe( struct kvmppc_vcpu_book3s *vcpu_book3s, gva_t eaddr) static u64 kvmppc_mmu_book3s_64_ea_to_vp(struct kvm_vcpu *vcpu, gva_t eaddr, bool data) static int kvmppc_mmu_book3s_64_get_pagesize(struct kvmppc_slb *slbe) static u32 kvmppc_mmu_book3s_64_get_page(struct kvmppc_slb *slbe, gva_t eaddr) static hva_t kvmppc_mmu_book3s_64_get_pteg( struct kvmppc_vcpu_book3s *vcpu_book3s, struct kvmppc_slb *slbe, gva_t eaddr, bool second) static u64 kvmppc_mmu_book3s_64_get_avpn(struct kvmppc_slb *slbe, gva_t eaddr) static int kvmppc_mmu_book3s_64_xlate(struct kvm_vcpu *vcpu, gva_t eaddr, struct kvmppc_pte *gpte, bool data) static void kvmppc_mmu_book3s_64_slbmte(struct kvm_vcpu *vcpu, u64 rs, u64 rb) static u64 kvmppc_mmu_book3s_64_slbmfee(struct kvm_vcpu *vcpu, u64 slb_nr) static u64 kvmppc_mmu_book3s_64_slbmfev(struct kvm_vcpu *vcpu, u64 slb_nr) static void kvmppc_mmu_book3s_64_slbie(struct kvm_vcpu *vcpu, u64 ea) static void kvmppc_mmu_book3s_64_slbia(struct kvm_vcpu *vcpu) static void kvmppc_mmu_book3s_64_mtsrin(struct kvm_vcpu *vcpu, u32 srnum, ulong value) static void kvmppc_mmu_book3s_64_tlbie(struct kvm_vcpu *vcpu, ulong va, bool large) static int kvmppc_mmu_book3s_64_esid_to_vsid(struct kvm_vcpu *vcpu, ulong esid, u64 *vsid) static bool kvmppc_mmu_book3s_64_is_dcbz32(struct kvm_vcpu *vcpu) void kvmppc_mmu_book3s_64_init(struct kvm_vcpu *vcpu)
[ "weilaidb@localhost.localdomain" ]
weilaidb@localhost.localdomain
dd545babc7b2d20018c219b43ea4b891511239ab
4b252b270ac1e17fe819341efa784febfe9810dd
/HelloWorld_Module/src/HelloWorld_Module.c
2528f3a167b8020da8321e2ded712d718a2ebc53
[ "MIT" ]
permissive
pghalliday/OOOCode-HelloWorld-Module
c8007c4a41d4dbff70ee63e38dbf6ca943add6e4
60d55947c43cc1788ca3cf6eb88c9b2d7bc8bd89
refs/heads/master
2016-09-06T03:17:40.886775
2012-11-05T19:39:17
2012-11-05T19:39:17
null
0
0
null
null
null
null
UTF-8
C
false
false
379
c
#include "OOOModule.h" #include "HelloWorld.h" static OOOModule * pModule = NULL; OOOModule * init(void) GCCO_SAFE_DS; OOOModule * init(void) { if (!pModule) { pModule = OOOConstruct(OOOModule); OOOModuleExport(pModule, HelloWorld); } return pModule; } void uninit(void) GCCO_SAFE_DS; void uninit(void) { if (pModule) { OOODestroy(pModule); pModule = NULL; } }
[ "pghalliday@gmail.com" ]
pghalliday@gmail.com
fecc430a00e68f859604d691ced3ae38b0ff072c
fdc5b324e581ca09370cc2aedfb2f72c3a3a2a6f
/seed_for_retdec/82_new.c
55d734202c556ae9698c554d29ebbbe3b2a163f0
[]
no_license
hz90937880/NewDecFuzzer
12981d53dd64e9a4ef881d4879b7abb3050ff849
aa946ff1ad89742093a89a4703af238734546d9f
refs/heads/main
2023-04-15T18:04:11.235871
2021-04-25T15:45:45
2021-04-25T15:45:45
351,564,252
0
0
null
null
null
null
UTF-8
C
false
false
3,389
c
/* * This is a RANDOMLY GENERATED PROGRAM. * * Generator: csmith 2.3.0 * Git version: unknown * Options: --no-arrays --no-structs --no-unions --no-safe-math --no-pointers --no-longlong --max-funcs 1 --max-expr-complexity 5 --output ./tmp/src_code/csmith_test_1354.c * Seed: 551903738 */ #define NO_LONGLONG #include "csmith.h" static long __undefined; /* --- Struct/Union Declarations --- */ /* --- GLOBAL VARIABLES --- */ static volatile uint8_t g_5 = 0x9F;/* VOLATILE GLOBAL g_5 */ static int8_t g_22 = 7; static uint8_t g_23 = 6U; static int32_t g_24 = (-1); static int8_t g_47 = (-1); static uint32_t g_49 = 0xF9F11119; /* --- FORWARD DECLARATIONS --- */ static int16_t func_1(void); static int set_var(uint8_t g_5_l, int8_t g_22_l, uint8_t g_23_l, int32_t g_24_l, int8_t g_47_l, uint32_t g_49_l){ g_5 = g_5_l;g_22 = g_22_l;g_23 = g_23_l;g_24 = g_24_l;g_47 = g_47_l;g_49 = g_49_l; return 0; } /* --- FUNCTIONS --- */ /* ------------------------------------------ */ /* * reads : g_5 g_22 g_24 g_23 g_49 g_47 * writes: g_5 g_23 g_24 g_47 g_49 g_22 */ static int16_t func_1(void) { // 0x804969c int32_t v1; // 0x804969c set_var(158, 1, 1, 0, -1, -0x60eeee7); return -1; } /* ---------------------------------------- */ int main (int argc, char* argv[]) { int print_hash_value = 0; if (argc == 2 && strcmp(argv[1], "1") == 0) print_hash_value = 1; platform_main_begin(); crc32_gentab(); func_1(); transparent_crc(g_5, "g_5", print_hash_value); transparent_crc(g_22, "g_22", print_hash_value); transparent_crc(g_23, "g_23", print_hash_value); transparent_crc(g_24, "g_24", print_hash_value); transparent_crc(g_47, "g_47", print_hash_value); transparent_crc(g_49, "g_49", print_hash_value); platform_main_end(crc32_context ^ 0xFFFFFFFFUL, print_hash_value); return 0; } /************************ statistics ************************* XXX max struct depth: 0 breakdown: depth: 0, occurrence: 14 XXX total union variables: 0 XXX non-zero bitfields defined in structs: 0 XXX zero bitfields defined in structs: 0 XXX const bitfields defined in structs: 0 XXX volatile bitfields defined in structs: 0 XXX structs with bitfields in the program: 0 breakdown: XXX full-bitfields structs in the program: 0 breakdown: XXX times a bitfields struct's address is taken: 0 XXX times a bitfields struct on LHS: 0 XXX times a bitfields struct on RHS: 0 XXX times a single bitfield on LHS: 0 XXX times a single bitfield on RHS: 0 XXX max expression depth: 38 breakdown: depth: 1, occurrence: 12 depth: 2, occurrence: 2 depth: 14, occurrence: 1 depth: 18, occurrence: 1 depth: 38, occurrence: 1 XXX total number of pointers: 0 XXX times a non-volatile is read: 41 XXX times a non-volatile is write: 13 XXX times a volatile is read: 5 XXX times read thru a pointer: 0 XXX times a volatile is write: 1 XXX times written thru a pointer: 0 XXX times a volatile is available for access: 17 XXX percentage of non-volatile access: 90 XXX forward jumps: 0 XXX backward jumps: 0 XXX stmts: 12 XXX max block depth: 2 breakdown: depth: 0, occurrence: 4 depth: 1, occurrence: 3 depth: 2, occurrence: 5 XXX percentage a fresh-made variable is used: 23.3 XXX percentage an existing variable is used: 76.7 ********************* end of statistics **********************/
[ "1429408028@qq.com" ]
1429408028@qq.com
223c6abb1da808a24556f20ff91a5c42baed0c09
b1d500a451cd9852089bf3d97e829df069daa9c8
/Images/Data/RadialFieldScan_2/raw/cutsTesting/0MeV_6000MeV_27000ns/QuadChiSqrs.C
d48d5b8ff776bff18b90b97fe946372d8a7a649e
[]
no_license
sam-grant/EDM
486ea029bf766c968a3c7b41198ffcf9bc3c9b8a
525e41de5f675c39014488c79144f47562910736
refs/heads/master
2022-10-30T22:35:42.979799
2022-10-19T18:44:54
2022-10-19T18:44:54
296,421,806
0
1
null
null
null
null
UTF-8
C
false
false
2,546
c
void QuadChiSqrs() { //=========Macro generated from canvas: c/c //========= (Wed Apr 21 16:03:43 2021) by ROOT version 6.22/08 TCanvas *c = new TCanvas("c", "c",0,0,800,600); c->SetHighLightColor(2); c->Range(-75,-0.2240214,75,2.544841); c->SetFillColor(0); c->SetBorderMode(0); c->SetBorderSize(2); c->SetFrameBorderMode(0); c->SetFrameBorderMode(0); Double_t Graph0_fx1013[6] = { 50, 30, 10, -10, -30, -50}; Double_t Graph0_fy1013[6] = { 0.9542397, 0.5041771, 0.8953269, 2.067117, 0.4160892, 0.05873874}; Double_t Graph0_fex1013[6] = { 6.953123e-310, 6.95317e-310, 6.943462e-310, 1.913321e-314, 2.964394e-323, 2.195994e-314}; Double_t Graph0_fey1013[6] = { 6.953123e-310, 6.95317e-310, 6.943462e-310, 1.913321e-314, 2.964394e-323, 2.195994e-314}; TGraphErrors *gre = new TGraphErrors(6,Graph0_fx1013,Graph0_fy1013,Graph0_fex1013,Graph0_fey1013); gre->SetName("Graph0"); gre->SetTitle(";#LTB_{r}^{App}#GT [ppm];#chi^{2}/ndf"); gre->SetFillColor(1); gre->SetFillStyle(1000); TH1F *Graph_Graph01013 = new TH1F("Graph_Graph01013","",100,-60,60); Graph_Graph01013->SetMinimum(0.05286486); Graph_Graph01013->SetMaximum(2.267955); Graph_Graph01013->SetDirectory(0); Graph_Graph01013->SetStats(0); Int_t ci; // for color index setting TColor *color; // for color definition with alpha ci = TColor::GetColor("#000099"); Graph_Graph01013->SetLineColor(ci); Graph_Graph01013->GetXaxis()->SetTitle("#LTB_{r}^{App}#GT [ppm]"); Graph_Graph01013->GetXaxis()->CenterTitle(true); Graph_Graph01013->GetXaxis()->SetNdivisions(6); Graph_Graph01013->GetXaxis()->SetLabelFont(42); Graph_Graph01013->GetXaxis()->SetTitleSize(0.04); Graph_Graph01013->GetXaxis()->SetTitleOffset(1.1); Graph_Graph01013->GetXaxis()->SetTitleFont(42); Graph_Graph01013->GetYaxis()->SetTitle("#chi^{2}/ndf"); Graph_Graph01013->GetYaxis()->CenterTitle(true); Graph_Graph01013->GetYaxis()->SetNdivisions(4000510); Graph_Graph01013->GetYaxis()->SetLabelFont(42); Graph_Graph01013->GetYaxis()->SetTitleSize(0.04); Graph_Graph01013->GetYaxis()->SetTitleOffset(1.1); Graph_Graph01013->GetYaxis()->SetTitleFont(42); Graph_Graph01013->GetZaxis()->SetLabelFont(42); Graph_Graph01013->GetZaxis()->SetTitleOffset(1); Graph_Graph01013->GetZaxis()->SetTitleFont(42); gre->SetHistogram(Graph_Graph01013); gre->Draw("ab"); c->Modified(); c->cd(); c->SetSelected(c); }
[ "samuel.grant94@gmail.com" ]
samuel.grant94@gmail.com
8d27c8850422cc7dc36ee8f9eb54b0869e8da02c
343e5ad1332382014cd4f92ea5372291d9b42369
/src/nodehelper.c
c478f1b694eaf6fe87b5f87a9aba32de4945d685
[]
no_license
AndyIsMe/Convex-Hull
954713600266aa4b2461c376cedd9ea0d1b8e768
076c6eec12e2023bf9b83772f08e5ffb010e05c7
refs/heads/master
2021-09-03T10:25:25.017642
2018-01-08T11:09:06
2018-01-08T11:09:06
115,688,915
0
0
null
null
null
null
UTF-8
C
false
false
1,831
c
#include "nodehelper.h" extern Point pointPv12,pointPv15,pointTaruc,pointBlockD,pointGK,pointWangsa\ ,pointKajang,pointCheras,pointTamanMelawati,pointGombak,pointDangWangi\ ,pointAmpangPark,pointKLCC,pointMasjidJamek\ ,pointSriRampai ,pointSetiawangsa ,pointJelatek ,pointDK ,pointDamai ,pointKB ,pointPS ,pointKLS ,pointBangsar ,pointAH ,pointKerinchi ,pointUniversiti ,pointTJ ,pointAJ ,pointTP ,pointTB ,pointKJ; ; void initN(Point *points,int x,int y) { points->x = x; points->y = y; } void initNnode(void){ pointPv12.place = "PV12"; pointPv15.place = "PV15"; pointTaruc.place = "TARUC"; pointBlockD.place = "Block D"; pointGK.place = "Genting Klang"; pointWangsa.place = "Wangsa Maju"; pointKajang.place = "Kajang"; pointCheras.place = "Cheras"; pointTamanMelawati.place = "Taman Melawati"; pointGombak.place = "Gombak"; pointDangWangi.place = "Dang Wangi"; pointAmpangPark.place = "Ampang Park"; pointKLCC.place = "KLCC"; pointMasjidJamek.place = "Masjid Jamek"; pointSriRampai.place = "Sri Rampai"; pointSetiawangsa.place = "Setiawangsa"; pointJelatek.place = "Jelatek"; pointDK.place = "Dato Keramat"; pointDamai.place = "Damai"; pointKB.place = "Kampung Baru"; pointPS.place = "Pasar Seni"; pointKLS.place = "KL Sentral"; pointBangsar.place = "Bangsar"; pointAH.place = "Abdulllah Hukum"; pointKerinchi.place = "Kerinchi"; pointUniversiti.place = "Universiti"; pointTJ.place = "Taman Jaya"; pointAJ.place = "Asia Jaya"; pointTP.place = "Taman Paramount"; pointTB.place = "Taman Bahagia"; pointKJ.place = "Kelana Jaya"; }
[ "andyc.s.w@hotmail.co.uk" ]
andyc.s.w@hotmail.co.uk
a3eed921123676d4ebed792ef6eff5a75c156262
20fe2002c80b244f593ecf6da9760c53dbdd004c
/Source/smokeview/options.h
eaa7a12a4ad3b1ec7e1206c10d84cc1e72e27f2d
[ "NIST-Software" ]
permissive
cnz2/smv
d3ee9bba75b2eef8625a5fd9a454fe24b7d82e48
7951c0cd750cb782ce0f33389df4dc0bf9432cad
refs/heads/master
2021-01-10T23:48:32.077548
2016-10-05T12:52:47
2016-10-05T12:52:47
null
0
0
null
null
null
null
UTF-8
C
false
false
3,772
h
#ifndef OPTIONS_H_DEFINED #define OPTIONS_H_DEFINED // build Smokeview as a standard release unless the pp_BETA directive is defined #define pp_release //*** uncomment the following two lines to force all versions to be beta //#undef pp_BETA //#define pp_BETA //VVVVVVVVVVVVVVVVVVVVVVVVVVVVV define smokeview title VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV #ifdef pp_BETA #define PROGVERSION "Test" #undef pp_release #endif // comment the following line when building an unofficial release #define pp_OFFICIAL_RELEASE #ifdef pp_release #ifdef pp_OFFICIAL_RELEASE #define PROGVERSION "6.3.12" #else #define PROGVERSION "Unofficial release" #endif #endif //VVVVVVVVVVVVVVVVVVVVVVVVVVVVV turn on options available on all platforms VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV #define pp_GPU #define pp_ffmpeg #ifdef pp_GPU #define pp_CULL #define pp_GPUTHROTTLE #endif #ifdef VS2015 #define HAVE_SNPRINTF #define HAVE_STRUCT_TIMESPEC #endif #define pp_DRAWISO #define pp_LANG #define pp_DEG #define pp_SLICEDUP #define pp_SLICECOLORDEFER #define pp_THREAD #define pp_THREADIBLANK // test iblank computation in background. #ifdef pp_THREADIBLANK // if pp_THREADIBLANK is set then pp_THREAD also has to be set #define pp_THREAD #endif #define _CRT_SECURE_NO_DEPRECATE //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //VVVVVVVVVVVVVVVVVVVVVVVVVVVVV turn on options that are being tested VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV #ifdef pp_BETA #define pp_PILOT #define pp_SHOWTERRAIN //#define pp_WINDROSE 2d histogram, variation of pilot data #define pp_GEOMTEST #define pp_HAZARD //#define pp_GPUDEPTH #define pp_MEMPRINT #endif #define pp_RENDER360 #ifdef _DEBUG #define pp_RENDER360_DEBUG #endif // for debugging, set particle values to 100*parti->seq_id + small random number //#define pp_PARTTEST //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ #ifdef _DEBUG // comment the following line when debugging REALLY large cases (to avoid memory checks) #define pp_MEMDEBUG #endif //VVVVVVVVVVVVVVVVVVVVVVVVVVVVV turn on windows only options VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV #ifdef WIN32 #define pp_memstatus #define pp_COMPRESS #define pp_noappend //#define GLUT_DISABLE_ATEXIT_HACK #include "pragmas.h" #endif //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ //VVVVVVVVVVVVVVVVVVVVVVVVVVVVV used to access fortran routines from C VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV #ifndef _F #ifdef pp_noappend #define _F(name) name #else #define _F(name) name ## _ #endif #endif //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ // VVVVVVVVVVVVVVVVVVVVVVVVV set platform defines VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV #define FILE_SIZE unsigned long long #ifdef X64 #define STRUCTSTAT struct __stat64 #define STAT _stat64 #else #define STRUCTSTAT struct stat #define STAT stat #endif #define LINT long int #ifdef X64 #undef LINT #ifdef WIN32 #define LINT __int64 #else #define LINT long long int #endif #endif //*** turn off features on the Mac that don't work there #ifdef pp_OSX #undef pp_LANG #undef pp_DEG #endif // VVVVVVVVVVVVVVVVVVVVVVVVV set defines used by various headers VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV #ifdef CPP #define CCC "C" #else #define CCC #endif #ifdef INMAIN #define SVEXTERN #define SVDECL(var,val) var=val #else #define SVEXTERN extern CCC #define SVDECL(var,val) var #endif #ifdef CPP #define EXTERNCPP extern "C" #else #define EXTERNCPP #endif #ifdef pp_OSX #define GLUT_H <GLUT/glut.h> #else #define GLUT_H <GL/glut.h> #endif #include "lint.h" #endif
[ "gforney@gmail.com" ]
gforney@gmail.com
bc454e770b784e61abc0984fd5037cc8e0167272
eaae3529ea65c9be62e4b177a498dd0459396052
/modified_vars/Noble.Mushtak_Fresh_Chocolate.c
16c91915fd1ca2a2d1cf50d14fed430025cb9d21
[]
no_license
mgsanusi/blame-dodger
badac55079b0bc84c1c3ddff9357caffd480b512
c8b1f19d48e09200c9d59f3dda3b298ced7103d7
refs/heads/master
2021-01-20T04:50:14.975609
2018-01-12T00:02:14
2018-01-12T00:02:14
89,739,285
3
0
null
null
null
null
UTF-8
C
false
false
2,773
c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdbool.h> typedef long test_cases; typedef long num_people; typedef long num_groups; typedef long num_pieces; typedef long modulo; inline static long long min(long long length1, long long length2) { return length1 < length2 ? length1 : length2; } inline static long long max(long long length1, long long length2) { return length1 > length2 ? length1 : length2; } typedef long screenCase; typedef long numPeople; typedef long noGroup; typedef long noPieces; typedef long modulo; num_pieces packSize; num_groups numGroup; num_groups partitionLength[4]; num_groups result; num_people group[100]; int Main() { num_groups i; test_cases numScreenCase; test_cases size; modulo storeModulo; scanf("%li", &numScreenCase); for (size = 0; size < numScreenCase; size++) { scanf("%li %li", &numGroup, &packSize); memset(partitionLength, 0, sizeof(partitionLength)); for (i = 0; i < numGroup; i++) { scanf("%li", group + i); storeModulo = group[i] % packSize; partitionLength[storeModulo]++; } for (result = 0; numGroup > 0; result++) { if (partitionLength[0] > 0) { partitionLength[0]--; numGroup--; } else if ((partitionLength[1] > 0) && (partitionLength[packSize - 1] > 0)) { partitionLength[1]--; partitionLength[packSize - 1]--; numGroup -= 2; } else if (packSize == 4) { if (partitionLength[2] > 1) { partitionLength[2] -= 2; numGroup -= 2; } else { for (storeModulo = 1; storeModulo < 4; storeModulo += 2) if ((partitionLength[2] > 0) && (partitionLength[storeModulo] > 1)) { partitionLength[2]--; partitionLength[storeModulo] -= 2; numGroup -= 3; break; } if (storeModulo >= 4) for (storeModulo = 1; storeModulo < 4; storeModulo++) if (partitionLength[storeModulo] > 0) { numGroup -= min(partitionLength[storeModulo], 4); partitionLength[storeModulo] -= min(partitionLength[storeModulo], 4); } } } else if (partitionLength[1] > 0) { numGroup -= min(partitionLength[1], packSize); partitionLength[1] -= min(partitionLength[1], packSize); } else if (partitionLength[packSize - 1] > 0) { numGroup -= min(partitionLength[packSize - 1], packSize); partitionLength[packSize - 1] -= min(partitionLength[packSize - 1], packSize); } } printf("Case #%li: %li\n", size + 1, result); } exit(0); }
[ "marina@virginia.edu" ]
marina@virginia.edu
0cfeeaf5fa7770ebbde28bcd4293b9a02202fe73
e77252d253f971bac25e5dc82c9cc74947c40fc8
/Temp/StagingArea/Data/il2cppOutput/System_System_UriParser.h
b916f13952e588cfbe17685694290a756bd03663
[]
no_license
zpsaras/RemoteAssociatesTest
47435babb962ba98a6bbd78d2a0c54b0410f2338
4199c7abcc14593d53370a8d135630d176235ff1
refs/heads/master
2021-01-18T15:08:17.660623
2015-12-05T21:36:30
2015-12-05T21:36:30
47,208,339
1
0
null
null
null
null
UTF-8
C
false
false
994
h
#pragma once #include "il2cpp-config.h" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> // System.Object struct Object_t; // System.Collections.Hashtable struct Hashtable_t1_171; // System.String struct String_t; // System.Text.RegularExpressions.Regex struct Regex_t3_90; #include "mscorlib_System_Object.h" // System.UriParser struct UriParser_t3_144 : public Object_t { // System.String System.UriParser::scheme_name String_t* ___scheme_name_2; // System.Int32 System.UriParser::default_port int32_t ___default_port_3; }; struct UriParser_t3_144_StaticFields{ // System.Object System.UriParser::lock_object Object_t * ___lock_object_0; // System.Collections.Hashtable System.UriParser::table Hashtable_t1_171 * ___table_1; // System.Text.RegularExpressions.Regex System.UriParser::uri_regex Regex_t3_90 * ___uri_regex_4; // System.Text.RegularExpressions.Regex System.UriParser::auth_regex Regex_t3_90 * ___auth_regex_5; };
[ "zach.psaras@gmail.com" ]
zach.psaras@gmail.com
6ed4564c6cc551aa20b9b2ee112b373c203a0105
1ad4dd5261a185f3cf92d7fd3226de28679747c5
/kernel/arch/m32r/include/asm/smp.h
763f22700ce65b94febd6b52de334abc9c3a6e37
[ "MIT", "Linux-syscall-note", "GPL-2.0-only" ]
permissive
oslab-swrc/libmpk
b30c8fa2eea834a8ab441fdd9f7789296781ec17
a0b20ab8819d60d22d2a90f0d54eccae40ae6b05
refs/heads/master
2022-05-01T01:36:07.491532
2022-03-18T05:44:14
2022-03-18T05:44:14
223,290,854
0
0
MIT
2019-11-22T00:30:13
2019-11-22T00:30:12
null
UTF-8
C
false
false
3,587
h
/* SPDX-License-Identifier: GPL-2.0 */ #ifndef _ASM_M32R_SMP_H #define _ASM_M32R_SMP_H #ifdef CONFIG_SMP #ifndef __ASSEMBLY__ #include <linux/cpumask.h> #include <linux/spinlock.h> #include <linux/threads.h> #include <asm/m32r.h> #define PHYSID_ARRAY_SIZE 1 struct physid_mask { unsigned long mask[PHYSID_ARRAY_SIZE]; }; typedef struct physid_mask physid_mask_t; #define physid_set(physid, map) set_bit(physid, (map).mask) #define physid_clear(physid, map) clear_bit(physid, (map).mask) #define physid_isset(physid, map) test_bit(physid, (map).mask) #define physid_test_and_set(physid, map) test_and_set_bit(physid, (map).mask) #define physids_and(dst, src1, src2) bitmap_and((dst).mask, (src1).mask, (src2).mask, MAX_APICS) #define physids_or(dst, src1, src2) bitmap_or((dst).mask, (src1).mask, (src2).mask, MAX_APICS) #define physids_clear(map) bitmap_zero((map).mask, MAX_APICS) #define physids_complement(dst, src) bitmap_complement((dst).mask,(src).mask, MAX_APICS) #define physids_empty(map) bitmap_empty((map).mask, MAX_APICS) #define physids_equal(map1, map2) bitmap_equal((map1).mask, (map2).mask, MAX_APICS) #define physids_weight(map) bitmap_weight((map).mask, MAX_APICS) #define physids_shift_right(d, s, n) bitmap_shift_right((d).mask, (s).mask, n, MAX_APICS) #define physids_shift_left(d, s, n) bitmap_shift_left((d).mask, (s).mask, n, MAX_APICS) #define physids_coerce(map) ((map).mask[0]) #define physids_promote(physids) \ ({ \ physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ __physid_mask.mask[0] = physids; \ __physid_mask; \ }) #define physid_mask_of_physid(physid) \ ({ \ physid_mask_t __physid_mask = PHYSID_MASK_NONE; \ physid_set(physid, __physid_mask); \ __physid_mask; \ }) #define PHYSID_MASK_ALL { {[0 ... PHYSID_ARRAY_SIZE-1] = ~0UL} } #define PHYSID_MASK_NONE { {[0 ... PHYSID_ARRAY_SIZE-1] = 0UL} } extern physid_mask_t phys_cpu_present_map; /* * Some lowlevel functions might want to know about * the real CPU ID <-> CPU # mapping. */ extern volatile int cpu_2_physid[NR_CPUS]; #define cpu_to_physid(cpu_id) cpu_2_physid[cpu_id] #define raw_smp_processor_id() (current_thread_info()->cpu) extern cpumask_t cpu_callout_map; static __inline__ int hard_smp_processor_id(void) { return (int)*(volatile long *)M32R_CPUID_PORTL; } static __inline__ int cpu_logical_map(int cpu) { return cpu; } static __inline__ int cpu_number_map(int cpu) { return cpu; } extern void smp_send_timer(void); extern unsigned long send_IPI_mask_phys(const cpumask_t*, int, int); extern void arch_send_call_function_single_ipi(int cpu); extern void arch_send_call_function_ipi_mask(const struct cpumask *mask); #endif /* not __ASSEMBLY__ */ #define NO_PROC_ID (0xff) /* No processor magic marker */ /* * M32R-mp IPI */ #define RESCHEDULE_IPI (M32R_IRQ_IPI0-M32R_IRQ_IPI0) #define INVALIDATE_TLB_IPI (M32R_IRQ_IPI1-M32R_IRQ_IPI0) #define CALL_FUNCTION_IPI (M32R_IRQ_IPI2-M32R_IRQ_IPI0) #define LOCAL_TIMER_IPI (M32R_IRQ_IPI3-M32R_IRQ_IPI0) #define INVALIDATE_CACHE_IPI (M32R_IRQ_IPI4-M32R_IRQ_IPI0) #define CPU_BOOT_IPI (M32R_IRQ_IPI5-M32R_IRQ_IPI0) #define CALL_FUNC_SINGLE_IPI (M32R_IRQ_IPI6-M32R_IRQ_IPI0) #define IPI_SHIFT (0) #define NR_IPIS (8) #else /* CONFIG_SMP */ #define hard_smp_processor_id() 0 #endif /* CONFIG_SMP */ #endif /* _ASM_M32R_SMP_H */
[ "spark720@gatech.edu" ]
spark720@gatech.edu
9ca1b993629cfb217bde92fc065e56af10e99725
2495db693562415afcd03588383bca0855ee48b3
/sdk/boards/lpcxpresso54608/driver_examples/ctimer/simple_match/simple_match.c
76c7a14eedb0c0d0edc58b3bb9e1a13b1a1164da
[]
no_license
Goodjamp/HIDVideoStream
2653291606bf6cb3a7f135c682d77bee10392df7
89aa109f875ba5a931b3d04429463876f2be8c77
refs/heads/master
2021-09-29T14:48:46.727591
2018-11-08T16:15:35
2018-11-08T16:15:35
null
0
0
null
null
null
null
UTF-8
C
false
false
3,986
c
/* * The Clear BSD License * Copyright (c) 2016, Freescale Semiconductor, Inc. * Copyright 2016-2017 NXP * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted (subject to the limitations in the disclaimer below) provided * that the following conditions are met: * * o Redistributions of source code must retain the above copyright notice, this list * of conditions and the following disclaimer. * * o 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. * * o Neither the name of the copyright holder nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE GRANTED BY THIS LICENSE. * 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 HOLDER OR 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. */ /******************************************************************************* * Includes ******************************************************************************/ #include "fsl_debug_console.h" #include "board.h" #include "fsl_ctimer.h" #include "pin_mux.h" #include <stdbool.h> /******************************************************************************* * Definitions ******************************************************************************/ #define CTIMER CTIMER3 /* Timer 3 */ #define CTIMER_MAT_OUT kCTIMER_Match_1 /* Match output 1 */ #define BUS_CLK_FREQ CLOCK_GetFreq(kCLOCK_AsyncApbClk) /******************************************************************************* * Prototypes ******************************************************************************/ /******************************************************************************* * Variables ******************************************************************************/ /******************************************************************************* * Code ******************************************************************************/ /*! * @brief Main function */ int main(void) { ctimer_config_t config; ctimer_match_config_t matchConfig; /* Init hardware*/ /* attach 12 MHz clock to FLEXCOMM0 (debug console) */ CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH); /* Enable the asynchronous bridge */ SYSCON->ASYNCAPBCTRL = 1; /* Use 12 MHz clock for some of the Ctimers */ CLOCK_AttachClk(kFRO12M_to_ASYNC_APB); BOARD_InitPins(); BOARD_BootClockFROHF48M(); BOARD_InitDebugConsole(); PRINTF("CTimer match example to toggle the output on a match\r\n"); CTIMER_GetDefaultConfig(&config); CTIMER_Init(CTIMER, &config); matchConfig.enableCounterReset = true; matchConfig.enableCounterStop = false; matchConfig.matchValue = BUS_CLK_FREQ / 2; matchConfig.outControl = kCTIMER_Output_Toggle; matchConfig.outPinInitState = true; matchConfig.enableInterrupt = false; CTIMER_SetupMatch(CTIMER, CTIMER_MAT_OUT, &matchConfig); CTIMER_StartTimer(CTIMER); while (1) { } }
[ "aleksandr.gerasimchuk@developex.org" ]
aleksandr.gerasimchuk@developex.org
321217b30674232001926d6307c18c098f5e9d91
20965ad00f94bab92a9d18c6e0990eb2a9a83e75
/src/lib/network_telemetry/inc/wc_telemetry.h
64208dfce58cd0412bf24516d6d532f551f0da0c
[ "BSD-3-Clause", "BSD-2-Clause" ]
permissive
plume-design/opensync
22fe8d0779df5e35057a8dd5fb779e6b088eee58
907da96a2a5cc78d308f095323ebc992d524630e
refs/heads/master
2023-08-16T11:40:56.389400
2023-07-21T03:41:00
2023-07-21T03:41:00
113,587,683
80
91
BSD-3-Clause
2023-08-18T15:20:42
2017-12-08T15:20:41
C
UTF-8
C
false
false
6,151
h
/* Copyright (c) 2015, Plume Design 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: 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. 3. Neither the name of the Plume Design Inc. 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 Plume Design Inc. 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 WC_TELEMETRY_H_INCLUDED #define WC_TELEMETRY_H_INCLUDED #include <stdint.h> #include "ip_dns_telemetry.pb-c.h" /** * @brief container of information needed to set an observation point protobuf. * * Stashes a pod's serial number and deployment location id. */ struct wc_observation_point { char *node_id; /*!< pod's serial number */ char *location_id; /*!< pod's deployment location id */ }; /** * @brief start/end info container * * Stashes the sart and end times of an observation window */ struct wc_observation_window { uint64_t started_at; /*!< time window start (epoch) */ uint64_t ended_at; /*!< time window end (epoch) */ }; /** * @brief Web classification health stats container */ struct wc_health_stats { uint32_t total_lookups; uint32_t cache_hits; uint32_t remote_lookups; uint32_t connectivity_failures; uint32_t service_failures; uint32_t uncategorized; uint32_t min_latency; uint32_t max_latency; uint32_t avg_latency; uint32_t cached_entries; uint32_t cache_size; }; /** * @brief Hero risk stats container */ struct wc_risk_stats { int32_t risk; uint32_t total_hits; }; /** * @brief Hero category stats container */ struct wc_category_stats { int32_t category_id; size_t num_risk_stats; struct wc_risk_stats **risk_stats; }; /** * @brief Hero rules stats container */ struct wc_rules_stats { char *policy_name; char *rule_name; size_t num_category_stats; struct wc_category_stats **cat_stats; }; /** * @brief Web classification Hero stats */ struct wc_hero_stats { char *device_id; size_t num_rules_stats; struct wc_rules_stats **rule_stats; }; /** * @brief Web classification stats container */ struct wc_stats_report { char *provider; struct wc_observation_point *op; struct wc_observation_window *ow; struct wc_health_stats *health_stats; size_t num_hero_stats; struct wc_hero_stats **hero_stats; }; /** * @brief Container of protobuf serialization output * * Contains the information related to a serialized protobuf */ struct wc_packed_buffer { size_t len; /*<! length of the serialized protobuf */ void *buf; /*<! dynamically allocated pointer to serialized data */ }; /** * @brief Frees the pointer to serialized data and container * * Frees the dynamically allocated pointer to serialized data (pb->buf) * and the container (pb) * * @param pb a pointer to a serialized data container * @return none */ void wc_free_packed_buffer(struct wc_packed_buffer *pb); /** * @brief Generates an observation point serialized protobuf * * Uses the information pointed by the info parameter to generate * a serialized obervation point buffer. * The caller is responsible for freeing to the returned serialized data, * @see free_packed_buffer() for this purpose. * * @param op node info used to fill up the protobuf. * @return a pointer to the serialized data. */ struct wc_packed_buffer * wc_serialize_observation_point(struct wc_observation_point *op); /** * @brief Generates an observation window serialized protobuf * * Uses the information pointed by the inpu parameter to generate * a serialized obervation window buffer. * The caller is responsible for freeing to the returned serialized data, * @see free_packed_buffer() for this purpose. * * @param ow observation window used to fill up the protobuf. * @return a pointer to the serialized data. */ struct wc_packed_buffer * wc_serialize_observation_window(struct wc_observation_window *ow); /** * @brief Generates a health stats serialized protobuf * * Uses the information pointed by the input parameter to generate * a serialized health stats buffer. * The caller is responsible for freeing to the returned serialized data, * @see free_packed_buffer() for this purpose. * * @param helthstate used to fill up the protobuf. * @return a pointer to the serialized data. */ struct wc_packed_buffer * wc_serialize_health_stats(struct wc_health_stats *hs); /** * @brief Generates a web classification telemetry serialized protobuf * * Uses the information pointed by the report parameter to generate * a serialized web classification telemetry buffer. * The caller is responsible for freeing to the returned serialized data, * @see free_packed_buffer() for this purpose. * * @param node info used to fill up the protobuf. * @return a pointer to the serialized data. */ struct wc_packed_buffer * wc_serialize_wc_stats_report(struct wc_stats_report *report); #endif /* WC_TELEMETRY_H_INCLUDED */
[ "lkristan@plume.com" ]
lkristan@plume.com
fa6eca76f18edec47a952f84b39372f5e4993358
f71c2f58feba8799ccf50b18f8a3fef687e7b352
/src/codeseg1/codeseg1_55.c
352b9bfcccce266bd2692443eaa30ae732a3116a
[]
no_license
Ponmander/Rocket-Robot-On-Wheels
6f2b546e5e10be48b062d66d9c49ab350d6f5c7d
a89320ee53fa07901c3e4a3d8104f1635b4a001a
refs/heads/master
2023-03-08T11:30:27.807530
2021-02-25T02:57:46
2021-02-25T02:57:46
null
0
0
null
null
null
null
UTF-8
C
false
false
153
c
#include <include_asm.h> #include <ultra64.h> INCLUDE_ASM(s32, "codeseg1/codeseg1_55", guMtxF2L); INCLUDE_ASM(s32, "codeseg1/codeseg1_55", guMtxL2F);
[ "mrwiseguyromhacking@gmail.com" ]
mrwiseguyromhacking@gmail.com
546ae89cd96088e0e9b47bbc1a56a96d2cfe9805
dcf26a6bcf853a3f8f6f50f9379998ef4d8aad40
/vendor/hisi/hi35xx/third_party/uboot/board/freescale/t102xrdb/spl.c
6c12ceec0522c1b4aaadc8a40fa5bcc56d91885f
[]
no_license
small-seven/testmem
c5f3202dce1c369e9d84cdaaccc2008b827c16d8
2771460c617439bd1be562ffdc94543ea170a736
refs/heads/main
2023-03-12T22:16:28.824577
2021-03-03T04:24:59
2021-03-03T04:24:59
343,847,762
1
0
null
null
null
null
UTF-8
C
false
false
685
c
#include <common.h> #include <console.h> #include <env_internal.h> #include <malloc.h> #include <ns16550.h> #include <nand.h> #include <i2c.h> #include <mmc.h> #include <fsl_esdhc.h> #include <spi_flash.h> #include "../common/sleep.h" #include "../common/spl.h" #if defined(CONFIG_SPL_MMC_BOOT) #define GPIO1_SD_SEL 0x00020000 #endif #ifdef CONFIG_DEEP_SLEEP #endif #if defined(CONFIG_SPL_MMC_BOOT) #elif defined(CONFIG_SPL_SPI_BOOT) #elif defined(CONFIG_SPL_NAND_BOOT) #endif #ifdef CONFIG_SPL_NAND_BOOT #endif #ifdef CONFIG_SPL_MMC_BOOT #endif #ifdef CONFIG_SPL_SPI_BOOT #endif #ifdef CONFIG_SPL_MMC_BOOT #elif defined(CONFIG_SPL_SPI_BOOT) #elif defined(CONFIG_SPL_NAND_BOOT) #endif
[ "huihuigong@users.noreply.github.com" ]
huihuigong@users.noreply.github.com
d2fb8b799dad742de714214db5db9655614971db
a296a3a4cb2c2683331d80bff471ef61902f99fe
/Sources/LightSensor.h
0c351a0cbf867431dbd68094430136b2a9dc3a12
[]
no_license
davidhuwyler/LiDo
d3b4e12278553f59c9e2a1ce5989061bd11ac6b0
f9bbc9eb17a92931f3cb8bc2630a70f371402858
refs/heads/master
2020-04-24T01:49:35.117676
2019-05-31T18:01:42
2019-05-31T18:01:42
171,613,997
1
0
null
null
null
null
UTF-8
C
false
false
896
h
/* * LightSensor.h * * Created on: Feb 20, 2019 * Author: dave * * Driver for the AS7264N LightSensor via I2C */ #ifndef SOURCES_LIGHTSENSOR_H_ #define SOURCES_LIGHTSENSOR_H_ #include <stdint.h> #include "CLS1.h" typedef struct { uint16_t xChannelValue; uint16_t yChannelValue; uint16_t zChannelValue; uint16_t nChannelValue; } LightChannels_t; typedef enum { LightSensor_Bank0_X_Y_B_B = 0, LightSensor_Bank1_X_Y_Z_IR = 1 } LightSensorBank; void LightSensor_init(void); uint8_t LightSensor_autoZeroBlocking(void); uint8_t LightSensor_getChannelValues(LightChannels_t* bank0,LightChannels_t* bank1); uint8_t LightSensor_ParseCommand(const unsigned char *cmd, bool *handled, const CLS1_StdIOType *io); void LightSensor_setParams(uint8_t paramGain, uint8_t paramIntegrationTime, uint8_t paramWaitTime); void LightSensor_Done_ISR(void); #endif /* SOURCES_LIGHTSENSOR_H_ */
[ "david.huwyler@gmail.com" ]
david.huwyler@gmail.com
f9c0a30ef6752d4ea31587847dae5c23e0a31ed3
7470a3a9fdc58d682cc9b900e52b533c68546457
/UNIVERSITY-PRACTICE/30_rmv_frt_wrd.c
c5fc124a5c6b3a6e646a4520844c611f5e66e199
[]
no_license
touhiduzzaman-tuhin/c-code-university-life
6344d2ead67ed6d2f0c3222c6bfcc5f1da7f10ae
e1ec70d08d2f8775ad1fba2c7bfa710470392449
refs/heads/master
2023-03-14T12:00:47.696819
2021-03-06T18:49:53
2021-03-06T18:49:53
332,627,421
0
0
null
null
null
null
UTF-8
C
false
false
703
c
#include <stdio.h> #include <string.h> int main() { char ch[1000], ch1[1000]; int i, j, f, c = 0; int l, l1; printf("Enter any string: "); gets(ch); printf("Enter any word to search: "); gets(ch1); l = strlen(ch); l1 = strlen(ch1); for(i = 0; i <= l - l1; i++) { f = 1; for(j = 0; j < l1; j++) { if(ch[i + j] != ch1[j]) { f = 0; break; } } if(f == 1) { for(j = i; j <= l-l1; j++) { ch[j] = ch[j + l1]; } break; } } puts(ch); return 0; }
[ "touhiduzzamantuhin95@gmail.com" ]
touhiduzzamantuhin95@gmail.com
f9490dc30461521f6072f82803d991758306104e
26f7ec43327f9d9baff3ebbfa553b1f1412590cf
/src/libxpeccy/fdc.h
76817997c4be8f5d2819bf3d72babfaa6655ca40
[ "MIT" ]
permissive
RandomAmbersky/Xpeccy
da7c97b2ac6fa7f5e966df8b7cd7d17bd1d4e38a
78afe426adac6a04a8ee3eb33d4607e8737e1c6f
refs/heads/master
2022-05-04T23:47:59.486684
2022-02-23T13:21:56
2022-02-23T13:21:56
87,579,979
0
0
null
2017-04-07T19:27:40
2017-04-07T19:27:39
null
UTF-8
C
false
false
2,734
h
#pragma once #include <stdlib.h> #include "floppy.h" #define FDC_FAST 1 enum { FDC_NONE = 0, FDC_VG93, FDC_UPD765, FDC_VP1_128, FDC_I8272 }; enum { DIF_NONE = 0, DIF_BDI, DIF_P3DOS, DIF_PC, DIF_SMK512, DIF_END = -1 }; #define BDI_SYS 0xff #define FDC_COM 0x1f #define FDC_TRK 0x3f #define FDC_SEC 0x5f #define FDC_DATA 0x7f #define TURBOBYTE 500 // same for turbo #define turbo (fdcFlag & FDC_FAST) typedef struct { unsigned char trk; unsigned char head; unsigned char sec; unsigned char sz; // 0..3 = 128..1024 unsigned char type; int crc; unsigned char data[0x1800]; } Sector; typedef struct FDC FDC; typedef void(*fdcCall)(FDC*); struct FDC { const int id; unsigned brk:1; // signal for debug unsigned upd:1; // 1 if uPD765, 0 if i8275 unsigned seekend:1; // uPD765: set at end of seek/recalibrate com unsigned irq:1; // VG93:irq ; uPD765:exec unsigned drq:1; // 1:data request unsigned dir:1; // drq dir: 0 - cpu->fdc; 1 - fdc->cpu unsigned mr:1; // master reset unsigned block:1; unsigned side:1; unsigned step:1; // step dir unsigned mfm:1; unsigned idle:1; unsigned crchi:1; unsigned hd:1; // HD mode (trklen 12500, bytedelay 16000) unsigned char trk; // registers unsigned char sec; unsigned char data; unsigned char com; unsigned char state; // vp1-128 : mode (seek/rd/wr) unsigned char tmp; unsigned short wdata; unsigned short tdata; int bytedelay; Floppy* flop[4]; Floppy* flp; // current floppy ptr unsigned short crc; // calculated crc unsigned short fcrc; // crc get from floppy unsigned char buf[6]; int fmode; int cnt; int wait; // pause (ns) int tns; fdcCall* plan; // current task int pos; // pos in plan cbirq xirq; void* xptr; unsigned dma:1; // not implemented yet unsigned intr:1; // uPD765 interrupt pending. reset @ com08 int hlt; // head load time (all ns) int hut; // head unload time int srt; // step rate time unsigned char comBuf[8]; // uPD765 command args int comCnt; // arg count for command int comPos; // pos in comBuf unsigned char resBuf[8]; // uPD765 response int resCnt; int resPos; unsigned char sr0,sr1,sr2,sr3; // status registers Sector slst[64]; int scnt; }; void fdc_set_hd(FDC*, int); typedef struct DiskHW DiskHW; struct DiskIF { unsigned inten:1; // int enabled // unsigned intrq:1; // current int unsigned lirq:1; // last int int type; DiskHW* hw; FDC* fdc; }; typedef struct DiskIF DiskIF; extern int fdcFlag; DiskIF* difCreate(int, cbirq, void*); void difDestroy(DiskIF*); void difReset(DiskIF*); void difSync(DiskIF*, int); int difOut(DiskIF*, int, int, int); int difIn(DiskIF*, int, int*, int); void difSetHW(DiskIF*, int); void add_crc_16(FDC*, unsigned char);
[ "samstyle@list.ru" ]
samstyle@list.ru
652d0e58bed3767ea21181bf8aadf0a117a4d4eb
1fabbdfd1ca9ea1b6808893e12bd907eb74de414
/xcode/Classes/Native/AssemblyU2DCSharp_SPacket_SocketInstance_GC_SYNC_PAY_ACTIVIT_0.h
3baedb4c707e7c98f02da23d55dad993ec953dae
[]
no_license
Klanly/TutorialPackageClient
6f889e96c40ab13c97d107708ae8f3c71a484301
b9d61ba2f287c491c9565b432f852980ec3fee28
refs/heads/master
2020-12-03T01:42:35.256114
2016-11-01T02:40:21
2016-11-01T02:40:21
null
0
0
null
null
null
null
UTF-8
C
false
false
210
h
#pragma once #include <stdint.h> // System.Object #include "mscorlib_System_Object.h" // SPacket.SocketInstance.GC_SYNC_PAY_ACTIVITY_DATA_PF struct GC_SYNC_PAY_ACTIVITY_DATA_PF_t3969 : public Object_t { };
[ "bu213200@gmail.com" ]
bu213200@gmail.com
98e141a9927a3410f7a4324df086fcc0a23e7b2b
4d5fc41a348f065f27d2c06305f31bb2e27b806e
/c_src/sumArray.c
e5a92856d797dffc844b4b04aeee478dad09c02d
[]
no_license
sykim9587/Linux_src
4c81a22ba26f8657caaf13cd7a8ea2c8b178ec52
8b0201226eff580f6b33a8818842384a4f368aeb
refs/heads/master
2022-12-18T04:30:01.130153
2020-09-13T07:30:08
2020-09-13T07:30:08
276,586,646
1
1
null
null
null
null
UTF-8
C
false
false
365
c
#include <stdio.h> //int sumArray(int pArr[5], int size) // pArr[] is also a pointer, and //the number is ignored. int sumArray(const int *pArr, int size){ int result=0; for(int i =0; i <size; ++i) result += pArr[i]; return result; } int main(void) { int nums[] = {1,2,3,4,5}; int re; re = sumArray(nums, 5); printf("re : %d\n", re); return 0; }
[ "sykim9587@gmail.com" ]
sykim9587@gmail.com
df84f45b8c9f768c4a16ad1da1b354da1cc6d7d6
a25458a119c844bb3cdf84bcd50de8bf1ba48b37
/simple.c
a32df78a2830c2f0a28bbdcd7452b7927019b6bf
[]
no_license
curtisbright/mepn
976653948ae9affca0767f1e944c209e0b60500c
990e1f54a3b3b0ae184622546aeee4567689be30
refs/heads/master
2016-09-03T07:07:45.883246
2015-11-01T11:29:23
2015-11-01T11:29:23
17,382,771
1
2
null
null
null
null
UTF-8
C
false
false
3,658
c
#include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <dirent.h> #include <string.h> #include <time.h> #include <gmp.h> #define MAXSTRING 120000 int subword(char* prime, char* start, char middle, char* end, int* k) { int i=0, j=0, l=0; *k = 0; while(1) { if(j!=strlen(start)) { if(prime[i]==start[j]) i++; j++; } else if(l==0 && prime[i]==middle) { (*k)++; i++; } else { if(prime[i]==end[l]) i++; l++; } if(i==strlen(prime)) return 1; else if(l==strlen(end)+1) return 0; } } int main(int argc, char** argv) { DIR *dp; struct dirent *ep; int result; clock_t begin, end; double time_spent; if(argc<=2) { printf("This program searches all unsolved simple families\n"); printf("for prime candidates between exponents n and m,\n"); printf("given on the command-line\n"); return 0; } mpz_t p; mpz_init(p); for(int num=atoi(argv[1]); num<=atoi(argv[2]); num++) { begin = clock(); dp = opendir("./data"); int count=0; if(dp != NULL) { while(ep = readdir(dp)) { char filename[100]; char infilename[100]; char outfilename[100]; strcpy(filename, ep->d_name); filename[8] = '\0'; if(strcmp(filename, "unsolved")==0) { strcpy(strchr(filename+9, '.'), "\0"); int n = atoi(filename+9); sprintf(infilename, "data/%s", ep->d_name); FILE* in = fopen(infilename, "r"); sprintf(outfilename, "data/tmp-%s", ep->d_name); FILE* out = fopen(outfilename, "w"); char line[100]; char start[100]; char middle; char end[100]; char candidate[MAXSTRING]; while(fgets(line, 100, in)!=NULL) { int l = (int)(strchr(line, '*')-line); middle = line[l-1]; //printf("%s", line); line[strlen(line)-1] = '\0'; line[l-1] = '\0'; strcpy(start, line); strcpy(end, line+l+1); //printf("base: %d start: %s middle: %c end: %s\n", n, start, middle, end); strcpy(candidate, start); for(int j=0; j<num; j++) sprintf(candidate, "%s%c", candidate, middle); strcat(candidate, end); //printf("candidate: %s\n", candidate); char kernelfilename[100]; sprintf(kernelfilename, "data/minimal.%d.txt", n); FILE* kernel = fopen(kernelfilename, "r"); char prime[MAXSTRING]; int hassubword = 0; //printf("Checking %s%c*%s (base %d)...\n", start, middle, end, n); while(fgets(prime, MAXSTRING, kernel)!=NULL) { prime[strlen(prime)-1] = '\0'; int k; if(subword(prime, start, middle, end, &k)==1) { if(k<=num) { hassubword = 1; break; } } } fclose(kernel); if(hassubword) { //printf("%s%c^(%d)%s (base %d) has a kernel subword %s\n", start, middle, num, end, n, prime); continue; } mpz_set_str(p, candidate, n); result = mpz_probab_prime_p(p, 25); if(result>0) { //gmp_printf("%s%c^(%d)%s (base %d) (%Zd) probably prime\n", start, middle, num, end, n, p); printf("%s%c^(%d)%s (base %d) probably prime\n", start, middle, num, end, n); FILE* append = fopen(kernelfilename, "a"); fprintf(append, "%s\n", candidate); fclose(append); } else { fprintf(out, "%s%c*%s\n", start, middle, end); count++; } } fclose(out); fclose(in); remove(infilename); rename(outfilename, infilename); } } (void)closedir(dp); } else perror("Couldn't open the directory"); printf("FINISHED LEVEL %d, COUNT REMAINING %d, TIME %f\n", num, count, (double)(clock()-begin)/CLOCKS_PER_SEC); } mpz_clear(p); return 0; }
[ "cbright@uwaterloo.ca" ]
cbright@uwaterloo.ca
43342a1b322f65d8a5d1d69795cf5984680bb7a1
b9a206812f4eed2261e718c95e19d1b3eb9f2438
/FreeRTOS/models/FreeRTOSConfig.h
eade5fe1b30727c54e818df9be6b09ebeff98d25
[]
no_license
glocklueng/MBMios32
beefde5062257db74ea9a8ec7e898cac51eaddce
676e9b6c644eae4111f7ef0a72b16655c0acd5b9
refs/heads/master
2021-01-20T21:26:06.568393
2016-05-13T20:28:41
2016-05-13T20:28:41
61,983,773
0
1
null
2016-06-26T10:15:26
2016-06-26T10:15:26
null
UTF-8
C
false
false
4,351
h
#ifndef FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H // MIOS32 specific predefines - can be overruled in your local mios32_config.h file // don't include complete mios.h, but only relevant parts! #include "mios32_datatypes.h" #include "mios32_config.h" #include "mios32_sys.h" #ifndef MIOS32_MINIMAL_STACK_SIZE #define MIOS32_MINIMAL_STACK_SIZE 1024 #endif #ifndef MIOS32_HEAP_SIZE #define MIOS32_HEAP_SIZE 10*1024 #endif /*----------------------------------------------------------- * Application specific definitions. * * These definitions should be adjusted for your particular hardware and * application requirements. * * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. *----------------------------------------------------------*/ #define configUSE_PREEMPTION 1 #define configUSE_IDLE_HOOK 1 #define configUSE_TICK_HOOK 1 #define configCPU_CLOCK_HZ ( ( unsigned portLONG ) MIOS32_SYS_CPU_FREQUENCY ) #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) #define configMAX_PRIORITIES ( 5 ) #define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) (MIOS32_MINIMAL_STACK_SIZE/4) ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( MIOS32_HEAP_SIZE ) ) #define configMAX_TASK_NAME_LEN ( 16 ) // philetaylor: Added optional trace facility to allow tasks to be displayed // This is only used on the webserver example at the moment // It is very slow so shouldn't be used unless necessary. Default is off. #ifndef configUSE_TRACE_FACILITY #define configUSE_TRACE_FACILITY 0 #endif #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 #define configUSE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_COUNTING_SEMAPHORES 0 #define configUSE_ALTERNATIVE_API 0 #define configCHECK_FOR_STACK_OVERFLOW 0 #define configQUEUE_REGISTRY_SIZE 10 #define configUSE_PORT_OPTIMISED_TASK_SELECTION 1 // see http://www.freertos.org/index.html?http://www.freertos.org/rtos-run-time-stats.html // and http://www.midibox.org/mios32/manual/group___f_r_e_e_r_t_o_s___u_t_i_l_s.html // // The appr. utility functions for MIOS32 applications are located under // $MIOS32_PATH/modules/freertos_utils // #ifndef configGENERATE_RUN_TIME_STATS #define configGENERATE_RUN_TIME_STATS 0 #endif // vApplicationMallocFailedHook located in main.c (debug message will be sent to debug terminal and LCD) // philetaylor: Changed to allow this to be configured in mios32_config.h #ifndef configUSE_MALLOC_FAILED_HOOK #define configUSE_MALLOC_FAILED_HOOK 1 #endif /* Software timer definitions. */ #ifndef configUSE_TIMERS #define configUSE_TIMERS 0 #endif #define configTIMER_TASK_PRIORITY 3 #define configTIMER_QUEUE_LENGTH 5 #define configTIMER_TASK_STACK_DEPTH ( ( unsigned portSHORT ) (MIOS32_MINIMAL_STACK_SIZE/4) ) #define INCLUDE_vTaskPrioritySet 1 #define INCLUDE_uxTaskPriorityGet 1 #define INCLUDE_vTaskDelete 1 #define INCLUDE_vTaskCleanUpResources 0 #define INCLUDE_vTaskSuspend 1 #define INCLUDE_vResumeFromISR 1 #define INCLUDE_vTaskDelayUntil 1 #define INCLUDE_vTaskDelay 1 #define INCLUDE_xTaskGetSchedulerState 1 #define INCLUDE_xTaskGetCurrentTaskHandle 1 #define INCLUDE_uxTaskGetStackHighWaterMark 1 #define INCLUDE_xTimerGetTimerDaemonTaskHandle 1 #define configUSE_CO_ROUTINES 0 #define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) /* This is the raw value as per the Cortex-M3 NVIC. Values can be 255 (lowest) to 0 (1?) (highest). */ #define configKERNEL_INTERRUPT_PRIORITY 255 #define configMAX_SYSCALL_INTERRUPT_PRIORITY 191 /* equivalent to 0xa0, or priority 5. */ /* This is the value being used as per the ST library which permits 16 priority values, 0 to 15. This must correspond to the configKERNEL_INTERRUPT_PRIORITY setting. Here 15 corresponds to the lowest NVIC value of 255. */ #define configLIBRARY_KERNEL_INTERRUPT_PRIORITY 15 #endif /* FREERTOS_CONFIG_H */
[ "neon.king.fr@gmail.com" ]
neon.king.fr@gmail.com
11fa5ce333018735a9a59535b2af43f2ed8c1d7c
6dbf099660ee82b72fb2526a3dc242d99c5fb8c8
/nuitka/build/include/nuitka/helper/operations_binary_add.h
e2ad417c0b4a1fcf09fad05f7e1c41073709e4fb
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer" ]
permissive
Hellebore/Nuitka
3544af691bc352769858ec1d44b6e9de46087bcf
252d8e5d24521f8fff38142aa66c6b9063151f57
refs/heads/develop
2021-01-06T15:33:49.111250
2020-02-18T14:24:49
2020-02-18T14:24:49
241,380,473
0
0
Apache-2.0
2020-07-11T17:52:04
2020-02-18T14:21:01
Python
UTF-8
C
false
false
7,789
h
// Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com // // Part of "Nuitka", an optimizing Python compiler that is compatible and // integrates with CPython, but also works on its own. // // 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. // /* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */ /* C helpers for type specialized "+" (ADD) operations */ #if PYTHON_VERSION < 300 /* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_INT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_INT_OBJECT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */ extern PyObject *BINARY_OPERATION_ADD_INT_INT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "OBJECT" corresponds to any Python object and "STR" to Python2 'str'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_STR(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "STR" corresponds to Python2 'str' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_STR_OBJECT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "STR" corresponds to Python2 'str' and "STR" to Python2 'str'. */ extern PyObject *BINARY_OPERATION_ADD_STR_STR(PyObject *operand1, PyObject *operand2); #endif /* Code referring to "OBJECT" corresponds to any Python object and "UNICODE" to Python2 'unicode', Python3 'str'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2); /* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2); /* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "UNICODE" to Python2 'unicode', * Python3 'str'. */ extern PyObject *BINARY_OPERATION_ADD_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2); /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2); /* Code referring to "FLOAT" corresponds to Python 'float' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2); /* Code referring to "FLOAT" corresponds to Python 'float' and "FLOAT" to Python 'float'. */ extern PyObject *BINARY_OPERATION_ADD_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2); /* Code referring to "OBJECT" corresponds to any Python object and "TUPLE" to Python 'tuple'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2); /* Code referring to "TUPLE" corresponds to Python 'tuple' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2); /* Code referring to "TUPLE" corresponds to Python 'tuple' and "TUPLE" to Python 'tuple'. */ extern PyObject *BINARY_OPERATION_ADD_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2); /* Code referring to "OBJECT" corresponds to any Python object and "LIST" to Python 'list'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_LIST(PyObject *operand1, PyObject *operand2); /* Code referring to "LIST" corresponds to Python 'list' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_LIST_OBJECT(PyObject *operand1, PyObject *operand2); /* Code referring to "LIST" corresponds to Python 'list' and "LIST" to Python 'list'. */ extern PyObject *BINARY_OPERATION_ADD_LIST_LIST(PyObject *operand1, PyObject *operand2); #if PYTHON_VERSION >= 300 /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_BYTES(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION >= 300 /* Code referring to "BYTES" corresponds to Python3 'bytes' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_BYTES_OBJECT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION >= 300 /* Code referring to "BYTES" corresponds to Python3 'bytes' and "BYTES" to Python3 'bytes'. */ extern PyObject *BINARY_OPERATION_ADD_BYTES_BYTES(PyObject *operand1, PyObject *operand2); #endif /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG(PyObject *operand1, PyObject *operand2); /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_LONG_OBJECT(PyObject *operand1, PyObject *operand2); /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */ extern PyObject *BINARY_OPERATION_ADD_LONG_LONG(PyObject *operand1, PyObject *operand2); /* Code referring to "FLOAT" corresponds to Python 'float' and "LONG" to Python2 'long', Python3 'int'. */ extern PyObject *BINARY_OPERATION_ADD_FLOAT_LONG(PyObject *operand1, PyObject *operand2); /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "FLOAT" to Python 'float'. */ extern PyObject *BINARY_OPERATION_ADD_LONG_FLOAT(PyObject *operand1, PyObject *operand2); #if PYTHON_VERSION < 300 /* Code referring to "FLOAT" corresponds to Python 'float' and "INT" to Python2 'int'. */ extern PyObject *BINARY_OPERATION_ADD_FLOAT_INT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "INT" corresponds to Python2 'int' and "FLOAT" to Python 'float'. */ extern PyObject *BINARY_OPERATION_ADD_INT_FLOAT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */ extern PyObject *BINARY_OPERATION_ADD_LONG_INT(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "INT" corresponds to Python2 'int' and "LONG" to Python2 'long', Python3 'int'. */ extern PyObject *BINARY_OPERATION_ADD_INT_LONG(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "STR" to Python2 'str'. */ extern PyObject *BINARY_OPERATION_ADD_UNICODE_STR(PyObject *operand1, PyObject *operand2); #endif #if PYTHON_VERSION < 300 /* Code referring to "STR" corresponds to Python2 'str' and "UNICODE" to Python2 'unicode', Python3 'str'. */ extern PyObject *BINARY_OPERATION_ADD_STR_UNICODE(PyObject *operand1, PyObject *operand2); #endif /* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */ extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2);
[ "kay.hayen@gmail.com" ]
kay.hayen@gmail.com
077a0ae812a15a1437d6ed138c413a884ac4024b
1baa0d9650e3ebe27109f47e229f89b6e292e39b
/ch12/12_16.c
1c9be1167c6a6cd99654c94129c57e84d0f25e40
[]
no_license
ppd0705/play_apue
de2eaef6330b78fc07c7e5621b314c718b8fc240
b487fb7c08f8645e6d0aadbbec50b3627ff54a0d
refs/heads/master
2022-12-19T21:00:38.993553
2020-10-12T00:43:48
2020-10-12T00:43:48
258,960,747
1
0
null
null
null
null
UTF-8
C
false
false
1,513
c
#include <pthread.h> #include "apue.h" int quitflag; sigset_t mask; pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t waitloc = PTHREAD_COND_INITIALIZER; void *thr_fn(void *arg) { int err, signo; for (;;) { err = sigwait(&mask, &signo); printf("thread err %d\n", err); if (err != 0) err_exit(err, "sigwait failed"); switch (signo) { case SIGINT: printf("\ninterrupt\n"); break; case SIGQUIT: printf("\nquit\n"); pthread_mutex_lock(&lock); quitflag = 1; pthread_mutex_unlock(&lock); pthread_cond_signal(&waitloc); return(0); default: printf("unexpected signal %d\n", signo); exit(1); } } } int main(void) { int err; sigset_t oldmask; pthread_t tid; sigemptyset(&mask); sigaddset(&mask, SIGINT); sigaddset(&mask, SIGQUIT); if ((err = pthread_sigmask(SIG_BLOCK, &mask, &oldmask)) != 0) err_exit(err, "SIG_BLOCK error"); err = pthread_create(&tid, NULL, thr_fn, 0); if (err != 0) err_exit(err, "can't create thread"); pthread_mutex_lock(&lock); while(quitflag == 0) pthread_cond_wait(&waitloc, &lock); pthread_mutex_unlock(&lock); quitflag = 0; if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0) err_sys("SIG_SETMASK error"); exit(0); }
[ "ppd0705@163.com" ]
ppd0705@163.com
2c0f29d559449c88c365ab70fad642248963a038
5c255f911786e984286b1f7a4e6091a68419d049
/vulnerable_code/d3a08a47-f891-4123-b055-c19049baf996.c
010ab06e9d10073bf22342e7647e5f7fed942e83
[]
no_license
nmharmon8/Deep-Buffer-Overflow-Detection
70fe02c8dc75d12e91f5bc4468cf260e490af1a4
e0c86210c86afb07c8d4abcc957c7f1b252b4eb2
refs/heads/master
2021-09-11T19:09:59.944740
2018-04-06T16:26:34
2018-04-06T16:26:34
125,521,331
0
0
null
null
null
null
UTF-8
C
false
false
562
c
#include <string.h> #include <stdio.h> int main() { int i=4; int j=142; int k; int l; k = 53; l = 64; k = i/j; l = i/j; l = j/j; l = l/j; l = k%j; k = k-k*i; //variables //random /* START VULNERABILITY */ int a; int b[76]; int c[60]; a = 0; while (a > -1) { /* START BUFFER SET */ *((int *)c + a) = *((int *)b + a); /* END BUFFER SET */ //random a--; } /* END VULNERABILITY */ printf("%d%d\n",k,l); return 0; }
[ "nharmon8@gmail.com" ]
nharmon8@gmail.com
6c291556df0769ef33c54ddaa118e5bac69a6205
40de3da30239862f11a946166b50438174c2fd4e
/lib/guilds/necro/base_guild_old.c
bbde29cff03c0a9109e95ee0155130f06ee89a0c
[ "MIT" ]
permissive
vlehtola/questmud
f53b7205351f30e846110300d60b639d52d113f8
8bc3099b5ad00a9e0261faeb6637c76b521b6dbe
refs/heads/master
2020-12-23T19:59:44.886028
2020-01-30T15:52:16
2020-01-30T15:52:16
237,240,459
0
0
null
null
null
null
UTF-8
C
false
false
4,044
c
inherit "guilds/guilds/guild"; inherit "room/room"; reset(arg) { load_plaque(); set_not_out(1); set_light(3); if(arg) return; call_other("/wizards/celtron/cemetary/virtual_map", "loading_hc", 0); add_exit("out","/wizards/celtron/cemetary/virtual_map: 30 8"); add_exit("south", "/guilds/necro/control1"); add_exit("northwest", "/guilds/necro/dark_power"); add_exit("northeast", "/guilds/necro/necro"); short_desc = "The room of dark mystics; the necromancers"; long_desc = "Necromancers train here their unholy skills and so that\n"+ "they might get better in practicing their vile art.\n"+ "This is the most unholy place on Deleria: the guild of necromancers.\n"+ "An old writing is scribbled on the wall 'thou must mock the dead to\n"+ "truly master the secrets'.\n"+ "Some bone bracelets are hanging from hooks attached to the wall.\n"; } ota_bracu(string str) { if(str != "bracelet" && str != "at bracelets") return 0; if (this_player()->query_guild_level(guild_name()) < 10) { write("You are not worthy.\n"); return 1; } write("You take one bracelet from the hook.\n"); move_object(clone_object("/guilds/necro/obj/bone_bracelet"), this_player()); return 1; } guild_max_level() { return 10; } init() { ::init(); guild_init(); // add_action("ota_bracu", "get"); // add_action("ota_bracu", "take"); // add_action("ota_bracu", "look"); } guild_name() { return "necromancers"; } check_joining_rec() { return 1; } check_advance_rec(lev) { mapping sk; sk = ([ ]); return sk; } get_bonuses(level) { /* yhteensa 5 stattia / levelli */ return "int 1 , wis 1 , "; } /* cast dark power -> 60 cast r corp -> 60 cast r ethe -> 40 cast minorn -> 60 cast focus dp -> 60 dark power -> 30 dark lore -> 100 cast raise soul -> 100 */ skill_list(int guild_level) { mapping skill; skill = ([ ]); if (guild_level > guild_max_level()) { guild_level = guild_max_level(); } if (guild_level >= 1) { skill += (["cast dark power": 30]); skill += (["cast focus dark power": 30]); skill += (["cast raise corporeal": 30]); skill += (["cast minor necromancy": 30]); skill += (["cast raise soul": 30]); skill += (["freeze corpse": 30]); } if (guild_level >= 2) { skill += (["dark power": 10]); } if (guild_level >= 3) { skill += (["cast dark power": 40]); skill += (["cast focus dark power": 40]); skill += (["cast raise corporeal": 40]); skill += (["cast minor necromancy": 40]); skill += (["cast raise soul": 50]); skill += (["freeze corpse": 50]); } if (guild_level >= 4) { skill += (["dark power": 15]); skill += (["cast raise ethereal": 20]); } if (guild_level >= 5) { skill += (["dark lore": 60]); } if (guild_level >= 6) { skill += (["cast dark power": 45]); skill += (["cast focus dark power": 45]); skill += (["cast raise corporeal": 45]); skill += (["cast raise soul": 55]); skill += (["cast minor necromancy": 45]); skill += (["freeze corpse": 75]); } if (guild_level >= 7) { skill += (["dark lore": 80]); } if (guild_level >= 8) { skill += (["dark power": 20]); skill += (["cast raise ethereal": 30]); } if (guild_level >= 9) { skill += (["cast dark power": 50]); skill += (["cast focus dark power": 50]); skill += (["cast raise corporeal": 50]); skill += (["cast minor necromancy": 50]); skill += (["dark lore": 100]); skill += (["cast raise soul": 80]); } if (guild_level >=10) { skill += (["dark power": 30]); skill += (["cast raise ethereal": 40]); skill += (["cast dark power": 60]); skill += (["cast focus dark power": 60]); skill += (["cast raise corporeal": 60]); skill += (["cast minor necromancy": 60]); skill += (["cast raise soul": 100]); skill += (["freeze corpse": 100]); } return skill; }
[ "ville.lehtola@iki.fi" ]
ville.lehtola@iki.fi
ce4e9f33397a4d709c5a6bd68dba3d1ec692bdfa
6e969e1f3e14e1251b02f4f3fc1a2b623ac5286e
/saclib/src/MPFFGEN.c
0717dee97d3373c69cfda55c4004321e18d4afec
[ "LicenseRef-scancode-warranty-disclaimer" ]
no_license
PetterS/qepcad
11f4e1f5ba773bbfea5de69b85c01b9663aefa92
d9b8661bc37bbb50a3ac4a90a3000e602fda8f15
refs/heads/master
2023-03-18T16:31:31.444303
2023-03-12T15:44:03
2023-03-12T15:44:03
21,304,917
24
13
null
2023-03-12T15:44:04
2014-06-28T14:55:20
C
UTF-8
C
false
false
1,401
c
/*======================================================================= A <- MPFFGEN(p,F) Medium prime finite field generator. Inputs p : a medium prime. F: a monic irreducible polynomial over Z_p in aray representation of degree n, n >= 2 and p^n < beta. Output A: a monic primitive element of Z_p/(F) of minimum degree in array representation. ========================================================================*/ #include "saclib.h" BDigit *MPFFGEN(p,F) BDigit p,*F; { BDigit *A,*B,d,e,i,k,n,q,qp,t,u; Word L,Lp,M; Step1: /* Let q' = q^n - 1. Make a list L of all q'/d such that d is a prime divisor of q'. */ n = MAPDEG(F); q = IEXP(p,n); qp = q - 1; L = IFACT(qp); M = LFML(L); L = NIL; do { ADV(M,&d,&M); L = COMP(qp/d,L); } while (M != NIL); Step2: /* Search for a primitive element. */ for (k = 1; k < n; k++) { A = MAPGET(k); MAPDEG(A) = k; MAPCF(A,k) = 1; for (i = 0; i < k; i++) MAPCF(A,i) = 0; do { Lp = L; do { ADV(Lp,&e,&Lp); B = MPFFEXP(p,F,A,e); u = 0; if (MAPDEG(B) == 0 && MAPCF(B,0) == 1) u = 1; MAPFREE(B); } while (Lp != NIL && u == 0); if (Lp == NIL && u == 0) goto Return; t = LEXNEXT(k,p-1,A); } while (t == 1); MAPFREE(A); } Return: /* Return A. */ return(A); }
[ "petter.strandmark@gmail.com" ]
petter.strandmark@gmail.com
c0e255f087c25cd7aa625822becc432bc1640e6e
dbbef29b50d3e01698fe54b1d63b59f152fe41ed
/MS51DA9AE_MS51BA9AE/Library/StdDriver/inc/sys.h
78b5ecb49b7af68ed410ecaa2c83157ced3e23e6
[ "Apache-2.0" ]
permissive
OpenNuvoton/MS51BSP_KEIL
f66f200d11be4d0be8e13c364239fc6836e7faa4
c0cb83d9d7379f3f32c58be2c0cd84b5dee026fe
refs/heads/master
2023-06-25T07:55:19.370703
2023-06-12T08:21:22
2023-06-12T08:21:22
231,041,654
17
16
Apache-2.0
2023-03-16T03:20:57
2019-12-31T06:49:21
C
UTF-8
C
false
false
1,249
h
/*---------------------------------------------------------------------------------------------------------*/ /* */ /* SPDX-License-Identifier: Apache-2.0 */ /* Copyright(c) 2020 Nuvoton Technology Corp. All rights reserved. */ /* */ /*---------------------------------------------------------------------------------------------------------*/ #define FSYS_HXT 0 #define FSYS_LXT 1 #define FSYS_HIRC 2 #define FSYS_LIRC 3 #define FSYS_OSCIN_P30 4 #define FSYS_HXTIN_P00 5 #define HIRC_24 6 #define HIRC_16 7 #define HIRC_166 8 #define HIRC_24 6 #define HIRC_16 7 #define HIRC_166 8 extern bit BIT_TMP; extern unsigned char data TA_REG_TMP,BYTE_TMP; void FsysSelect(unsigned char u8FsysMode); void ClockEnable(unsigned char u8FsysMode); void ClockDisable(unsigned char u8FsysMode); void ClockSwitch(unsigned char u8FsysMode); void MODIFY_HIRC(unsigned char u8HIRCSEL);
[ "LCWANG0@nuvoton.com" ]
LCWANG0@nuvoton.com
8c2b607a32eca8ff4b0f1ac57c5bdef5e0495036
3a795bf72e237a4b73c90cf1e5d8e962e7c71e3c
/lab_04_3_2/print_words.c
e556c9b338ae5486e59ffb66e59a09e588e468c4
[]
no_license
MyMiDiII/bmstu-c
669b35885cc9e969e802bcc98cfb5f0c25b2f4ba
f442c533288322683d643c1dbf4ffe7a4098f1b9
refs/heads/main
2023-02-25T04:50:31.570263
2021-01-31T12:20:33
2021-01-31T12:20:33
334,440,050
4
2
null
null
null
null
UTF-8
C
false
false
1,255
c
#include <stdio.h> #include "print_words.h" bool is_matching(const char *str1, const char *str2) { int i; for (i = 0; *(str1 + i) != '\0' && *(str2 + i) != '\0'; i++) { if (*(str1 + i) != *(str2 + i)) { return false; } } if (!(*(str1 + i) == '\0' && *(str2 + i) == '\0')) { return false; } return true; } int print_words(char (*words1)[WORD_MAX_LEN + 1], const int len1, char (*words2)[WORD_MAX_LEN + 1], const int len2, int *const was_print) { int number = 0; for (int i = 0; i < len1; i++) { int num_of_repetitions = 0; for (int j = 0; j < len1; j++) { if (i != j && is_matching(words1[i], words1[j])) { num_of_repetitions++; } } for (int j = 0; j < len2; j++) { if (is_matching(words1[i], words2[j])) { num_of_repetitions++; } } if (num_of_repetitions == 0) { if (*was_print == 0) { puts("Result:"); } printf("%s ", words1[i]); *was_print = 1; number++; } } return number; }
[ "mymidi.student@yandex.ru" ]
mymidi.student@yandex.ru
cd06edf9b94c609cd39fa74895836e952119b38b
53cec7c4ca4bef433c649c46d7cf208db4fb55e4
/d/swordman/bingqipu.c
6838f53bd4b8edf414b391d1d8f0aed8123c24df
[]
no_license
androids7/sjsh
c57b2f0f94932e228641a166efda8b7e19eefcc1
1c0391f6b8236f2c6e0c62a2bf904f47e3d5ca26
refs/heads/master
2021-01-09T15:35:19.076098
2016-02-21T11:27:48
2016-02-21T11:27:48
null
0
0
null
null
null
null
GB18030
C
false
false
664
c
//changan city inherit ROOM; void create () { set ("short", "兵器铺"); set ("long", @LONG 刚一进门就看到兵器架上摆着各种兵器,从上百近重的大刀到轻如芥 子的飞磺石,是应有尽有。 LONG); //set("item_desc", ([" *** " : " *** ", ])); set("exits", ([ //sizeof() == 4 "north" : __DIR__"dalu7", ])); set("objects", ([ //sizeof() == 1 __DIR__"npc/boss" : 1, ])); // set("outdoors", "changan"); set("no_clean_up", 0); setup(); replace_program(ROOM); }
[ "liming.xie@gmail.com" ]
liming.xie@gmail.com
754ff695dcd49abef2006aa6d422daedae3493b2
a53b9546fda6d8e81b479510c2c9b250562f291a
/src/u_crypto/crc16.c
52b7098f0b0541096f53031a0aa7c6300f8f0e09
[ "Unlicense" ]
permissive
Denis-Maksimov/u_cat
82cb0ac65bd1b158e710c6dd7f6ce66d1fe30cd4
39dd337b419b5f3cb6b41ee407995b6310534bba
refs/heads/master
2023-07-24T11:38:33.309085
2021-09-04T21:14:32
2021-09-04T21:14:32
379,257,473
0
0
null
null
null
null
UTF-8
C
false
false
3,993
c
// #include <sys/types.h> #include <u_crypto/crc16.h> /* Name : CRC-16 Poly : 0x8005 x^16 + x^15 + x^2 + 1 Init : 0xFFFF Revert: true XorOut: 0x0000 Check : 0x4B37 ("123456789") MaxLen: 4095 байт (32767 бит) - обнаружение одинарных, двойных, тройных и всех нечетных ошибок */ //-- private -- static const unsigned short Crc16Table[256] = { 0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601, 0x06C0, 0x0780, 0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xCC01, 0x0CC0, 0x0D80, 0xCD41, 0x0F00, 0xCFC1, 0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880, 0xC841, 0xD801, 0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1, 0xDF81, 0x1F40, 0xDD01, 0x1DC0, 0x1C80, 0xDC41, 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701, 0x17C0, 0x1680, 0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040, 0xF001, 0x30C0, 0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781, 0x3740, 0xF501, 0x35C0, 0x3480, 0xF441, 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0, 0x3E80, 0xFE41, 0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 0x2800, 0xE8C1, 0xE981, 0x2940, 0xEB01, 0x2BC0, 0x2A80, 0xEA41, 0xEE01, 0x2EC0, 0x2F80, 0xEF41, 0x2D00, 0xEDC1, 0xEC81, 0x2C40, 0xE401, 0x24C0, 0x2580, 0xE541, 0x2700, 0xE7C1, 0xE681, 0x2640, 0x2200, 0xE2C1, 0xE381, 0x2340, 0xE101, 0x21C0, 0x2080, 0xE041, 0xA001, 0x60C0, 0x6180, 0xA141, 0x6300, 0xA3C1, 0xA281, 0x6240, 0x6600, 0xA6C1, 0xA781, 0x6740, 0xA501, 0x65C0, 0x6480, 0xA441, 0x6C00, 0xACC1, 0xAD81, 0x6D40, 0xAF01, 0x6FC0, 0x6E80, 0xAE41, 0xAA01, 0x6AC0, 0x6B80, 0xAB41, 0x6900, 0xA9C1, 0xA881, 0x6840, 0x7800, 0xB8C1, 0xB981, 0x7940, 0xBB01, 0x7BC0, 0x7A80, 0xBA41, 0xBE01, 0x7EC0, 0x7F80, 0xBF41, 0x7D00, 0xBDC1, 0xBC81, 0x7C40, 0xB401, 0x74C0, 0x7580, 0xB541, 0x7700, 0xB7C1, 0xB681, 0x7640, 0x7200, 0xB2C1, 0xB381, 0x7340, 0xB101, 0x71C0, 0x7080, 0xB041, 0x5000, 0x90C1, 0x9181, 0x5140, 0x9301, 0x53C0, 0x5280, 0x9241, 0x9601, 0x56C0, 0x5780, 0x9741, 0x5500, 0x95C1, 0x9481, 0x5440, 0x9C01, 0x5CC0, 0x5D80, 0x9D41, 0x5F00, 0x9FC1, 0x9E81, 0x5E40, 0x5A00, 0x9AC1, 0x9B81, 0x5B40, 0x9901, 0x59C0, 0x5880, 0x9841, 0x8801, 0x48C0, 0x4980, 0x8941, 0x4B00, 0x8BC1, 0x8A81, 0x4A40, 0x4E00, 0x8EC1, 0x8F81, 0x4F40, 0x8D01, 0x4DC0, 0x4C80, 0x8C41, 0x4400, 0x84C1, 0x8581, 0x4540, 0x8701, 0x47C0, 0x4680, 0x8641, 0x8201, 0x42C0, 0x4380, 0x8341, 0x4100, 0x81C1, 0x8081, 0x4040 }; //-- public -- unsigned short crc16(unsigned char* pcBlock, unsigned short len) { unsigned short crc = 0xFFFF; // int i=0; while (len--){ crc = (crc >> 8) ^ Crc16Table[(crc & 0xFF) ^ pcBlock[0]]; pcBlock++; } return crc; } //------------------------------------------------------- unsigned int PJWHash (void *data, size_t n, size_t table_size) { unsigned char* str = data; unsigned int hash = 0; unsigned int test = 0; for (size_t i=0; i<n; i++) { hash = (hash << 4) + (str[i]); if ((test = hash & 0xf0000000) != 0) { hash = ((hash ^ (test >> 24)) & (0xfffffff)); } } return hash % table_size; } //------------------------------------------------------- unsigned long crc32table[256]; void crc_init() { unsigned long t; for(int i=0;i<256;i++) { t=i; for(int j=8;j>0;j--) { if(t&1) t=(t>>1)^0xedb88320; else t>>=1; } crc32table[i] = t; } } unsigned long crc32(unsigned long crc32, unsigned char * buf, size_t cnt) { crc32=~crc32; for(size_t i=0;i<cnt;i++) { crc32=crc32table[(crc32^buf[i])&0xff]^(crc32>>8); } crc32=~crc32; return crc32; }
[ "dn.maksimow@gmail.com" ]
dn.maksimow@gmail.com
4f66c9826343ded02b8f91cf41fa25be90eeb02f
a04087e2e96de05f0fe97716cdad49f8f1f81f35
/app/src/jni/mgncs/samples/src/list.c
fb9e9235ac35306cbb3b4f47a15dea26525e542e
[]
no_license
VincentWei/minigui-scripted
58a24670bc0961520863a150e98debd45f419403
37cc1eba3493b9453ee88dd4c4914d73ec15851d
refs/heads/master
2021-01-24T04:19:14.500625
2018-02-25T12:02:17
2018-02-25T12:02:17
122,927,862
6
1
null
null
null
null
UTF-8
C
false
false
4,702
c
/** * $Id: list.c 1617 2011-03-24 09:48:44Z shidazhi $ * * Listing P2C18.1 * * list.c: Sample program for mGNCS Programming Guide * The demo application for List. * * Copyright (C) 2010 Feynman Software. */ #include <stdio.h> #include <stdlib.h> #include <string.h> // START_OF_INCS #include <minigui/common.h> #include <minigui/minigui.h> #include <minigui/gdi.h> #include <minigui/window.h> #include <mgncs/mgncs.h> // END_OF_INCS #ifdef _MGNCSCTRL_LIST #define IDL_DIR 100 static char caption[] = "address"; // START_OF_LISTDATA static BITMAP demoBmp; static NCS_MENU_DATA child_data_1[] = { {0, NULL, 0, "phone: 15200000000", NULL, -1, 0, NULL}, {0, NULL, 0, "location: Beijing HaiDian", NULL, -1, 0, NULL}, {0, NULL, 0, "e-mail: support@minigui.org", NULL, -1, 0, NULL}, }; static NCS_MENU_DATA child_data_2[] = { {0, NULL, 0, "home: 010-82000000", NULL, -1, 0, NULL}, {0, NULL, 0, "office: 010-82650000", NULL, -1, 0, NULL}, {0, NULL, 0, "phone: 13400000000", NULL, -1, 0, NULL}, }; //nr_child, child, style, text, image, height, addData, parent static NCS_MENU_DATA data[] = { {3, child_data_2, NCSS_NODE_LTEXTBS, "Zeus", &demoBmp, -1, 0, NULL}, {3, child_data_2, NCSS_NODE_LTEXTBS, "Pan", &demoBmp, -1, 0, NULL}, {3, child_data_2, NCSS_NODE_LTEXTBS, "Apollo", &demoBmp, -1, 0, NULL}, {3, child_data_2, NCSS_NODE_LTEXTBS, "Heracles", &demoBmp, -1, 0, NULL}, {3, child_data_1, NCSS_NODE_LTEXTBS, "Achilles", &demoBmp, -1, 0, NULL}, {3, child_data_1, NCSS_NODE_LTEXTBS, "Jason", &demoBmp, -1, 0, NULL}, {3, child_data_1, NCSS_NODE_LTEXTBS, "Theseus", &demoBmp, -1, 0, NULL}, }; // END_OF_LISTDATA static void list_init (mDialogBox *dialog, PBITMAP bmp) { mList *dirObj = (mList*)ncsGetChildObj(dialog->hwnd, IDL_DIR); if (!dirObj) return; // START_OF_ADDNODES _c(dirObj)->freeze(dirObj, TRUE); _c(dirObj)->setProperty(dirObj, NCSP_LIST_LAYOUT, NCS_LIST_LICONV); _c(dirObj)->setNodeDefSize(dirObj, 52, 52); ncsSetMenuData((mObject*)dirObj, data, sizeof(data)/sizeof(NCS_MENU_DATA)); _c(dirObj)->setCurSel(dirObj, 0); _c(dirObj)->freeze(dirObj, FALSE); // END_OF_ADDNODES } static NCS_PROP_ENTRY static_props [] = { {NCSP_STATIC_ALIGN, NCS_ALIGN_LEFT}, {0, 0} }; static void list_notify(mWidget *self, int id, int nc, DWORD add_data) { mStatic *staticObj = (mStatic*)ncsGetChildObj(GetParent(self->hwnd), IDC_STATIC); mList *lstObj = (mList *)self; if (nc == NCSN_LIST_ENTERSUBLIST) { // START_OF_CHANGE_LAYOUT mNode *selNode = (mNode*)add_data; _c(lstObj)->setProperty(lstObj, NCSP_LIST_LAYOUT, NCS_LIST_LLIST); // END_OF_CHANGE_LAYOUT if (selNode && staticObj) { SetWindowText(staticObj->hwnd, _c(selNode)->getText(selNode)); } } else if (nc == NCSN_LIST_BACKUPLIST) { _c(lstObj)->setProperty(lstObj, NCSP_LIST_LAYOUT, NCS_LIST_LICONV); _c(lstObj)->setNodeDefSize(lstObj, 52, 52); SetWindowText(staticObj->hwnd, caption); } } static NCS_EVENT_HANDLER list_handlers [] = { NCS_MAP_NOTIFY(NCSN_LIST_ENTERSUBLIST, list_notify), NCS_MAP_NOTIFY(NCSN_LIST_BACKUPLIST, list_notify), {0, NULL} }; static NCS_WND_TEMPLATE _ctrl_tmpl[] = { { NCSCTRL_STATIC, IDC_STATIC, 0, 0, 160, 15, WS_VISIBLE, WS_EX_NONE, caption, static_props, NULL, NULL, NULL, 0, 0 }, { NCSCTRL_LIST, IDL_DIR, 0, 20, 166, 188, WS_BORDER | WS_TABSTOP | WS_VISIBLE | NCSS_NOTIFY | NCSS_LIST_LOOP | NCSS_ASTLST_AUTOSORT, WS_EX_NONE, "", NULL, NULL, list_handlers, NULL, 0, 0 } }; static NCS_MNWND_TEMPLATE mainwnd_tmpl = { NCSCTRL_DIALOGBOX, 7, 100, 100, 176, 250, WS_CAPTION | WS_BORDER | WS_VISIBLE, WS_EX_NONE, "List Demo", NULL, NULL, NULL, _ctrl_tmpl, sizeof(_ctrl_tmpl)/sizeof(NCS_WND_TEMPLATE), 0, 0, 0, }; int MiniGUIMain(int argc, const char* argv[]) { ncsInitialize(); mDialogBox* dialog = (mDialogBox *)ncsCreateMainWindowIndirect (&mainwnd_tmpl, HWND_DESKTOP); LoadBitmap(HDC_SCREEN, &demoBmp, "./res/listfolder.png"); list_init (dialog, &demoBmp); _c(dialog)->doModal(dialog, TRUE); UnloadBitmap(&demoBmp); ncsUninitialize(); return 0; } #else //_MGNCSCTRL_LIST int main (void) { printf("\n==========================================================\n"); printf("======== You haven't enable the list contorl =====\n"); printf("==========================================================\n"); printf("============== ./configure --enable-list ==========\n"); printf("==========================================================\n\n"); return 0; } #endif //_MGNCSCTRL_LIST
[ "dongjunjie@xiaomi.com" ]
dongjunjie@xiaomi.com
be8fac148fcda0e99cf6623381cc6d1cd57a3e02
555a8e34e8c32e8435be0ea29ffbd1527cd3b3fc
/tests/includes/ft_tests.h
bb315c2743d4b0e3d658b3c9e41ee9b82df64b05
[ "MIT" ]
permissive
kcosta42/Libftasm
5423f481945b086fcd56000530598dba6a8b7274
894ef6a9e2a6699bd3faa52c5be6e4478763b0d6
refs/heads/master
2020-03-27T21:51:39.693578
2019-03-11T10:16:49
2019-03-11T10:16:49
147,181,255
0
0
null
null
null
null
UTF-8
C
false
false
1,678
h
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_tests.h :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: kcosta <kcosta@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/09/10 18:45:22 by kcosta #+# #+# */ /* Updated: 2018/09/18 13:07:42 by kcosta ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef FT_TESTS # define FT_TESTS # include <ctype.h> # include <stdlib.h> # include <string.h> # include <stdio.h> # include <fcntl.h> # include <assert.h> # include <unistd.h> void ft_bzero_test(void); void ft_isalnum_test(void); void ft_isalpha_test(void); void ft_isascii_test(void); void ft_isblank_test(void); void ft_isdigit_test(void); void ft_islower_test(void); void ft_isprint_test(void); void ft_isspace_test(void); void ft_tolower_test(void); void ft_toupper_test(void); void ft_memcpy_test(void); void ft_memset_test(void); void ft_puts_test(void); void ft_strcat_test(void); void ft_strdup_test(void); void ft_strlen_test(void); void ft_strcpy_test(void); void ft_atoi_test(void); void ft_cat_test(void); void ft_putchar_test(void); void ft_putnbr_test(void); #endif
[ "kcosta@student.42.fr" ]
kcosta@student.42.fr
2056f16ea1d262c94c69c153630dc80443663eb4
61668f501e80a95b30d4ad7e3d06985a7e024a8f
/RECO/BUILD/MME/BUILD/CMakeFiles/R10.5/S1ap-E-RABToBeSetupItemCtxtSUReq.c
e3a133ee0d30b0761f349f654a9f04304d0d0891
[ "BSD-3-Clause", "BSD-2-Clause-Views", "Apache-2.0", "BSD-2-Clause" ]
permissive
linym/RECO_new
838a174140d84f251fd1ab623b3bc42b0c89b19a
af5581bbb114b7488b3a564d3bb73dad1cd4581d
refs/heads/master
2020-03-24T03:05:58.660441
2018-07-26T07:26:45
2018-07-26T07:26:45
142,404,717
1
0
null
null
null
null
UTF-8
C
false
false
4,419
c
/* * Generated by asn1c-0.9.24 (http://lionet.info/asn1c) * From ASN.1 module "S1AP-IEs" * found in "/RECO/SRC/S1AP/MESSAGES/ASN1/R10.5/S1AP-IEs.asn" * `asn1c -gen-PER` */ #include "S1ap-E-RABToBeSetupItemCtxtSUReq.h" static asn_TYPE_member_t asn_MBR_S1ap_E_RABToBeSetupItemCtxtSUReq_1[] = { { ATF_NOFLAGS, 0, offsetof(struct S1ap_E_RABToBeSetupItemCtxtSUReq, e_RAB_ID), (ASN_TAG_CLASS_CONTEXT | (0 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_E_RAB_ID, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "e-RAB-ID" }, { ATF_NOFLAGS, 0, offsetof(struct S1ap_E_RABToBeSetupItemCtxtSUReq, e_RABlevelQoSParameters), (ASN_TAG_CLASS_CONTEXT | (1 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_E_RABLevelQoSParameters, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "e-RABlevelQoSParameters" }, { ATF_NOFLAGS, 0, offsetof(struct S1ap_E_RABToBeSetupItemCtxtSUReq, transportLayerAddress), (ASN_TAG_CLASS_CONTEXT | (2 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_TransportLayerAddress, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "transportLayerAddress" }, { ATF_NOFLAGS, 0, offsetof(struct S1ap_E_RABToBeSetupItemCtxtSUReq, gTP_TEID), (ASN_TAG_CLASS_CONTEXT | (3 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_GTP_TEID, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "gTP-TEID" }, { ATF_POINTER, 2, offsetof(struct S1ap_E_RABToBeSetupItemCtxtSUReq, nAS_PDU), (ASN_TAG_CLASS_CONTEXT | (4 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_NAS_PDU, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "nAS-PDU" }, { ATF_POINTER, 1, offsetof(struct S1ap_E_RABToBeSetupItemCtxtSUReq, iE_Extensions), (ASN_TAG_CLASS_CONTEXT | (5 << 2)), -1, /* IMPLICIT tag at current level */ &asn_DEF_S1ap_IE_Extensions, 0, /* Defer constraints checking to the member type */ 0, /* No PER visible constraints */ 0, "iE-Extensions" }, }; static int asn_MAP_S1ap_E_RABToBeSetupItemCtxtSUReq_oms_1[] = { 4, 5 }; static ber_tlv_tag_t asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq_tags_1[] = { (ASN_TAG_CLASS_UNIVERSAL | (16 << 2)) }; static asn_TYPE_tag2member_t asn_MAP_S1ap_E_RABToBeSetupItemCtxtSUReq_tag2el_1[] = { { (ASN_TAG_CLASS_CONTEXT | (0 << 2)), 0, 0, 0 }, /* e-RAB-ID at 560 */ { (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 1, 0, 0 }, /* e-RABlevelQoSParameters at 561 */ { (ASN_TAG_CLASS_CONTEXT | (2 << 2)), 2, 0, 0 }, /* transportLayerAddress at 562 */ { (ASN_TAG_CLASS_CONTEXT | (3 << 2)), 3, 0, 0 }, /* gTP-TEID at 563 */ { (ASN_TAG_CLASS_CONTEXT | (4 << 2)), 4, 0, 0 }, /* nAS-PDU at 564 */ { (ASN_TAG_CLASS_CONTEXT | (5 << 2)), 5, 0, 0 } /* iE-Extensions at 565 */ }; static asn_SEQUENCE_specifics_t asn_SPC_S1ap_E_RABToBeSetupItemCtxtSUReq_specs_1 = { sizeof(struct S1ap_E_RABToBeSetupItemCtxtSUReq), offsetof(struct S1ap_E_RABToBeSetupItemCtxtSUReq, _asn_ctx), asn_MAP_S1ap_E_RABToBeSetupItemCtxtSUReq_tag2el_1, 6, /* Count of tags in the map */ asn_MAP_S1ap_E_RABToBeSetupItemCtxtSUReq_oms_1, /* Optional members */ 2, 0, /* Root/Additions */ 5, /* Start extensions */ 7 /* Stop extensions */ }; asn_TYPE_descriptor_t asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq = { "S1ap-E-RABToBeSetupItemCtxtSUReq", "S1ap-E-RABToBeSetupItemCtxtSUReq", SEQUENCE_free, SEQUENCE_print, SEQUENCE_constraint, SEQUENCE_decode_ber, SEQUENCE_encode_der, SEQUENCE_decode_xer, SEQUENCE_encode_xer, SEQUENCE_decode_uper, SEQUENCE_encode_uper, SEQUENCE_decode_aper, SEQUENCE_encode_aper, SEQUENCE_compare, 0, /* Use generic outmost tag fetcher */ asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq_tags_1, sizeof(asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq_tags_1) /sizeof(asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq_tags_1[0]), /* 1 */ asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq_tags_1, /* Same as above */ sizeof(asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq_tags_1) /sizeof(asn_DEF_S1ap_E_RABToBeSetupItemCtxtSUReq_tags_1[0]), /* 1 */ 0, /* No PER visible constraints */ asn_MBR_S1ap_E_RABToBeSetupItemCtxtSUReq_1, 6, /* Elements count */ &asn_SPC_S1ap_E_RABToBeSetupItemCtxtSUReq_specs_1 /* Additional specs */ };
[ "rexlin2012001@gmail.com" ]
rexlin2012001@gmail.com
806ec66e142c94c6280bf5ffa8f4497ebc5542cb
976f5e0b583c3f3a87a142187b9a2b2a5ae9cf6f
/source/linux/net/sched/extr_sch_qfq.c_agg_dequeue.c
c30f4558ff0a0126cd6219c01bc8cc648eec6227
[]
no_license
isabella232/AnghaBench
7ba90823cf8c0dd25a803d1688500eec91d1cf4e
9a5f60cdc907a0475090eef45e5be43392c25132
refs/heads/master
2023-04-20T09:05:33.024569
2021-05-07T18:36:26
2021-05-07T18:36:26
null
0
0
null
null
null
null
UTF-8
C
false
false
1,525
c
#define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct qfq_class {scalar_t__ deficit; int /*<<< orphan*/ alist; TYPE_3__* qdisc; } ; struct qfq_aggregate {scalar_t__ lmax; int /*<<< orphan*/ active; } ; struct TYPE_6__ {scalar_t__ qlen; } ; struct TYPE_7__ {TYPE_1__* ops; TYPE_2__ q; } ; struct TYPE_5__ {int /*<<< orphan*/ (* peek ) (TYPE_3__*) ;} ; /* Variables and functions */ int /*<<< orphan*/ list_del (int /*<<< orphan*/ *) ; int /*<<< orphan*/ list_move_tail (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ qdisc_dequeue_peeked (TYPE_3__*) ; scalar_t__ qdisc_pkt_len (int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub1 (TYPE_3__*) ; __attribute__((used)) static void agg_dequeue(struct qfq_aggregate *agg, struct qfq_class *cl, unsigned int len) { qdisc_dequeue_peeked(cl->qdisc); cl->deficit -= (int) len; if (cl->qdisc->q.qlen == 0) /* no more packets, remove from list */ list_del(&cl->alist); else if (cl->deficit < qdisc_pkt_len(cl->qdisc->ops->peek(cl->qdisc))) { cl->deficit += agg->lmax; list_move_tail(&cl->alist, &agg->active); } }
[ "brenocfg@gmail.com" ]
brenocfg@gmail.com
2f91ea9fd38c2b43b312f5c57c0388297e5cc110
aa41bf52467aae0452a7783a0953341b793cce79
/eran/ELINA/elina_zonotope/elina_box_internal.c
5f4c26b6fa7379a6c0c3a370ae0e7f8cc4c93aa6
[ "Apache-2.0" ]
permissive
yqtianust/ReluDiff-ICSE2020-Artifact
ecf106e90793395d8d296b38828d65dc3e443aab
149f6efe4799602db749faa576980c36921a07c7
refs/heads/master
2021-03-21T18:19:19.172856
2020-01-22T00:11:27
2020-01-22T00:11:27
247,319,555
1
0
Apache-2.0
2020-03-14T17:12:17
2020-03-14T17:12:17
null
UTF-8
C
false
false
5,886
c
/* * * This source file is part of ELINA (ETH LIbrary for Numerical Analysis). * ELINA is Copyright © 2019 Department of Computer Science, ETH Zurich * This software is distributed under GNU Lesser General Public License Version 3.0. * For more information, see the ELINA project website at: * http://elina.ethz.ch * * THE SOFTWARE IS PROVIDED "AS-IS" WITHOUT ANY WARRANTY OF ANY KIND, EITHER * EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO ANY WARRANTY * THAT THE SOFTWARE WILL CONFORM TO SPECIFICATIONS OR BE ERROR-FREE AND ANY * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, * TITLE, OR NON-INFRINGEMENT. IN NO EVENT SHALL ETH ZURICH BE LIABLE FOR ANY * DAMAGES, INCLUDING BUT NOT LIMITED TO DIRECT, INDIRECT, * SPECIAL OR CONSEQUENTIAL DAMAGES, ARISING OUT OF, RESULTING FROM, OR IN * ANY WAY CONNECTED WITH THIS SOFTWARE (WHETHER OR NOT BASED UPON WARRANTY, * CONTRACT, TORT OR OTHERWISE). * */ #include <string.h> #include <stdio.h> #include "elina_box_internal.h" void elina_box_internal_init(elina_box_internal_t* intern) { intern->bound_linexpr_internal_itv = elina_interval_alloc(); intern->bound_linexpr_internal_itv2 = elina_interval_alloc(); intern->bound_linexpr_itv= elina_interval_alloc(); intern->meet_lincons_internal_itv = elina_interval_alloc(); intern->meet_lincons_internal_itv2 = elina_interval_alloc(); intern->meet_lincons_internal_itv3 = elina_interval_alloc(); intern->meet_lincons_internal_bound = elina_scalar_alloc(); } void elina_box_internal_clear(elina_box_internal_t* intern) { elina_interval_free(intern->bound_linexpr_internal_itv); elina_interval_free(intern->bound_linexpr_internal_itv2); elina_interval_free(intern->bound_linexpr_itv); elina_interval_free(intern->meet_lincons_internal_itv); elina_interval_free(intern->meet_lincons_internal_itv2); elina_interval_free(intern->meet_lincons_internal_itv3); elina_scalar_free(intern->meet_lincons_internal_bound); } elina_box_internal_t* elina_box_internal_alloc(void) { elina_box_internal_t* intern = malloc(sizeof(elina_box_internal_t)); elina_box_internal_init(intern); return intern; } void elina_box_internal_free(elina_box_internal_t* intern) { elina_box_internal_clear(intern); free(intern); } elina_manager_t* elina_box_manager_alloc(void) { size_t i; elina_box_internal_t* itv; elina_manager_t* man; void** funptr; if (!elina_fpu_init()) { fprintf(stderr,"elina_box_manager_alloc cannot change the FPU rounding mode\n"); } itv = elina_box_internal_alloc(); man = elina_manager_alloc("elina box", "1.0 with DOUBLE ", itv, (void (*)(void*))elina_box_internal_free); funptr = man->funptr; funptr[ELINA_FUNID_COPY] = &elina_box_copy; funptr[ELINA_FUNID_FREE] = &elina_box_free; //funptr[ELINA_FUNID_ASIZE] = &elina_box_size; //funptr[ELINA_FUNID_MINIMIZE] = &elina_box_minimize; //funptr[ELINA_FUNID_CANONICALIZE] = &elina_box_canonicalize; //funptr[ELINA_FUNID_HASH] = &elina_box_hash; //funptr[ELINA_FUNID_APPROXIMATE] = &elina_box_approximate; funptr[ELINA_FUNID_FPRINT] = &elina_box_fprint; //funptr[ELINA_FUNID_FPRINTDIFF] = &elina_box_fprintdiff; //funptr[ELINA_FUNID_FDUMP] = &elina_box_fdump; //funptr[ELINA_FUNID_SERIALIZE_RAW] = &elina_box_serialize_raw; //funptr[ELINA_FUNID_DESERIALIZE_RAW] = &elina_box_deserialize_raw; funptr[ELINA_FUNID_BOTTOM] = &elina_box_bottom; funptr[ELINA_FUNID_TOP] = &elina_box_top; funptr[ELINA_FUNID_OF_BOX] = &elina_box_of_box; funptr[ELINA_FUNID_DIMENSION] = &elina_box_dimension; funptr[ELINA_FUNID_IS_BOTTOM] = &elina_box_is_bottom; funptr[ELINA_FUNID_IS_TOP] = &elina_box_is_top; funptr[ELINA_FUNID_IS_LEQ] = &elina_box_is_leq; funptr[ELINA_FUNID_IS_EQ] = &elina_box_is_eq; //funptr[ELINA_FUNID_IS_DIMENSION_UNCONSTRAINED] = &elina_box_is_dimension_unconstrained; //funptr[ELINA_FUNID_SAT_INTERVAL] = &elina_box_sat_interval; //funptr[ELINA_FUNID_SAT_LINCONS] = &elina_box_sat_lincons; //funptr[ELINA_FUNID_SAT_TCONS] = &elina_box_sat_tcons; funptr[ELINA_FUNID_BOUND_DIMENSION] = &elina_box_bound_dimension; funptr[ELINA_FUNID_BOUND_LINEXPR] = &elina_box_bound_linexpr; //funptr[ELINA_FUNID_BOUND_TEXPR] = &elina_box_bound_texpr; funptr[ELINA_FUNID_TO_BOX] = &elina_box_to_box; funptr[ELINA_FUNID_TO_LINCONS_ARRAY] = &elina_box_to_lincons_array; //funptr[ELINA_FUNID_TO_TCONS_ARRAY] = &elina_box_to_tcons_array; //funptr[ELINA_FUNID_TO_GENERATOR_ARRAY] = &elina_box_to_generator_array; funptr[ELINA_FUNID_MEET] = &elina_box_meet; //funptr[ELINA_FUNID_MEET_ARRAY] = &elina_box_meet_array; funptr[ELINA_FUNID_MEET_LINCONS_ARRAY] = &elina_box_meet_lincons_array; //funptr[ELINA_FUNID_MEET_TCONS_ARRAY] = &elina_box_meet_tcons_array; funptr[ELINA_FUNID_JOIN] = &elina_box_join; //funptr[ELINA_FUNID_JOIN_ARRAY] = &elina_box_join_array; //funptr[ELINA_FUNID_ADD_RAY_ARRAY] = &elina_box_add_ray_array; funptr[ELINA_FUNID_ASSIGN_LINEXPR_ARRAY] = &elina_box_assign_linexpr_array; //funptr[ELINA_FUNID_SUBSTITUTE_LINEXPR_ARRAY] = &elina_box_substitute_linexpr_array; //funptr[ELINA_FUNID_ASSIGN_TEXPR_ARRAY] = &elina_box_assign_texpr_array; //funptr[ELINA_FUNID_SUBSTITUTE_TEXPR_ARRAY] = &elina_box_substitute_texpr_array; funptr[ELINA_FUNID_ADD_DIMENSIONS] = &elina_box_add_dimensions; funptr[ELINA_FUNID_REMOVE_DIMENSIONS] = &elina_box_remove_dimensions; funptr[ELINA_FUNID_PERMUTE_DIMENSIONS] = &elina_box_permute_dimensions; funptr[ELINA_FUNID_FORGET_ARRAY] = &elina_box_forget_array; //funptr[ELINA_FUNID_EXPAND] = &elina_box_expand; //funptr[ELINA_FUNID_FOLD] = &elina_box_fold; funptr[ELINA_FUNID_WIDENING] = &elina_box_widening; //funptr[ELINA_FUNID_CLOSURE] = &elina_box_closure; for (i=0; i<ELINA_EXC_SIZE; i++){ elina_manager_set_abort_if_exception(man, i, false); } return man; }
[ "bpaulsen@usc.edu" ]
bpaulsen@usc.edu
e13edfbb2e444ef52d2d45d746461d88bc43f8e7
5c255f911786e984286b1f7a4e6091a68419d049
/vulnerable_code/80f483ef-c23a-43f3-a025-21cfff7e31c6.c
ac8f507c17dfe1774a881e4b4bfef91a25dbd258
[]
no_license
nmharmon8/Deep-Buffer-Overflow-Detection
70fe02c8dc75d12e91f5bc4468cf260e490af1a4
e0c86210c86afb07c8d4abcc957c7f1b252b4eb2
refs/heads/master
2021-09-11T19:09:59.944740
2018-04-06T16:26:34
2018-04-06T16:26:34
125,521,331
0
0
null
null
null
null
UTF-8
C
false
false
578
c
#include <string.h> #include <stdio.h> int main() { int i=0; int j=12; int k; int l; k = 53; l = 14; k = i/j; l = i/j; l = i/j; l = l%j; l = l-j; k = k-k*i; //variables //random /* START VULNERABILITY */ int a; char b[82]; char c[10]; a = 0; do { a++; /* START BUFFER SET */ *((char *)c + ( a - 1 )) = *((char *)b + ( a - 1 )); /* END BUFFER SET */ } while(( a - 1 ) < strlen(b)); /* END VULNERABILITY */ printf("%d%d\n",k,l); return 0; }
[ "nharmon8@gmail.com" ]
nharmon8@gmail.com
3cdfa2c315d03854069db29205e4eed436a06469
89b7e4a17ae14a43433b512146364b3656827261
/testcases/CWE122_Heap_Based_Buffer_Overflow/s05/CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68a.c
74041e3ce2c72ceb7c6084a5d0c1f0569cbb1f04
[]
no_license
tuyen1998/Juliet_test_Suite
7f50a3a39ecf0afbb2edfd9f444ee017d94f99ee
4f968ac0376304f4b1b369a615f25977be5430ac
refs/heads/master
2020-08-31T23:40:45.070918
2019-11-01T07:43:59
2019-11-01T07:43:59
218,817,337
0
1
null
null
null
null
UTF-8
C
false
false
2,605
c
/* TEMPLATE GENERATED TESTCASE FILE Filename: CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68a.c Label Definition File: CWE122_Heap_Based_Buffer_Overflow__CWE131.label.xml Template File: sources-sink-68a.tmpl.c */ /* * @description * CWE: 122 Heap Based Buffer Overflow * BadSource: Allocate memory without using sizeof(int) * GoodSource: Allocate memory using sizeof(int) * Sink: loop * BadSink : Copy array to data using a loop * Flow Variant: 68 Data flow: data passed as a global variable from one function to another in different source files * * */ #include "std_testcase.h" int * CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_badData; int * CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_goodG2BData; #ifndef OMITBAD /* bad function declaration */ void CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68b_badSink(); void CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_bad() { int * data; data = NULL; /* FLAW: Allocate memory without using sizeof(int) */ data = (int *)malloc(10); if (data == NULL) {exit(-1);} CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_badData = data; CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68b_badSink(); } #endif /* OMITBAD */ #ifndef OMITGOOD /* good function declarations */ void CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68b_goodG2BSink(); /* goodG2B uses the GoodSource with the BadSink */ static void goodG2B() { int * data; data = NULL; /* FIX: Allocate memory using sizeof(int) */ data = (int *)malloc(10*sizeof(int)); if (data == NULL) {exit(-1);} CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_goodG2BData = data; CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68b_goodG2BSink(); } void CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_good() { goodG2B(); } #endif /* OMITGOOD */ /* Below is the main(). It is only used when building this testcase on * its own for testing or for building a binary to use in testing binary * analysis tools. It is not used when compiling all the testcases as one * application, which is how source code analysis tools are tested. */ #ifdef INCLUDEMAIN int main(int argc, char * argv[]) { /* seed randomness */ srand( (unsigned)time(NULL) ); #ifndef OMITGOOD printLine("Calling good()..."); CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_good(); printLine("Finished good()"); #endif /* OMITGOOD */ #ifndef OMITBAD printLine("Calling bad()..."); CWE122_Heap_Based_Buffer_Overflow__CWE131_loop_68_bad(); printLine("Finished bad()"); #endif /* OMITBAD */ return 0; } #endif
[ "35531872+tuyen1998@users.noreply.github.com" ]
35531872+tuyen1998@users.noreply.github.com
191e6e0c3d9b2a213358651dd18aabc5486081d7
dd80a584130ef1a0333429ba76c1cee0eb40df73
/frameworks/native/libs/diskusage/dirsize.c
24e5af02ab4206a8a3d2f6b9942e24e1bc95d3aa
[ "LicenseRef-scancode-unicode", "Apache-2.0", "MIT" ]
permissive
karunmatharu/Android-4.4-Pay-by-Data
466f4e169ede13c5835424c78e8c30ce58f885c1
fcb778e92d4aad525ef7a995660580f948d40bc9
refs/heads/master
2021-03-24T13:33:01.721868
2017-02-18T17:48:49
2017-02-18T17:48:49
81,847,777
0
2
MIT
2020-03-09T00:02:12
2017-02-13T16:47:00
null
UTF-8
C
false
false
1,939
c
/* * * Copyright (C) 2008, The Android Open Source Project * * 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. */ #include <dirent.h> #include <fcntl.h> #include <sys/stat.h> #include <diskusage/dirsize.h> int64_t stat_size(struct stat *s) { int64_t blksize = s->st_blksize; // count actual blocks used instead of nominal file size int64_t size = s->st_blocks * 512; if (blksize) { /* round up to filesystem block size */ size = (size + blksize - 1) & (~(blksize - 1)); } return size; } int64_t calculate_dir_size(int dfd) { int64_t size = 0; struct stat s; DIR *d; struct dirent *de; d = fdopendir(dfd); if (d == NULL) { close(dfd); return 0; } while ((de = readdir(d))) { const char *name = de->d_name; if (fstatat(dfd, name, &s, AT_SYMLINK_NOFOLLOW) == 0) { size += stat_size(&s); } if (de->d_type == DT_DIR) { int subfd; /* always skip "." and ".." */ if (name[0] == '.') { if (name[1] == 0) continue; if ((name[1] == '.') && (name[2] == 0)) continue; } subfd = openat(dfd, name, O_RDONLY | O_DIRECTORY); if (subfd >= 0) { size += calculate_dir_size(subfd); } } } closedir(d); return size; }
[ "karun.matharu@gmail.com" ]
karun.matharu@gmail.com
d2ee0d60e8dd58a69cbdc10f37a911fdb427d177
40288c3fc1b28f5561adc5857a931ebd3bd7b787
/coding_solutions/Kth_Digit.c
9228a180e56a708f8a3333e830dbf106e0b3e878
[]
no_license
alvas-education-foundation/Laxman_Budihal
4da94cf89d7896a74152873606761ec231c0aeb2
c1ab4e2550249088a94ee413fcf8ecbf0e4df7a0
refs/heads/master
2022-11-20T09:18:27.459352
2020-07-15T08:57:26
2020-07-15T08:57:26
265,616,938
0
0
null
null
null
null
UTF-8
C
false
false
988
c
/* Write a C program to print kth digit Given two numbers a and b, find kth digit from right of a^b. Input: The first line of the input contains T denoting the number of test cases.Each of the next T lines contains three space separated positive integers denoting the value of a , b and k respectively. Output: For each test case, output the kth digit from right of a^b in new line. Constraints: 1<=T<=100 1<=a , b <=15 1<=k<=|totaldigits in a^b| Example: Input: 2 3 3 1 5 2 2 Output: 7 2 Hint Output: 1 Explanation 3^3 = 27 for k = 1. First digit is 7 in 27 Output : 2 Explanation 5^2 = 25 for k = 2. First digit is 2 in 25 */ #include<math.h> int main() { int t; scanf("%d",&t); while(t--) { long int a,b,p,c=0,r,i,k; scanf("%ld %ld %ld",&a,&b,&k); p=pow(a,b); while(p>0) { r=p%10; c++; if(c==k) { printf("%d\n",r); break; } p=p/10; } } return 0; }
[ "you@example.com" ]
you@example.com
19e7aef24f689d89d9dda3aeb191ef24943fb78b
e246a3202f66f4e4429495819ce9b468224d65ca
/fillit/libft/ft_strtrim.c
383ccaecd8c4a0b559d505fca2be8b5df703bad9
[]
no_license
owalid/42_cursus
ea65bafd188fbfff1667191ebc6f310c6d8dc706
5aac99c75224f84db6444ba9d980cd88d2d6265a
refs/heads/master
2021-06-18T17:05:11.779721
2021-01-27T17:23:40
2021-01-27T17:23:40
156,719,000
3
0
null
null
null
null
UTF-8
C
false
false
1,368
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_strtrim.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: clfoltra <clfoltra@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/11/07 17:51:05 by clfoltra #+# #+# */ /* Updated: 2018/11/13 19:00:16 by clfoltra ### ########.fr */ /* */ /* ************************************************************************** */ #include "libft.h" char *ft_strtrim(char const *s) { char *res; int len; int i; if (!s) return (NULL); len = ft_strlen(s); while (s[len - 1] == ' ' || s[len - 1] == '\t' || s[len - 1] == '\n') len--; i = -1; while (s[++i] == ' ' || s[i] == '\t' || s[i] == '\n') len--; len = (len < 0) ? 0 : len; if (!(res = (char*)malloc(sizeof(res) * (len + 1)))) return (NULL); s = s + i; i = -1; while (++i < len) res[i] = *s++; res[i] = '\0'; return (res); }
[ "othmane.el.ayadi@gmail.com" ]
othmane.el.ayadi@gmail.com
1023e0dc892f28fd6e3a1c3ddb0ed881d8c37c19
d83dc5939b71af65706d02d07a1fea2eb06d53d6
/lib/instances/items/food/plants/fruit/red-apple.c
87221644c72fc33bfd893297e163936e9d97687f
[]
no_license
Yuffster/core-lib
e30c170826380e3074810adb6ab42a55fab3329d
5d9bb20d0956a5262b4d71fb62925da6fd7cb487
refs/heads/master
2023-03-08T06:26:11.980952
2021-02-19T22:48:39
2021-02-19T22:48:39
null
0
0
null
null
null
null
UTF-8
C
false
false
638
c
//***************************************************************************** // Copyright (c) 2021 - Allen Cummings, RealmsMUD, All rights reserved. See // the accompanying LICENSE file for details. //***************************************************************************** virtual inherit "/lib/items/food.c"; ///////////////////////////////////////////////////////////////////////////// public void reset(int arg) { if (!arg) { set("name", "Red Apple"); set("short", "Red Apple"); set("aliases", ({ "red apple", "apple" })); set("blueprint", "red apple"); } }
[ "abc@maelstrom.cc" ]
abc@maelstrom.cc
cec9ba905a5b50bb9aa47c6c23e828585e240b88
9d88d27c9ddecf74a8d63b47e7040db24aa5c9ee
/第十三章/编程练习/6.c
40daacef055d7b0bbb4b84e9be79a81acedc1e0a
[]
no_license
triplekill/C-Primer-Plus-Demo
1e845944306797f3e4576c3f0abb0e0bd28dba94
09602dd7c1ae5307b15416d1aa9240e4ee9f834d
refs/heads/master
2021-01-21T16:15:30.940777
2016-03-09T05:17:20
2016-03-09T05:17:20
null
0
0
null
null
null
null
UTF-8
C
false
false
697
c
#include <stdio.h> #include <stdlib.h> #include <string.h> #define LEN 40 int main() { FILE *in, *out; int ch; char file_in[LEN]; char file_out[LEN]; int count = 0; printf("Please enter a filename: "); gets(file_in); if ((in = fopen(file_in, "r")) == NULL) { fprintf(stderr, "I couldn't open the file \" %s \"\n", file_in); exit(2); } strcpy(file_out, file_in); strcat(file_out, ".red"); if ((out = fopen(file_out, "w")) == NULL) { fprintf(stderr, "Can't create output file.\n"); exit(3); } while ((ch = getc(in)) != EOF) if (count++ % 3 == 0) putc(ch, out); if (fclose(in) != 0 || fclose(out) != 0) fprintf(stderr, "Error in closing files.\n"); return 0; }
[ "a471558277@gmail.com" ]
a471558277@gmail.com
6bd2c7f499ccaebd161701da9e7362a55e03228a
7169f251067c54b4572f1dfafad839260a592244
/day008/day10/06全局函数和静态函数.c
abf216b1b179cd78a7618381243953a8c3817051
[]
no_license
mengjiaoliwang/window-file-C
fc2393dc1431c242bdeeb971ef65b62485fc102f
edb693c213259fc85d374877df1e0d344ba07a54
refs/heads/master
2021-08-08T16:26:30.849148
2017-11-10T17:46:35
2017-11-10T17:46:35
110,272,951
0
0
null
null
null
null
GB18030
C
false
false
541
c
#define _CRT_SECURE_NO_WARNINGS #include<stdio.h> #include<string.h> #include<stdlib.h> #include<math.h> //如果在函数定义时,没有任何修饰就成为全局函数 //作用域:整个项目中所有文件 //生命周期:程序运行期间 void fun07() { return; } /*静态函数 作用域:当前文件中 生命周期:程序运行期间 */ static int fun08() { printf("hello world\n"); return 1; } void fun09() { int val = fun08(); printf("%d\n", val); } int main06() { //fun09(); fun10(); return EXIT_SUCCESS; }
[ "mengjiao_liwang@yeah.net" ]
mengjiao_liwang@yeah.net
b48abe91cb91effe6c00ee9ad7bf37a8c045e3f2
6920e231ef2f07b803f744f38b771a2f6a50e567
/ft_printf/src/libft/ft_isprint.c
703c8a4fba4d47d583de5c719eb4bba7af74edad
[]
no_license
chaidama/Academy
c5626dccd3f6dc7ea63c1d01263e4febd6435ecb
2666b12234da601bd67bbd4af1aa154a4777c26a
refs/heads/master
2020-03-23T15:36:21.758279
2018-07-23T02:11:16
2018-07-23T02:11:16
141,761,236
0
0
null
null
null
null
UTF-8
C
false
false
955
c
/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_isprint.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: chaidama <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2018/03/28 14:21:38 by chaidama #+# #+# */ /* Updated: 2018/03/28 14:21:40 by chaidama ### ########.fr */ /* */ /* ************************************************************************** */ int ft_isprint(int c) { return (((unsigned)c - 32) < 95u); }
[ "haidamac.cristian@gmail.com" ]
haidamac.cristian@gmail.com
30f43bbf0e21dc162eee63027b1bc6416c0c52e2
25be3e86dfe6b104925859c6f931461ad809ef4d
/0x1D-search_algorithms/1-binary.c
2d38ba30838b1d5b3d0fda04d3a914ae4e3a9325
[]
no_license
lizzieturner/holbertonschool-low_level_programming
b580301c782a00601974c22225225259e59245ce
f3c53944d0742fc42479691add62d2ac04331d72
refs/heads/master
2018-10-09T16:13:28.793277
2018-08-20T20:02:41
2018-08-20T20:02:41
117,878,549
0
5
null
null
null
null
UTF-8
C
false
false
1,374
c
#include "search_algos.h" /** * binary_search - searchs for a value using binary search algorithm * @array: array to search in * @size: size of array * @value: value to search for * * Return: first index value is at, or -1 on failure */ int binary_search(int *array, size_t size, int value) { if (array) { return (recursive_binary(array, 0, size - 1, value)); } return (-1); } /** * recursive_binary - recursively searched for a value using binary search * @array: array to search in * @left: starting index * @right: ending index * @value: value to search for * * Return: index of value or -1 */ int recursive_binary(int *array, size_t left, size_t right, int value) { int mid = left + (right - left) / 2; print_binary(array, left, right); if (array[mid] == value) return (mid); if (right >= left) { if (array[mid] > value) return (recursive_binary(array, left, mid - 1, value)); return (recursive_binary(array, mid + 1, right, value)); } return (-1); } /** * print_binary - prints array with every call of recursive_binary * @array: array to print * @left: starting index * @right: ending index */ void print_binary(int *array, size_t left, size_t right) { if (left > right) return; printf("Searching in array: "); while (left < right) { printf("%u, ", array[left]); left++; } printf("%u\n", array[left]); }
[ "hello@lizzieturner.com" ]
hello@lizzieturner.com
bf952b1e232252e1fcd505f53f9add6d48feeafd
5c255f911786e984286b1f7a4e6091a68419d049
/vulnerable_code/70e37ea3-7ce9-4a59-a43f-6b13ead28ef6.c
385d9277b1ae7e15d37ab382a633ba4ad094574a
[]
no_license
nmharmon8/Deep-Buffer-Overflow-Detection
70fe02c8dc75d12e91f5bc4468cf260e490af1a4
e0c86210c86afb07c8d4abcc957c7f1b252b4eb2
refs/heads/master
2021-09-11T19:09:59.944740
2018-04-06T16:26:34
2018-04-06T16:26:34
125,521,331
0
0
null
null
null
null
UTF-8
C
false
false
554
c
#include <string.h> #include <stdio.h> int main() { int i=0; int j=12; int k; int l; k = 55; l = 64; k = i/j; l = i%j; l = l-j; k = l--*i; //variables /* START VULNERABILITY */ int a; int b[76]; int c[88]; a = 0; while (a > -1) { //random /* START BUFFER SET */ *((int *)c + a) = *((int *)b + a); /* END BUFFER SET */ //random a--; } /* END VULNERABILITY */ //random printf("%d%d\n",k,l); return 0; }
[ "nharmon8@gmail.com" ]
nharmon8@gmail.com
65f3250ff565a755c1e9c8f8379950320730653b
458beec325141f9a8ecda48eb3fa21f796b4eff1
/firmware/diskio.c
f467ff45e761d5e5f55e2187cfe97c13a37be0f5
[]
no_license
fenrir-naru/ninja-scan-light
fab8ec1fc33d72555a4712ca770e709bfcd59eba
5b3341691709cd27e0d04cd5dfb7b95455230864
refs/heads/master
2023-09-02T23:46:52.093737
2023-08-29T14:46:26
2023-08-29T14:46:26
17,513,403
36
43
null
2016-07-03T07:49:22
2014-03-07T12:33:37
C++
UTF-8
C
false
false
2,904
c
/* * Copyright (c) 2013, M.Naruoka (fenrir) * 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 naruoka.org 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 HOLDER OR 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. * */ #include <string.h> #include "mmc.h" #include "type.h" #include "diskio.h" DSTATUS disk_initialize (BYTE drive){ if(drive != 0){return STA_NODISK;} mmc_init(); return mmc_initialized ? RES_OK : RES_NOTRDY; } DSTATUS disk_status (BYTE drive){ return (drive == 0) ? RES_OK : RES_NOTRDY; } DRESULT disk_read (BYTE drive, BYTE *buf, DWORD start_sector, BYTE sectors){ if(drive != 0){return RES_NOTRDY;} while(sectors--){ if(mmc_read(start_sector, buf) != MMC_NORMAL){ mmc_get_status(); return RES_ERROR; } } return RES_OK; } #if _USE_IOCTL DRESULT disk_ioctl (BYTE drive, BYTE ctrl, void *buff){ if(drive != 0){return RES_NOTRDY;} switch(ctrl){ case CTRL_SYNC : if(mmc_flush() != MMC_NORMAL){return RES_ERROR;} break; case GET_SECTOR_COUNT : *(DWORD *)buff = mmc_physical_sectors; break; case GET_SECTOR_SIZE : *(u16 *)buff = mmc_block_length; break; default: return RES_PARERR; } return RES_OK; } #endif #if _USE_WRITE DRESULT disk_write (BYTE drive, const BYTE *buf, DWORD start_sector, BYTE sectors){ if(drive != 0){return STA_NODISK;} while(sectors--){ if(mmc_write(start_sector, buf) != MMC_NORMAL){ mmc_get_status(); return RES_ERROR; } } return RES_OK; } #endif
[ "fenrir.naru@gmail.com" ]
fenrir.naru@gmail.com