hexsha stringlengths 40 40 | size int64 5 1.05M | ext stringclasses 588
values | lang stringclasses 305
values | max_stars_repo_path stringlengths 3 363 | max_stars_repo_name stringlengths 5 118 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count float64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringdate 2015-01-01 00:00:35 2022-03-31 23:43:49 ⌀ | max_stars_repo_stars_event_max_datetime stringdate 2015-01-01 12:37:38 2022-03-31 23:59:52 ⌀ | max_issues_repo_path stringlengths 3 363 | max_issues_repo_name stringlengths 5 118 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count float64 1 134k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 363 | max_forks_repo_name stringlengths 5 135 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count float64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringdate 2015-01-01 00:01:02 2022-03-31 23:27:27 ⌀ | max_forks_repo_forks_event_max_datetime stringdate 2015-01-03 08:55:07 2022-03-31 23:59:24 ⌀ | content stringlengths 5 1.05M | avg_line_length float64 1.13 1.04M | max_line_length int64 1 1.05M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e4c639e889f4811b0d0b2eacd5a520a67e509413 | 965 | c | C | src/ghjson.c | iannsp/githubit | b9851ec4db27fcf62440fc8af6cbff39b6b62725 | [
"BSD-3-Clause"
] | 2 | 2016-02-29T04:15:02.000Z | 2016-04-19T13:00:58.000Z | src/ghjson.c | iannsp/githubit | b9851ec4db27fcf62440fc8af6cbff39b6b62725 | [
"BSD-3-Clause"
] | null | null | null | src/ghjson.c | iannsp/githubit | b9851ec4db27fcf62440fc8af6cbff39b6b62725 | [
"BSD-3-Clause"
] | null | null | null | #include <stdlib.h>
#include <string.h>
#include "ghtype.h"
#include "ghcurl.h"
#include "ghstuff.h"
#include <jansson.h>
json_t* getValueOf(json_t *json, char* name)
{
json_t *item;
item = json;
item = json_object_get(item, name);
return item;
}
void ghstringparse(ghout *out)
{
json_t *root, *message;
json_error_t error;
root = json_loads(out->content, 0, &error);
out->json = malloc(sizeof(root));
if (!out->json) {
printf("ERROR in json Data:%s.\n",error.text);
exit(EXIT_FAILURE);
}
message = getValueOf(root, "message");
if (json_is_object(message)){
printf("message: %s\n", json_string_value(message));
}
out->json = root;
}
json_t* getJsonItensbyName(ghout *out, char *nodename)
{
json_t *itens;
json_error_t error;
itens = json_object_get(out->json, nodename);
if(!json_is_array(itens))
{
return NULL;
}
return itens;
}
| 21.931818 | 60 | 0.614508 |
b803b897516b422cb71c1c4aac87c2a0426a4039 | 3,906 | h | C | source/igd/src/inc/igd_utility.h | junnanx/rdkb-Utopia | 88cec7b166bf0379d498c04248b9712424e2c0ad | [
"Apache-2.0"
] | 5 | 2017-08-08T08:04:18.000Z | 2020-03-11T16:19:43.000Z | source/igd/src/inc/igd_utility.h | junnanx/rdkb-Utopia | 88cec7b166bf0379d498c04248b9712424e2c0ad | [
"Apache-2.0"
] | 1 | 2021-11-24T02:13:21.000Z | 2021-11-24T02:13:21.000Z | source/igd/src/inc/igd_utility.h | junnanx/rdkb-Utopia | 88cec7b166bf0379d498c04248b9712424e2c0ad | [
"Apache-2.0"
] | 7 | 2018-08-16T18:59:09.000Z | 2021-11-23T05:04:33.000Z | /*
* If not stated otherwise in this file or this component's Licenses.txt file the
* following copyright and licenses apply:
*
* Copyright 2015 RDK Management
*
* 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.
*/
/**********************************************************************
Copyright [2014] [Cisco Systems, Inc.]
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.
**********************************************************************/
/*
* FileName: wan_connection_device_internal.h
* Author: Tao Hong(tahong@cisco.com)
* Date: 2009-05-03
* Description: WAN connection Device inner used header file of UPnP IGD project
*****************************************************************************/
/*$Id: igd_utility.h,v 1.6 2009/05/21 06:27:43 jianxiao Exp $
*
*$Log: igd_utility.h,v $
*Revision 1.6 2009/05/21 06:27:43 jianxiao
*Add struct device_and_service_index
*
*Revision 1.5 2009/05/15 08:00:20 bowan
*1st Integration
*
*Revision 1.3 2009/05/14 02:36:37 jianxiao
*Add the header string.h
*
*Revision 1.2 2009/05/14 01:47:55 jianxiao
*Add the macro SAFE_FREE
*
*Revision 1.1 2009/05/13 08:57:57 tahong
*create orignal version
*
*
**/
#ifndef WAN_CONNECTION_DEVICE_INTERNAL_H
#define WAN_CONNECTION_DEVICE_INTERNAL_H
#include <string.h>
#include "pal_upnp_device.h"
#include "pal_def.h"
#define INVALID_DEVICE_UUID 720
#define INVALID_SERVICE_ID 721
#define INVALID_CONN_SERVICE_SELECTION 723
#define ACTION_FAIL 501
#define INVALID_ARGS 402
#define LOG_IGD_NAME "IGD"
#define SAFE_FREE(p) if(p!=NULL){\
free(p);\
p=NULL;}
struct device_and_service_index{
INT32 wan_device_index; //begin from 1
INT32 wan_connection_device_index; //begin from 1
INT32 wan_connection_service_index; //begin from 1
INT32 lan_device_index; //begin from 1
};
//for timer
enum timer_function_mode
{
timer_function_mode_run_once = 0,
timer_function_mode_cycle
};
typedef VOID (*timer_function_t)(struct upnp_device *input_upnp_device, struct upnp_service *input_upnp_service);
struct timer_function_node
{
struct upnp_device * upnp_device;
struct upnp_service * upnp_service;
timer_function_t timer_function;
INT32 trigger_second;
INT32 accumulate_second;
INT32 mode;
struct timer_function_node* next;
};
extern VOID IGD_timer_start(VOID);
extern VOID IGD_timer_stop(VOID);
extern VOID IGD_timer_register(IN struct upnp_device * input_upnp_device,
IN struct upnp_service * input_upnp_service,
IN timer_function_t input_timer_function,
IN INT32 input_trigger_second,
IN INT32 input_mode);
extern BOOL chkPortMappingClient(char* client);
#endif /*WAN_CONNECTION_DEVICE_INTERNAL_H*/
| 32.280992 | 113 | 0.673835 |
f8ac28f1d9a9e0e7a3f1b9841d4765b4253613db | 2,543 | h | C | System/Library/PrivateFrameworks/HomeUI.framework/HURemoteAccessItemManager.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 2 | 2021-11-02T09:23:27.000Z | 2022-03-28T08:21:57.000Z | System/Library/PrivateFrameworks/HomeUI.framework/HURemoteAccessItemManager.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/HomeUI.framework/HURemoteAccessItemManager.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 1 | 2022-03-28T08:21:59.000Z | 2022-03-28T08:21:59.000Z | /*
* This header is generated by classdump-dyld 1.5
* on Wednesday, October 27, 2021 at 3:22:28 PM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/HomeUI.framework/HomeUI
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
#import <Home/HFItemManager.h>
#import <libobjc.A.dylib/HUUserItemManager.h>
@class HFItem, HMHome, HFUserItem, HMUser, NSString;
@interface HURemoteAccessItemManager : HFItemManager <HUUserItemManager> {
HFItem* _allowRemoteAccessItem;
HFItem* _allowRemoteAccessFooterItem;
HMHome* _homeForUser;
HFItem* _removeItem;
}
@property (nonatomic,retain) HMHome * homeForUser; //@synthesize homeForUser=_homeForUser - In the implementation block
@property (nonatomic,retain) HFItem * allowRemoteAccessItem; //@synthesize allowRemoteAccessItem=_allowRemoteAccessItem - In the implementation block
@property (nonatomic,retain) HFItem * allowRemoteAccessFooterItem; //@synthesize allowRemoteAccessFooterItem=_allowRemoteAccessFooterItem - In the implementation block
@property (nonatomic,retain) HFItem * removeItem; //@synthesize removeItem=_removeItem - In the implementation block
@property (nonatomic,retain) HFUserItem * sourceItem;
@property (nonatomic,readonly) HMUser * user;
@property (readonly) unsigned long long hash;
@property (readonly) Class superclass;
@property (copy,readonly) NSString * description;
@property (copy,readonly) NSString * debugDescription;
-(HMUser *)user;
-(void)setRemoveItem:(HFItem *)arg1 ;
-(HFItem *)removeItem;
-(id)initWithDelegate:(id)arg1 sourceItem:(id)arg2 ;
-(id)_buildItemProvidersForHome:(id)arg1 ;
-(id)_buildSectionsWithDisplayedItems:(id)arg1 ;
-(id)_homeFuture;
-(void)setHomeForUser:(HMHome *)arg1 ;
-(id)initWithHome:(id)arg1 userItem:(id)arg2 delegate:(id)arg3 ;
-(BOOL)_hasResidentDevice;
-(HMHome *)homeForUser;
-(BOOL)_isUserOwner:(id)arg1 ;
-(BOOL)_isEditingAllowedForUser:(id)arg1 ;
-(BOOL)_isRemoteAccessAllowedForUser:(id)arg1 ;
-(BOOL)_isUserBeingEditedTheDeviceUser;
-(BOOL)_isAllowedToEditTargetUser;
-(void)setAllowRemoteAccessItem:(HFItem *)arg1 ;
-(void)setAllowRemoteAccessFooterItem:(HFItem *)arg1 ;
-(HFItem *)allowRemoteAccessItem;
-(HFItem *)allowRemoteAccessFooterItem;
@end
| 46.236364 | 180 | 0.718836 |
d35a264bab05a1b420d4b34a88697d198993578f | 130 | h | C | middleware/include/middleware/generator/texture/noise_types.h | TerraGraphics/TerraEngine | 874165a22ab7dd3774a6cfdeb023485a552d9860 | [
"Apache-2.0"
] | 5 | 2019-12-24T21:43:13.000Z | 2020-06-16T03:44:16.000Z | middleware/include/middleware/generator/texture/noise_types.h | TerraGraphics/TerraEngine | 874165a22ab7dd3774a6cfdeb023485a552d9860 | [
"Apache-2.0"
] | null | null | null | middleware/include/middleware/generator/texture/noise_types.h | TerraGraphics/TerraEngine | 874165a22ab7dd3774a6cfdeb023485a552d9860 | [
"Apache-2.0"
] | 1 | 2020-03-30T00:17:27.000Z | 2020-03-30T00:17:27.000Z | #pragma once
#include <cstdint>
enum class NoiseQuality : uint8_t {
BestSpeed = 0,
Default = 1,
BestQuality = 2
};
| 11.818182 | 35 | 0.630769 |
1f91f8798ca16fc109d5715a78466e186dd40881 | 4,074 | h | C | macOS/10.13/ModelIO.framework/MDLAsset.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 30 | 2016-10-09T20:13:00.000Z | 2022-01-24T04:14:57.000Z | macOS/10.13/ModelIO.framework/MDLAsset.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | null | null | null | macOS/10.13/ModelIO.framework/MDLAsset.h | onmyway133/Runtime-Headers | e9b80e7ab9103f37ad421ad6b8b58ee06369d21f | [
"MIT"
] | 7 | 2017-08-29T14:41:25.000Z | 2022-01-19T17:14:54.000Z | /* Generated by RuntimeBrowser
Image: /System/Library/Frameworks/ModelIO.framework/Versions/A/ModelIO
*/
@interface MDLAsset : NSObject <NSCopying, NSFastEnumeration> {
NSURL * _URL;
double __timeCodesPerSecond;
<MDLObjectContainerComponent> * _animations;
<MDLMeshBufferAllocator> * _bufferAllocator;
NSMapTable * _components;
double _endTime;
double _frameInterval;
<MDLObjectContainerComponent> * _masters;
NSMutableArray * _objects;
<MDLAssetResolver> * _resolver;
double _startTime;
void _upAxis;
MDLVertexDescriptor * _vertexDescriptor;
}
@property (nonatomic, readonly, retain) NSURL *URL;
@property (nonatomic, readonly) struct MDLAABB { } _bounds;
@property (nonatomic, readwrite) double _timeCodesPerSecond;
@property (nonatomic, readwrite, retain) <MDLObjectContainerComponent> *animations;
@property (nonatomic, readonly) struct { } boundingBox;
@property (nonatomic, readonly, retain) <MDLMeshBufferAllocator> *bufferAllocator;
@property (nonatomic, readonly) unsigned long long count;
@property (nonatomic, readwrite) double endTime;
@property (nonatomic, readwrite) double frameInterval;
@property (nonatomic, readwrite, retain) <MDLObjectContainerComponent> *masters;
@property (nonatomic, readwrite, retain) <MDLAssetResolver> *resolver;
@property (nonatomic, readwrite) double startTime;
@property (nonatomic, readwrite) void upAxis;
@property (nonatomic, readonly, retain) MDLVertexDescriptor *vertexDescriptor;
// Image: /System/Library/Frameworks/ModelIO.framework/Versions/A/ModelIO
+ (BOOL)canExportFileExtension:(id)arg1;
+ (BOOL)canImportFileExtension:(id)arg1;
+ (id)placeLightProbesWithDensity:(float)arg1 heuristic:(long long)arg2 usingIrradianceDataSource:(id)arg3;
- (void).cxx_destruct;
- (id)URL;
- (struct MDLAABB { })_bounds;
- (void)_commonInit;
- (void)_conformVertexBuffers:(id)arg1 error:(id*)arg2;
- (double)_timeCodesPerSecond;
- (void)addObject:(id)arg1;
- (id)animations;
- (struct { })boundingBox;
- (struct { })boundingBoxAtTime:(double)arg1;
- (id)bufferAllocator;
- (id)childObjectsOfClass:(Class)arg1;
- (id)componentConformingToProtocol:(id)arg1;
- (id)components;
- (id)copyWithZone:(struct _NSZone { }*)arg1;
- (unsigned long long)count;
- (unsigned long long)countByEnumeratingWithState:(struct { unsigned long long x1; id *x2; unsigned long long x3; unsigned long long x4[5]; }*)arg1 objects:(id*)arg2 count:(unsigned long long)arg3;
- (double)endTime;
- (void)enumerateChildObjectsOfClass:(Class)arg1 usingBlock:(id)arg2 stopPointer:(BOOL*)arg3;
- (BOOL)exportAssetToURL:(id)arg1;
- (BOOL)exportAssetToURL:(id)arg1 error:(id*)arg2;
- (double)frameInterval;
- (id)init;
- (id)initWithBufferAllocator:(id)arg1;
- (id)initWithURL:(id)arg1;
- (id)initWithURL:(id)arg1 bufferAllocator:(id)arg2 preserveIndexing:(BOOL)arg3 error:(id*)arg4;
- (id)initWithURL:(id)arg1 vertexDescriptor:(id)arg2 bufferAllocator:(id)arg3;
- (id)initWithURL:(id)arg1 vertexDescriptor:(id)arg2 bufferAllocator:(id)arg3 preserveTopology:(BOOL)arg4 error:(id*)arg5;
- (void)loadTextures;
- (id)masters;
- (id)objectAtIndex:(unsigned long long)arg1;
- (id)objectAtIndexedSubscript:(unsigned long long)arg1;
- (id)objectAtPath:(id)arg1;
- (id)objectForKeyedSubscript:(id)arg1;
- (id)objects;
- (void)removeObject:(id)arg1;
- (void)resolveTextures;
- (id)resolver;
- (void)setAnimations:(id)arg1;
- (void)setComponent:(id)arg1 forProtocol:(id)arg2;
- (void)setEndTime:(double)arg1;
- (void)setFrameInterval:(double)arg1;
- (void)setMasters:(id)arg1;
- (void)setObject:(id)arg1 forKeyedSubscript:(id)arg2;
- (void)setResolver:(id)arg1;
- (void)setStartTime:(double)arg1;
- (void)setUpAxis;
- (void)set_timeCodesPerSecond:(double)arg1;
- (double)startTime;
- (void)upAxis;
- (id)vertexDescriptor;
// Image: /System/Library/Frameworks/SceneKit.framework/Versions/A/SceneKit
// MDLAsset (SCNModelIO)
+ (id)assetWithSCNNode:(id)arg1;
+ (id)assetWithSCNNode:(id)arg1 bufferAllocator:(id)arg2;
+ (id)assetWithSCNScene:(id)arg1;
+ (id)assetWithSCNScene:(id)arg1 bufferAllocator:(id)arg2;
@end
| 39.173077 | 197 | 0.758468 |
dea3ca5a6d148a912630f5340361a9e5c2df36ea | 458 | h | C | FinalProject/FinalProject/MonthDataCell.h | garykillyou/iOS_Calendar | 595cff45d84796b7e0f7d8004a800a8f358423d6 | [
"MIT"
] | null | null | null | FinalProject/FinalProject/MonthDataCell.h | garykillyou/iOS_Calendar | 595cff45d84796b7e0f7d8004a800a8f358423d6 | [
"MIT"
] | null | null | null | FinalProject/FinalProject/MonthDataCell.h | garykillyou/iOS_Calendar | 595cff45d84796b7e0f7d8004a800a8f358423d6 | [
"MIT"
] | null | null | null | //
// MonthDataCell.h
// FinalProject
//
// Created by 472 on 2017/1/1.
// Copyright © 2017年 student. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface MonthDataCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UILabel *MonthDayLabel;
@property (strong, nonatomic) NSString *year;
@property (strong, nonatomic) NSString *month;
@property (strong, nonatomic) NSString *day;
@property (strong, nonatomic) NSString *data;
@end
| 20.818182 | 60 | 0.731441 |
5af00a494c6cc7c43954369b9054b6e1fbcc564f | 2,123 | h | C | Code/Tools/FBuild/FBuildCore/Graph/CSNode.h | qq573011406/FASTBuild_UnrealEngine | 29c49672f82173a903cb32f0e4656e2fd07ebef2 | [
"MIT"
] | 30 | 2020-07-15T06:16:55.000Z | 2022-02-10T21:37:52.000Z | Code/Tools/FBuild/FBuildCore/Graph/CSNode.h | qq573011406/FASTBuild_UnrealEngine | 29c49672f82173a903cb32f0e4656e2fd07ebef2 | [
"MIT"
] | 1 | 2020-10-19T22:12:03.000Z | 2020-10-19T22:12:03.000Z | Code/Tools/FBuild/FBuildCore/Graph/CSNode.h | qq573011406/FASTBuild_UnrealEngine | 29c49672f82173a903cb32f0e4656e2fd07ebef2 | [
"MIT"
] | 12 | 2020-09-16T17:39:34.000Z | 2021-08-17T11:32:37.000Z | // CSNode.h - a node that builds a C# assembly
//------------------------------------------------------------------------------
#pragma once
// Includes
//------------------------------------------------------------------------------
#include "FileNode.h"
#include "Core/Containers/Array.h"
// Forward Declarations
//------------------------------------------------------------------------------
class Args;
class Function;
// CSNode
//------------------------------------------------------------------------------
class CSNode : public FileNode
{
REFLECT_NODE_DECLARE( CSNode )
public:
explicit CSNode();
virtual bool Initialize( NodeGraph & nodeGraph, const BFFToken * iter, const Function * function ) override;
virtual ~CSNode() override;
static inline Node::Type GetTypeS() { return Node::CS_NODE; }
private:
virtual bool DoDynamicDependencies( NodeGraph & nodeGraph, bool forceClean ) override;
virtual BuildResult DoBuild( Job * job ) override;
CompilerNode * GetCompiler() const;
void EmitCompilationMessage( const Args & fullArgs ) const;
bool BuildArgs( Args & fullArgs ) const;
void GetInputFiles( Args & fullArgs, const AString & pre, const AString & post ) const;
void GetExtraRefs( Args & fullArgs, const AString & pre, const AString & post ) const;
// Exposed Properties
AString m_Compiler;
AString m_CompilerOptions;
AString m_CompilerOutput;
Array< AString > m_CompilerInputPath;
bool m_CompilerInputPathRecurse;
Array< AString > m_CompilerInputPattern;
Array< AString > m_CompilerInputExcludePath;
Array< AString > m_CompilerInputExcludedFiles;
Array< AString > m_CompilerInputExcludePattern;
Array< AString > m_CompilerInputFiles;
Array< AString > m_CompilerReferences;
Array< AString > m_PreBuildDependencyNames;
// Internal State
uint32_t m_NumCompilerInputFiles;
uint32_t m_NumCompilerReferences;
};
//------------------------------------------------------------------------------
| 35.983051 | 112 | 0.558643 |
2d14db80d10dcd904be003a49093aeb18463499f | 544 | h | C | Device/instructioncounter.h | IoTDevEnvExamples/DevKitELL | 4da07cd3283682020c105737b52cfc605a3d1556 | [
"MIT"
] | 4 | 2020-02-20T09:31:02.000Z | 2021-05-10T01:23:20.000Z | Device/instructioncounter.h | lovettchris/IoTKeywordSpotter | 4da07cd3283682020c105737b52cfc605a3d1556 | [
"MIT"
] | null | null | null | Device/instructioncounter.h | lovettchris/IoTKeywordSpotter | 4da07cd3283682020c105737b52cfc605a3d1556 | [
"MIT"
] | null | null | null | #ifndef INSTRUCTION_COUNTER_H
#define INSTRUCTION_COUNTER_H
#include "core_cm4.h"
class InstructionCounter
{
private:
uint32_t _count;
public:
InstructionCounter()
{
}
void Enable()
{
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
}
void Disable()
{
DWT->CTRL &= ~DWT_CTRL_CYCCNTENA_Msk;
}
void Start()
{
DWT->CYCCNT = 0; // reset the count
}
void Stop()
{
_count = DWT->CYCCNT;
}
uint32_t GetCount()
{
return _count;
}
};
#endif | 15.111111 | 45 | 0.560662 |
91abe747a187717f19c934c0c9f6814855946895 | 10,799 | h | C | include/External/stlib/packages/array/StaticArrayOfArrays.h | bxl295/m4extreme | 2a4a20ebb5b4e971698f7c981de140d31a5e550c | [
"BSD-3-Clause"
] | null | null | null | include/External/stlib/packages/array/StaticArrayOfArrays.h | bxl295/m4extreme | 2a4a20ebb5b4e971698f7c981de140d31a5e550c | [
"BSD-3-Clause"
] | null | null | null | include/External/stlib/packages/array/StaticArrayOfArrays.h | bxl295/m4extreme | 2a4a20ebb5b4e971698f7c981de140d31a5e550c | [
"BSD-3-Clause"
] | null | null | null | // -*- C++ -*-
/*!
\file StaticArrayOfArrays.h
\brief A class for a static %array of arrays.
*/
#if !defined(__array_StaticArrayOfArrays_h__)
#define __array_StaticArrayOfArrays_h__
#include "../ext/vector.h"
namespace array {
//! A static %array of arrays.
/*!
\param _T is the value type.
*/
template<typename _T>
class StaticArrayOfArrays {
//
// Private types.
//
private:
typedef std::vector<_T> Container;
//
// Public Types.
//
public:
//! The value type.
typedef typename Container::value_type value_type;
//! Reference to the value type.
typedef typename Container::reference reference;
//! Constant reference to the value type.
typedef typename Container::const_reference const_reference;
//! Iterator in the container.
typedef typename Container::iterator iterator;
//! Constant iterator in the container.
typedef typename Container::const_iterator const_iterator;
//! The size type.
typedef typename Container::size_type size_type;
//! The pointer difference type.
typedef typename Container::difference_type difference_type;
//! Reverse iterator.
typedef typename Container::reverse_iterator reverse_iterator;
//! Constant reverse iterator.
typedef typename Container::const_reverse_iterator const_reverse_iterator;
//! A pointer to an %array element.
typedef typename Container::pointer pointer;
//! A pointer to a constant %array element.
typedef typename Container::const_pointer const_pointer;
//
// Data.
//
private:
//! The %array elements.
std::vector<value_type> _elements;
//! Pointers that determine the beginning and end of each %array.
std::vector<iterator> _pointers;
public:
//--------------------------------------------------------------------------
//! \name Constructors etc.
// @{
//! Default constructor. Empty data structure.
StaticArrayOfArrays() :
_elements(),
_pointers(1) {
_pointers[0] = begin();
}
//! Construct from a container of containers.
template<typename _Container>
StaticArrayOfArrays(const _Container& cOfC);
//! Construct from the %array sizes and the values.
template<typename SizeForwardIter, typename ValueForwardIter>
StaticArrayOfArrays(SizeForwardIter sizesBeginning, SizeForwardIter sizesEnd,
ValueForwardIter valuesBeginning,
ValueForwardIter valuesEnd);
//! Rebuild from the component %array sizes.
template<typename SizeForwardIter>
void
rebuild(SizeForwardIter sizesBeginning, SizeForwardIter sizesEnd);
//! Rebuild from the %array sizes and the values.
template<typename SizeForwardIter, typename ValueForwardIter>
void
rebuild(SizeForwardIter sizesBeginning, SizeForwardIter sizesEnd,
ValueForwardIter valuesBeginning, ValueForwardIter valuesEnd) {
rebuild(sizesBeginning, sizesEnd);
std::copy(valuesBeginning, valuesEnd, begin());
}
//! Copy constructor.
StaticArrayOfArrays(const StaticArrayOfArrays& other) :
_elements(other._elements),
_pointers(other._pointers.size()) {
_pointers[0] = begin();
for (std::size_t i = 0; i != getNumberOfArrays(); ++i) {
_pointers[i+1] = _pointers[i] + other.size(i);
}
}
//! Swap with the argument.
void
swap(StaticArrayOfArrays& other) {
_elements.swap(other._elements);
_pointers.swap(other._pointers);
}
//! Assignment operator.
StaticArrayOfArrays&
operator=(StaticArrayOfArrays other) {
swap(other);
return *this;
}
// Default destructor is fine.
// @}
//--------------------------------------------------------------------------
//! \name Accessors for the whole set of elements.
// @{
//! Return the number of arrays.
size_type
getNumberOfArrays() const {
return _pointers.size() - 1;
}
//! Return the total number of elements.
size_type
size() const {
return _elements.size();
}
//! Return true if the total number of elements is empty.
bool
empty() const {
return _elements.empty();
}
//! Return the size of the largest possible %array.
size_type
max_size() const {
return _elements.max_size();
}
//! Return the memory size.
size_type
getMemoryUsage() const {
return sizeof(std::vector<value_type>) +
_elements.size() * sizeof(value_type) +
sizeof(std::vector<iterator>) +
_pointers.size() * sizeof(iterator);
}
//! Return a const iterator to the first value.
const_iterator
begin() const {
return _elements.begin();
}
//! Return a const iterator to one past the last value.
const_iterator
end() const {
return _elements.end();
}
//! Return a const reverse iterator to the last value.
const_reverse_iterator
rbegin() const {
return _elements.rbegin();
}
//! Return a const reverse iterator to one before the first value.
const_reverse_iterator
rend() const {
return _elements.rend();
}
//! Return a const reference to the n<sup>th</sup> overall element.
const_reference
operator[](const size_type n) const {
return _elements[n];
}
// @}
//--------------------------------------------------------------------------
//! \name Accessors for individual arrays.
// @{
//! Return the number of elements in the n<sup>th</sup> %array.
size_type
size(const size_type n) const {
return size_type(_pointers[n + 1] - _pointers[n]);
}
//! Return true if the n<sup>th</sup> %array is empty.
bool
empty(const size_type n) const {
return size(n) == 0;
}
//! Return a const iterator to the first value in the n<sup>th</sup> %array.
const_iterator
begin(const size_type n) const {
return _pointers[n];
}
//! Return a const iterator to one past the last value in the n<sup>th</sup> %array.
const_iterator
end(const size_type n) const {
return _pointers[n + 1];
}
//! Return a const reverse iterator to the last value in the n<sup>th</sup> %array.
const_reverse_iterator
rbegin(const size_type n) const {
return const_reverse_iterator(_pointers[n + 1]);
}
//! Return a const reverse iterator to one before the first value in the n<sup>th</sup> %array.
const_reverse_iterator
rend(const size_type n) const {
return const_reverse_iterator(_pointers[n]);
}
//! Return a const iterator to the first element of the n<sup>th</sup> %array.
const_iterator
operator()(const size_type n) const {
return begin(n);
}
//! Return the m<sup>th</sup> element of the n<sup>th</sup> %array.
const_reference
operator()(const std::size_t n, const std::size_t m) const {
#ifdef DEBUG_stlib
assert(m < size(n));
#endif
return *(begin(n) + m);
}
// @}
//--------------------------------------------------------------------------
//! \name Manipulators for the whole set of elements.
// @{
//! Return an iterator to the first value.
iterator
begin() {
return _elements.begin();
}
//! Return an iterator to one past the last value.
iterator
end() {
return _elements.end();
}
//! Clear the %array of arrays.
void
clear() {
_elements.resize(0);
_pointers.resize(1);
_pointers[0] = begin();
}
//! Return a reference to the n<sup>th</sup> overall element.
reference
operator[](const size_type n) {
return _elements[n];
}
// @}
//--------------------------------------------------------------------------
//! \name Manipulators for individual arrays.
// @{
//! Return an iterator to the first value in the n<sup>th</sup> %array.
iterator
begin(const size_type n) {
return _pointers[n];
}
//! Return an iterator to one past the last value in the n<sup>th</sup> %array.
iterator
end(const size_type n) {
return _pointers[n + 1];
}
//! Return an iterator to the first element of the n<sup>th</sup> %array.
iterator
operator()(const size_type n) {
return begin(n);
}
//! Return the m<sup>th</sup> element of the n<sup>th</sup> %array.
reference
operator()(const size_type n, const size_type m) {
#ifdef DEBUG_stlib
assert(m < size(n));
#endif
return *(begin(n) + m);
}
// @}
//--------------------------------------------------------------------------
//! \name Equality.
// @{
//! Return true if the arrays are equal.
bool
operator==(const StaticArrayOfArrays<value_type>& x) const {
if (_elements != x._elements) {
return false;
}
for (size_type n = 0; n != getNumberOfArrays(); ++n) {
if (size(n) != x.size(n)) {
return false;
}
}
return true;
}
//! Return true if the arrays are not equal.
bool
operator!=(const StaticArrayOfArrays<value_type>& x) const {
return ! operator==(x);
}
// @}
//--------------------------------------------------------------------------
//! \name File I/O.
// @{
//! Write to a file stream in ascii format.
void
put(std::ostream& out) const;
//! Read from a file stream in ascii format.
void
get(std::istream& in);
// @}
};
//
// File I/O.
//
//! Write a StaticArrayOfArrays in ascii format.
/*!
\relates StaticArrayOfArrays
Below is the file format.
\verbatim
number_of_arrays number_of_elements
array_0_size
array_0_value_0 array_0_value_1 ...
array_1_size
array_1_value_0 array_1_value_1 ...
... \endverbatim
*/
template<typename _T>
inline
std::ostream&
operator<<(std::ostream& out, const StaticArrayOfArrays<_T>& x) {
x.put(out);
return out;
}
//! Read a StaticArrayOfArrays in ascii format.
/*!
\relates StaticArrayOfArrays
Below is the file format.
\verbatim
number_of_arrays number_of_elements
array_0_size
array_0_value_0 array_0_value_1 ...
array_1_size
array_1_value_0 array_1_value_1 ...
... \endverbatim
*/
template<typename _T>
inline
std::istream&
operator>>(std::istream& in, StaticArrayOfArrays<_T>& x) {
x.get(in);
return in;
}
} // namespace array
#define __array_StaticArrayOfArrays_ipp__
#include "StaticArrayOfArrays.ipp"
#undef __array_StaticArrayOfArrays_ipp__
#endif
| 26.084541 | 99 | 0.592925 |
91cea8bb48e31f690e401555ce65d24bfa709e64 | 683 | h | C | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/net-snmp/5.8-r0/net-snmp-5.8/agent/mibgroup/ip-mib/data_access/ipaddress_private.h | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/net-snmp/5.8-r0/net-snmp-5.8/agent/mibgroup/ip-mib/data_access/ipaddress_private.h | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/net-snmp/5.8-r0/net-snmp-5.8/agent/mibgroup/ip-mib/data_access/ipaddress_private.h | sotaoverride/backup | ca53a10b72295387ef4948a9289cb78ab70bc449 | [
"Apache-2.0"
] | null | null | null | int netsnmp_arch_ipaddress_container_load(netsnmp_container* container,
u_int load_flags);
int netsnmp_arch_ipaddress_entry_init(netsnmp_ipaddress_entry* entry);
void netsnmp_arch_ipaddress_entry_cleanup(netsnmp_ipaddress_entry* entry);
int netsnmp_arch_ipaddress_entry_copy(netsnmp_ipaddress_entry* lhs,
netsnmp_ipaddress_entry* rhs);
int netsnmp_arch_ipaddress_create(netsnmp_ipaddress_entry* entry);
int netsnmp_arch_ipaddress_delete(netsnmp_ipaddress_entry* entry);
int netsnmp_arch_ipaddress_container_load(netsnmp_container* container,
u_int load_flags);
| 62.090909 | 74 | 0.734993 |
09cc3e3503fe8ffdf19cb25549a6fe2b74f49332 | 3,061 | h | C | projects/Phantom.Code/phantom/lang/FieldInitializationStatement.h | vlmillet/Phantom.Code | 05ed65bc4a456e76da4b2d9da1fe3dabe64ba1b3 | [
"MIT"
] | null | null | null | projects/Phantom.Code/phantom/lang/FieldInitializationStatement.h | vlmillet/Phantom.Code | 05ed65bc4a456e76da4b2d9da1fe3dabe64ba1b3 | [
"MIT"
] | null | null | null | projects/Phantom.Code/phantom/lang/FieldInitializationStatement.h | vlmillet/Phantom.Code | 05ed65bc4a456e76da4b2d9da1fe3dabe64ba1b3 | [
"MIT"
] | null | null | null | // license [
// This file is part of the Phantom project. Copyright 2011-2020 Vivien Millet.
// Distributed under the MIT license. Text available here at
// https://github.com/vlmillet/phantom
// ]
#pragma once
/* ****************** Includes ******************* */
#include "Expression.h"
#include "Statement.h"
/* **************** Declarations ***************** */
/* *********************************************** */
namespace phantom
{
namespace lang
{
/// \brief Represents a Data member initialization statement
/// \code{.cpp}
/// MyClass(int valueA) : a(valueA) {} // Data member 'a' initialized with
/// 'valueA'
/// \endcode
class PHANTOM_EXPORT_PHANTOM_CODE FieldInitializationStatement : public Statement
{
PHANTOM_DECLARE_LANGUAGE_ELEMENT_VISIT_EX;
public:
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief Constructor.
///
/// \param [in,out] a_pObjectExpression The object expression (equivalent to *this).
/// \param [in,out] a_pField The Data member.
/// \param [in,out] a_pValueExpression The value expression.
/// \param [in,out] a_uiArrayIndex (optional) The optional array index.
////////////////////////////////////////////////////////////////////////////////////////////////////
FieldInitializationStatement(Field* a_pField, Expression* a_pValueExpression, size_t a_uiArrayIndex = 0);
void initialize();
virtual FieldInitializationStatement* asFieldInitializationStatement() const
{
return (FieldInitializationStatement*)this;
}
void eval(ExecutionContext& a_Context) const override;
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief Gets the Data member associated with that statement.
///
/// \return The Data member.
////////////////////////////////////////////////////////////////////////////////////////////////////
Field* getField() const { return m_pField; }
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief Gets the initialization expression.
///
/// \return The initialization expression.
////////////////////////////////////////////////////////////////////////////////////////////////////
Expression* getInitializationExpression() const { return m_pInitializationExpression; }
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \brief Gets the array index for array offsetting.
///
/// \return The array index.
////////////////////////////////////////////////////////////////////////////////////////////////////
size_t getArrayIndex() const { return m_uiArrayIndex; }
protected:
Field* m_pField;
Expression* m_pInitializationExpression;
size_t m_uiArrayIndex;
private:
size_t m_uiOffset;
};
} // namespace lang
} // namespace phantom
| 36.011765 | 109 | 0.465861 |
9160fea399cc2c00e3d9a7adbf2e56d907af9235 | 358 | h | C | GoonRenderer/Includes/Object/VBO.h | Snowapril/GoonRenderer | dce6c0cc5d89384d6ec29e98e63d0813bd138572 | [
"MIT"
] | 1 | 2019-09-14T11:07:16.000Z | 2019-09-14T11:07:16.000Z | GoonRenderer/Includes/Object/VBO.h | Snowapril/GoonRenderer | dce6c0cc5d89384d6ec29e98e63d0813bd138572 | [
"MIT"
] | null | null | null | GoonRenderer/Includes/Object/VBO.h | Snowapril/GoonRenderer | dce6c0cc5d89384d6ec29e98e63d0813bd138572 | [
"MIT"
] | 2 | 2021-03-21T02:53:48.000Z | 2021-04-02T08:25:03.000Z | #pragma once
#include <vector>
#include "../DataType.h"
namespace gr
{
class VBO
{
private:
void* vertices = nullptr;
std::vector< VertexStrideInfo > verticesInfos;
public:
VBO() = default;
VBO(void* _vertices, std::vector< VertexStrideInfo >&& _verticesInfos);
~VBO();
public:
};
}; | 17.9 | 79 | 0.564246 |
c6bf4c1801f1f9166b167e1e22a9cfd5d28144c3 | 1,025 | h | C | ios/RNPermissionsManager.h | sandeepmca04/react-native-permissions | fa4a236cb53e9cdcd892fa73ec6079525437f93b | [
"MIT"
] | null | null | null | ios/RNPermissionsManager.h | sandeepmca04/react-native-permissions | fa4a236cb53e9cdcd892fa73ec6079525437f93b | [
"MIT"
] | null | null | null | ios/RNPermissionsManager.h | sandeepmca04/react-native-permissions | fa4a236cb53e9cdcd892fa73ec6079525437f93b | [
"MIT"
] | null | null | null | #import <React/RCTBridgeModule.h>
typedef enum {
RNPermissionStatusNotAvailable = 0,
RNPermissionStatusNotDetermined = 1,
RNPermissionStatusRestricted = 2,
RNPermissionStatusDenied = 3,
RNPermissionStatusAuthorized = 4,
} RNPermissionStatus;
@protocol RNPermissionHandler <NSObject>
@optional
+ (NSArray<NSString *> * _Nullable)usageDescriptionKeys;
@required
- (void)checkWithResolver:(nullable void (^)(RNPermissionStatus status))resolve
withRejecter:(void (^ _Nullable)(NSError * _Nullable error))reject;
- (void)requestWithOptions:(NSDictionary * _Nullable)options
withResolver:(nullable void (^)(RNPermissionStatus status))resolve
withRejecter:(void (^ _Nullable)(NSError * _Nullable error))reject;
@end
@interface RNPermissionsManager : NSObject <RCTBridgeModule>
+ (bool)hasBackgroundModeEnabled:(nullable NSString *)mode;
+ (void)logErrorMessage:(nullable NSString *)message;
+ (bool)hasBeenRequestedOnce:(nullable id<RNPermissionHandler>)handler;
@end
| 27.702703 | 81 | 0.759024 |
0b17565e7bf714f3cda849b50d801d86fc4e73ff | 309 | c | C | Chapter6/Lecture15_1/lecture15_1.c | leeyunhome/TBC-workbook | ac0b01990d208ddeaa2e1a8093781cc3141128e2 | [
"Unlicense"
] | 1 | 2021-04-14T07:14:08.000Z | 2021-04-14T07:14:08.000Z | Chapter6/Lecture15_1/lecture15_1.c | leeyunhome/TBC-workbook | ac0b01990d208ddeaa2e1a8093781cc3141128e2 | [
"Unlicense"
] | null | null | null | Chapter6/Lecture15_1/lecture15_1.c | leeyunhome/TBC-workbook | ac0b01990d208ddeaa2e1a8093781cc3141128e2 | [
"Unlicense"
] | null | null | null | #define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#define NUM_ROWS 5
#define FIRST_CHAR 'A'
#define LAST_CHAR 'K'
int main()
{
int r;// row loop
int c;// character loop
for (r = 0; r < NUM_ROWS; r++)
{
for (c = FIRST_CHAR; c <= LAST_CHAR; c++)
printf("%c ", c);
printf("\n");
}
return 0;
} | 14.714286 | 43 | 0.605178 |
0928d2040169b580beb397f3328b93ad6c6bbb16 | 2,237 | h | C | Common/Stylization/SymbolVisitor.h | achilex/MgDev | f7baf680a88d37659af32ee72b9a2046910b00d8 | [
"PHP-3.0"
] | 2 | 2017-04-19T01:38:30.000Z | 2020-07-31T03:05:32.000Z | Common/Stylization/SymbolVisitor.h | achilex/MgDev | f7baf680a88d37659af32ee72b9a2046910b00d8 | [
"PHP-3.0"
] | null | null | null | Common/Stylization/SymbolVisitor.h | achilex/MgDev | f7baf680a88d37659af32ee72b9a2046910b00d8 | [
"PHP-3.0"
] | 1 | 2021-12-29T10:46:12.000Z | 2021-12-29T10:46:12.000Z | //
// Copyright (C) 2004-2011 by Autodesk, Inc.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of version 2.1 of the GNU Lesser
// General Public License as published by the Free Software Foundation.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef SYMBOLVISITOR_H_
#define SYMBOLVISITOR_H_
#include "Stylization.h"
//a visitor implementation that determines the feature type style
//we are dealing with
class SymbolVisitor : public MdfModel::ISymbolVisitor
{
public:
enum eSymbolType
{
stUnknown = 0,
stMark = 1,
stBlock = 2,
stW2D = 3,
stFont = 4,
stImage = 5,
stText = 6 //will not get that as a point symbol -- it's for labels only
};
SymbolVisitor()
{
m_type = stUnknown;
}
virtual void VisitMarkSymbol(MdfModel::MarkSymbol&)
{
m_type = stMark;
}
virtual void VisitImageSymbol(MdfModel::ImageSymbol&)
{
m_type = stImage;
}
virtual void VisitFontSymbol(MdfModel::FontSymbol&)
{
m_type = stFont;
}
virtual void VisitW2DSymbol(MdfModel::W2DSymbol&)
{
m_type = stW2D;
}
virtual void VisitBlockSymbol(MdfModel::BlockSymbol&)
{
m_type = stBlock;
}
virtual void VisitTextSymbol(MdfModel::TextSymbol&)
{
//should not get this type of symbol
m_type = stText;
}
eSymbolType GetSymbolType()
{
return m_type;
}
//static helper
static eSymbolType DetermineSymbolType(MdfModel::Symbol* symbol)
{
SymbolVisitor vis;
symbol->AcceptVisitor(vis);
return vis.GetSymbolType();
}
private:
eSymbolType m_type;
};
#endif
| 24.053763 | 89 | 0.639249 |
347c74558a533821852a2e5a7a66c092b7f051b5 | 619 | h | C | include/il2cpp/UnityEngine/UIElements/EventBase_DragExitedEvent_.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | 1 | 2022-01-15T20:20:27.000Z | 2022-01-15T20:20:27.000Z | include/il2cpp/UnityEngine/UIElements/EventBase_DragExitedEvent_.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | include/il2cpp/UnityEngine/UIElements/EventBase_DragExitedEvent_.h | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | #pragma once
#include "il2cpp.h"
int64_t UnityEngine_UIElements_EventBase_DragExitedEvent___TypeId (const MethodInfo* method_info);
void UnityEngine_UIElements_EventBase_DragExitedEvent___Acquire (UnityEngine_UIElements_EventBase_DragExitedEvent__o* __this, const MethodInfo* method_info);
void UnityEngine_UIElements_EventBase_DragExitedEvent___Dispose (UnityEngine_UIElements_EventBase_DragExitedEvent__o* __this, const MethodInfo* method_info);
int64_t UnityEngine_UIElements_EventBase_DragExitedEvent___get_eventTypeId (UnityEngine_UIElements_EventBase_DragExitedEvent__o* __this, const MethodInfo* method_info);
| 68.777778 | 168 | 0.904685 |
095521946629294fc7ed4350a2d278bd0a55fa7e | 2,868 | h | C | inc/tp_maps_ui/widgets/CheckBox.h | omi-lab/tp_maps_ui | 720690b4b30e1db2c9231d6b86b61434cc32d3a5 | [
"MIT"
] | 1 | 2018-11-06T12:30:38.000Z | 2018-11-06T12:30:38.000Z | inc/tp_maps_ui/widgets/CheckBox.h | omi-lab/tp_maps_ui | 720690b4b30e1db2c9231d6b86b61434cc32d3a5 | [
"MIT"
] | null | null | null | inc/tp_maps_ui/widgets/CheckBox.h | omi-lab/tp_maps_ui | 720690b4b30e1db2c9231d6b86b61434cc32d3a5 | [
"MIT"
] | 2 | 2018-11-05T10:58:08.000Z | 2020-12-09T12:39:04.000Z | #ifndef tp_maps_ui_CheckBox_h
#define tp_maps_ui_CheckBox_h
#include "tp_maps_ui/Widget.h"
#include "tp_utils/CallbackCollection.h"
namespace tp_maps_ui
{
//##################################################################################################
class TP_MAPS_UI_SHARED_EXPORT CheckBox : public Widget
{
public:
//################################################################################################
CheckBox(Widget* parent=nullptr);
//################################################################################################
CheckBox(const std::u16string& text, Widget* parent=nullptr);
//################################################################################################
~CheckBox() override;
//################################################################################################
const std::u16string& text() const;
//################################################################################################
void setText(const std::u16string& text);
//################################################################################################
bool checked() const;
//################################################################################################
void setChecked(bool checked);
//################################################################################################
CheckState checkState() const;
//################################################################################################
void setCheckstate(CheckState checkState);
//################################################################################################
bool tristate() const;
//################################################################################################
void setTristate(bool tristate);
//################################################################################################
std::pair<Dim, Dim> sizeHint() const override;
//################################################################################################
tp_utils::CallbackCollection<void(CheckState)> checkStateChanged;
protected:
//################################################################################################
void render(tp_maps::RenderInfo& renderInfo) override;
//################################################################################################
void invalidateBuffers() override;
//################################################################################################
bool mouseEvent(const tp_maps::MouseEvent& event) override;
//################################################################################################
void animate(double timestampMS) override;
private:
struct Private;
Private* d;
friend struct Private;
};
}
#endif
| 38.756757 | 100 | 0.276499 |
16d2bc80d4c0c6397ca0c6cd098cde4547bcf2f9 | 1,617 | h | C | System/Library/PrivateFrameworks/Email.framework/EMContentItem.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 2 | 2021-11-02T09:23:27.000Z | 2022-03-28T08:21:57.000Z | System/Library/PrivateFrameworks/Email.framework/EMContentItem.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/Email.framework/EMContentItem.h | lechium/iOS1351Headers | 6bed3dada5ffc20366b27f7f2300a24a48a6284e | [
"MIT"
] | 1 | 2022-03-28T08:21:59.000Z | 2022-03-28T08:21:59.000Z | /*
* This header is generated by classdump-dyld 1.5
* on Friday, April 30, 2021 at 11:37:23 AM Mountain Standard Time
* Operating System: Version 13.5.1 (Build 17F80)
* Image Source: /System/Library/PrivateFrameworks/Email.framework/Email
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
@class NSArray, NSString, EMMailDropMetadata;
@protocol EMContentItem <EFPubliclyDescribable>
@property (nonatomic,copy,readonly) NSArray * availableRepresentations;
@property (nonatomic,readonly) BOOL isAvailableLocally;
@property (nonatomic,copy,readonly) NSString * displayName;
@property (nonatomic,copy,readonly) NSString * contentID;
@property (nonatomic,copy,readonly) NSString * UTType;
@property (nonatomic,readonly) long long dataTransferByteCount;
@property (nonatomic,readonly) long long storageByteCount;
@property (nonatomic,copy,readonly) EMMailDropMetadata * mailDropMetadata;
@property (nonatomic,readonly) int exchangeEventUID;
@required
-(NSString *)displayName;
-(NSString *)contentID;
-(EMMailDropMetadata *)mailDropMetadata;
-(NSString *)UTType;
-(int)exchangeEventUID;
-(id)requestRepresentationWithOptions:(id)arg1 completionHandler:(/*^block*/id)arg2;
-(NSArray *)availableRepresentations;
-(BOOL)isAvailableLocally;
-(long long)dataTransferByteCount;
-(long long)storageByteCount;
-(id)requestRepresentationWithOptions:(id)arg1 delegate:(id)arg2 completionHandler:(/*^block*/id)arg3;
@end
| 43.702703 | 130 | 0.724799 |
61a8855518831c5affe540d39539735ac174fab3 | 1,078 | c | C | src/math/log_10.c | jairaj-arava/sof | bcccf1253d8b52bfdfc2ba1c4b178d747ee0cf79 | [
"BSD-3-Clause"
] | null | null | null | src/math/log_10.c | jairaj-arava/sof | bcccf1253d8b52bfdfc2ba1c4b178d747ee0cf79 | [
"BSD-3-Clause"
] | null | null | null | src/math/log_10.c | jairaj-arava/sof | bcccf1253d8b52bfdfc2ba1c4b178d747ee0cf79 | [
"BSD-3-Clause"
] | 1 | 2022-01-09T19:23:11.000Z | 2022-01-09T19:23:11.000Z | // SPDX-License-Identifier: BSD-3-Clause/
//
// Copyright(c) 2021 Intel Corporation. All rights reserved.
//
// Author: Shriram Shastry <malladi.sastry@linux.intel.com>
//
//
#include <sof/math/log.h>
#include <sof/audio/format.h>
/**
* Base-10 logarithm log10(x)
*
* loge = (u) computes the base-10 logarithm of
* u using lookup table.
* input u must be scalar/real number and positive
*
* +------------------+-----------------+--------+--------+
* | inpfxp |log10(returntype)| inpfxp | loge |
* +----+-----+-------+----+----+-------+--------+--------+
* |WLen| FLen|Signbit|WLen|FLen|Signbit| Qformat| Qformat|
* +----+-----+-------+----+----+-------+--------+--------+
* | 32 | 0 | 0 | 32 | 28 | 0 | 32.0 | 4.28 |
* +------------------+-----------------+--------+--------+
* Arguments : uint32_t numerator [1 to 4294967295, Q32.0]
* Return Type : uint32_t UQ4.28 [0 to 9.6329499409]
*/
uint32_t log10_int32(uint32_t numerator)
{
return((uint32_t)Q_SHIFT_RND((int64_t)base2_logarithm(numerator) *
ONE_OVER_LOG2_10, 63, 32));
}
| 32.666667 | 67 | 0.51577 |
05763006c4b2d52b814d87dd2f162d45fba1d34e | 590 | c | C | lib/wizards/grathlek/area4/mroom5.c | vlehtola/questmud | 8bc3099b5ad00a9e0261faeb6637c76b521b6dbe | [
"MIT"
] | null | null | null | lib/wizards/grathlek/area4/mroom5.c | vlehtola/questmud | 8bc3099b5ad00a9e0261faeb6637c76b521b6dbe | [
"MIT"
] | null | null | null | lib/wizards/grathlek/area4/mroom5.c | vlehtola/questmud | 8bc3099b5ad00a9e0261faeb6637c76b521b6dbe | [
"MIT"
] | null | null | null | inherit "room/room";
object monster;
reset(arg) {
if(!monster) {
monster = clone_object("/wizards/grathlek/area4/monsies/famu.c");
move_object(monster, this_object());
}
add_exit("east","/wizards/grathlek/area4/mroom4.c");
add_exit("west","/wizards/grathlek/area4/mroom6.c");
set_light(2);
short_desc = "A muddy red passage.";
long_desc = "This is the main corridor of this cave.\n"+
"There are mudholes all over the ground and\n"+
"the red light shines brightly from the west.\n"+
"Some bones lay on the shadows.\n";
}
| 31.052632 | 69 | 0.640678 |
97b98073b1974ff2aa1a62ef5d222ff7d38a53da | 1,021 | c | C | memcache/mainclient.c | XVilka/sdb | 724abd28d8c27a957b4fb7a074df8a6a8afc34c5 | [
"MIT"
] | 123 | 2015-01-02T00:39:34.000Z | 2019-10-22T22:30:23.000Z | memcache/mainclient.c | XVilka/sdb | 724abd28d8c27a957b4fb7a074df8a6a8afc34c5 | [
"MIT"
] | 91 | 2015-02-22T13:15:54.000Z | 2019-10-25T07:46:14.000Z | memcache/mainclient.c | XVilka/sdb | 724abd28d8c27a957b4fb7a074df8a6a8afc34c5 | [
"MIT"
] | 47 | 2015-02-22T12:29:27.000Z | 2019-06-04T03:05:35.000Z | /* mcsdb - LGPLv3 - Copyright 2011-2013 - pancake */
#include "mcsdb.h"
int main(int argc, char **argv) {
McSdbClient *ms;
char *p, buf[MCSDB_MAX_BUFFER];
const char *host = argc>1? argv[1]: "localhost";
const char *port = argc>2? argv[2]: "11211";
if (argc>1 && !strcmp (argv[1], "-h")) {
printf ("Usage: ./client [host] [port]\n");
return 1;
}
ms = mcsdb_client_new (host, port);
if (ms == NULL) {
fprintf (stderr, "Cannot connect to %s %s\n", host, port);
return 1;
}
for (;;) {
if (fgets (buf, sizeof (buf), stdin) == NULL || feof (stdin))
break;
buf[strlen (buf)-1] = 0;
if (buf[0]=='+') {
mcsdb_client_incr (ms, buf+1, 1);
} else
if (buf[0]=='-') {
mcsdb_client_decr (ms, buf+1, 1);
} else {
p = strchr (buf, '=');
if (p) {
*p++ = 0;
if (*p) mcsdb_client_set (ms, buf, p, 0);
else mcsdb_client_remove (ms, buf, 0);
} else {
char *v = mcsdb_client_get (ms, buf, NULL);
printf ("%s\n", v? v: "");
}
}
}
mcsdb_client_free (ms);
return 0;
}
| 23.744186 | 63 | 0.554358 |
ee6534cc5d63be050f2dfbb6381e95105865b091 | 6,685 | h | C | Plugins/Shared Code/Xcode/IDELaunchTestSchemeAction.h | Malterlib/MalterlibXcodePatches | 2b034d2dda2d752f8d64077845fa24a8f1d4c727 | [
"MIT"
] | null | null | null | Plugins/Shared Code/Xcode/IDELaunchTestSchemeAction.h | Malterlib/MalterlibXcodePatches | 2b034d2dda2d752f8d64077845fa24a8f1d4c727 | [
"MIT"
] | null | null | null | Plugins/Shared Code/Xcode/IDELaunchTestSchemeAction.h | Malterlib/MalterlibXcodePatches | 2b034d2dda2d752f8d64077845fa24a8f1d4c727 | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2014 by Steve Nygard.
//
//
// SDK Root: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk.sdk
//
#include "Shared.h"
#import "IDESchemeAction.h"
#import "IDECodeCoverageTargetProviding-Protocol.h"
@class NSArray, NSDictionary, NSMutableArray, NSString;
@interface IDELaunchTestSchemeAction : IDESchemeAction <IDECodeCoverageTargetProviding>
{
NSMutableArray *_commandLineArgumentEntries;
NSMutableArray *_environmentVariableEntries;
BOOL _mallocStackLoggingSelected;
BOOL _codeCoverageEnabled;
BOOL _onlyGenerateCoverageForSpecifiedTargets;
BOOL _enableAddressSanitizer;
BOOL _enableASanStackUseAfterReturn;
BOOL _enableThreadSanitizer;
BOOL _enableUBSanitizer;
BOOL _enableMainThreadChecker;
unsigned int _debugProcessAsUID;
NSString *_selectedDebuggerIdentifier;
NSString *_selectedLauncherIdentifier;
NSString *_selectedMallocStackLoggingType;
NSDictionary *_additionalOptionEntriesDict;
NSString *_language;
NSString *_region;
long long _systemAttachmentLifetime;
long long _userAttachmentLifetime;
NSString *_selectedMallocStackLoggingTypeTooltip;
NSString *_debugAsWhichUser;
NSMutableArray *_mutableCodeCoverageTargets;
}
+ (id)keyPathsForValuesAffectingDebugProcessAsUID;
+ (void)initialize;
@property(retain) NSMutableArray *mutableCodeCoverageTargets; // @synthesize mutableCodeCoverageTargets=_mutableCodeCoverageTargets;
@property(copy) NSString *debugAsWhichUser; // @synthesize debugAsWhichUser=_debugAsWhichUser;
@property(copy) NSString *selectedMallocStackLoggingTypeTooltip; // @synthesize selectedMallocStackLoggingTypeTooltip=_selectedMallocStackLoggingTypeTooltip;
@property long long userAttachmentLifetime; // @synthesize userAttachmentLifetime=_userAttachmentLifetime;
@property long long systemAttachmentLifetime; // @synthesize systemAttachmentLifetime=_systemAttachmentLifetime;
@property(copy, nonatomic) NSString *region; // @synthesize region=_region;
@property(copy, nonatomic) NSString *language; // @synthesize language=_language;
@property BOOL enableMainThreadChecker; // @synthesize enableMainThreadChecker=_enableMainThreadChecker;
@property BOOL enableUBSanitizer; // @synthesize enableUBSanitizer=_enableUBSanitizer;
@property BOOL enableThreadSanitizer; // @synthesize enableThreadSanitizer=_enableThreadSanitizer;
@property BOOL enableASanStackUseAfterReturn; // @synthesize enableASanStackUseAfterReturn=_enableASanStackUseAfterReturn;
@property BOOL enableAddressSanitizer; // @synthesize enableAddressSanitizer=_enableAddressSanitizer;
@property(readonly) NSDictionary *additionalOptionEntriesDict; // @synthesize additionalOptionEntriesDict=_additionalOptionEntriesDict;
@property(nonatomic) unsigned int debugProcessAsUID; // @synthesize debugProcessAsUID=_debugProcessAsUID;
@property(nonatomic) BOOL onlyGenerateCoverageForSpecifiedTargets; // @synthesize onlyGenerateCoverageForSpecifiedTargets=_onlyGenerateCoverageForSpecifiedTargets;
@property(nonatomic) BOOL codeCoverageEnabled; // @synthesize codeCoverageEnabled=_codeCoverageEnabled;
@property(copy) NSString *selectedLauncherIdentifier; // @synthesize selectedLauncherIdentifier=_selectedLauncherIdentifier;
// - (void).cxx_destruct;
- (id)resolvedCodeCoverageBuildables;
- (void)removeCodeCoverageTarget:(id)arg1;
- (void)addCodeCoverageTarget:(id)arg1;
@property(readonly, nonatomic) NSArray *codeCoverageTargets;
- (void)setOnlyGenerateCoverageForSpecifiedTargetsFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setCodeCoverageEnabledFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setUserAttachmentLifetimeFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setSystemAttachmentLifetimeFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setRegionFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setLanguageFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setDisableMainThreadCheckerFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setEnableUBSanitizerFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setEnableThreadSanitizerFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setEnableASanStackUseAfterReturnFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)setEnableAddressSanitizerFromUTF8String:(char *)arg1 fromXMLUnarchiver:(id)arg2;
- (void)addCodeCoverageTargets:(id)arg1 fromXMLUnarchiver:(id)arg2;
- (void)addAdditionalOptions:(id)arg1 fromXMLUnarchiver:(id)arg2;
- (void)addEnvironmentVariables:(id)arg1 fromXMLUnarchiver:(id)arg2;
- (void)addCommandLineArguments:(id)arg1 fromXMLUnarchiver:(id)arg2;
- (void)dvt_encodeAttributesWithXMLArchiver:(id)arg1 version:(id)arg2;
- (void)dvt_encodeRelationshipsWithXMLArchiver:(id)arg1 version:(id)arg2;
- (void)dvt_awakeFromXMLUnarchiver:(id)arg1;
- (void)_updateSelectedMallocStackTooltip:(id)arg1;
- (void)_setSelectedMallocStackLoggingType:(id)arg1;
@property BOOL mallocStackLoggingSelected; // @synthesize mallocStackLoggingSelected=_mallocStackLoggingSelected;
@property(copy) NSString *selectedMallocStackLoggingType; // @synthesize selectedMallocStackLoggingType=_selectedMallocStackLoggingType;
@property(readonly) NSArray *availableMallocStackLoggingTypes;
- (BOOL)containSwiftForTheRunnable;
- (BOOL)UBSanitizerAllowedForRunnable;
- (BOOL)_detectSwiftnessForTheRunnableWithSelector:(SEL)arg1 expectedValue:(BOOL)arg2;
- (id)environmentVariablesForBuildParameters:(id)arg1;
- (void)_modifyEnvironmentForSQLLite:(id)arg1;
- (void)_modifyEnvironmentForMallocStackLogging:(id)arg1;
- (id)additionalOptions;
- (id)expandMacrosInString:(id)arg1 forBuildParameters:(id)arg2;
- (id)createAdditionalDiagnosticsDict;
@property(copy) NSString *selectedDebuggerIdentifier; // @synthesize selectedDebuggerIdentifier=_selectedDebuggerIdentifier;
- (void)setRunContext:(id)arg1;
- (id)initFromXMLUnarchiver:(id)arg1 archiveVersion:(float)arg2;
- (id)init;
- (void)_dvt_commonInit;
// Remaining properties
@property(copy) NSArray *commandLineArgumentEntries; // @dynamic commandLineArgumentEntries;
@property(copy) NSArray *environmentVariableEntries; // @dynamic environmentVariableEntries;
@property(readonly) NSMutableArray *mutableCommandLineArgumentEntries; // @dynamic mutableCommandLineArgumentEntries;
@property(readonly) NSMutableArray *mutableEnvironmentVariableEntries; // @dynamic mutableEnvironmentVariableEntries;
@end
| 58.130435 | 206 | 0.832012 |
e375ea4205c2e662096093598322d2461f77d088 | 4,053 | h | C | Sources/util/ScopeGuard.h | facebookarchive/ie-toolbar | cfcc1a8ffd6d6c7d8b1e12c8317ff728d2173cac | [
"Apache-2.0"
] | 4 | 2016-05-12T23:53:32.000Z | 2021-10-31T15:18:19.000Z | Sources/util/ScopeGuard.h | facebookarchive/ie-toolbar | cfcc1a8ffd6d6c7d8b1e12c8317ff728d2173cac | [
"Apache-2.0"
] | null | null | null | Sources/util/ScopeGuard.h | facebookarchive/ie-toolbar | cfcc1a8ffd6d6c7d8b1e12c8317ff728d2173cac | [
"Apache-2.0"
] | 3 | 2015-01-10T18:23:22.000Z | 2021-10-31T15:18:10.000Z | /**
* Facebook Internet Explorer Toolbar Software License
* Copyright (c) 2009 Facebook, Inc.
*
* Permission is hereby granted, free of charge, to any person or organization
* obtaining a copy of the software and accompanying documentation covered by
* this license (which, together with any graphical images included with such
* software, are collectively referred to below as the "Software") to (a) use,
* reproduce, display, distribute, execute, and transmit the Software, (b)
* prepare derivative works of the Software (excluding any graphical images
* included with the Software, which may not be modified or altered), and (c)
* permit third-parties to whom the Software is furnished to do so, all
* subject to the following:
*
* The copyright notices in the Software and this entire statement, including
* the above license grant, this restriction and the following disclaimer,
* must be included in all copies of the Software, in whole or in part, and
* all derivative works of the Software, unless such copies or derivative
* works are solely in the form of machine-executable object code generated by
* a source language processor.
*
* Facebook, Inc. retains ownership of the Software and all associated
* intellectual property rights. All rights not expressly granted in this
* license are reserved by Facebook, Inc.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef SCOPEGUARD_H
#define SCOPEGUARD_H
#include <boost/function/function0.hpp>
#include <boost/noncopyable.hpp>
/**
* useful tool for support RAII.
* usage examples :
*
* ScopeGuard fbCritSectGuard(
* bind(&CCriticalSection::Lock, ref(facebookDataCritSect)),
* bind(&CCriticalSection::Unlock, ref(facebookDataCritSect)));
* this locks critical section on guard construction and unlocks on
*
* fbCritSectGuard.dismiss() - cancels actions assigned on destruction
*
* another example:
*
* SAFEARRAY* psa = SafeArrayCreateVector(VT_VARIANT, 0, 1);
* ScopeGuard psaGuard(boost::bind(SafeArrayDestroyWrapper() , psa));
* this will call SafeArrayDestroyWrapper(psa) when guard is
* destructed
*
* Important Note: it is highly recommended to do not use API with boost::bind
* due to the differences in linkage - pointer to extern "c" function
* is not always the same as pointer to 'usual' function.
* Always try to make a wrapper. e.g.
* {
* typedef void result_type;
* void operator()(SAFEARRAY* psa) const
* {
* SafeArrayDestroy(psa);
* }
* };
* this is a preferable and portable way of using boost::bind with API
*
*/
namespace facebook {
/**
* class ScopeGuard
*
* Execute functions on start of declaration of ScopeGuard variable
* and at the end of it
*/
class ScopeGuard : private boost::noncopyable{
public:
explicit ScopeGuard( const boost::function0<void>& doAtDestroyFunc )
: m_dismissed(false)
, m_doAtDestroyFunc(doAtDestroyFunc) {
}
explicit ScopeGuard(const boost::function0<void>& doAtCreateFunc,
const boost::function0<void>& doAtDestroyFunc)
: m_dismissed(false)
, m_doAtDestroyFunc(doAtDestroyFunc) {
doAtCreateFunc();
}
~ScopeGuard() {
if(!m_dismissed) {
m_doAtDestroyFunc();
}
}
void dismiss() {
m_dismissed = true;
}
private:
bool m_dismissed; // dissmissed flag
const boost::function0<void> m_doAtDestroyFunc;
// pointer to function that executed on destroy
};
} // !namespace facebook
#endif // #ifndef ScopeGuard_H
| 34.939655 | 79 | 0.712312 |
e3a3201f7fbc646c430a21ab8a0148f01e30f032 | 522 | c | C | 1250.c | edufcarvalho/URI | 99491ef0aed3bd25024873eac24256e7327a31ca | [
"MIT"
] | 2 | 2020-09-17T01:31:20.000Z | 2020-10-19T21:24:18.000Z | 1250.c | edufcarvalho/URI | 99491ef0aed3bd25024873eac24256e7327a31ca | [
"MIT"
] | 1 | 2020-09-17T22:00:05.000Z | 2020-09-30T07:21:47.000Z | 1250.c | edufcarvalho/URI | 99491ef0aed3bd25024873eac24256e7327a31ca | [
"MIT"
] | null | null | null | #include <stdio.h>
int main(void) {
int n;
scanf("%d", &n);
while (n--) {
int i, a, shots = 0;
scanf("%d", &a);
int height[a];
char jump[a];
for (i = 0; i <= a; i++) scanf("%d", &height[i]);
for (i = 0; i <= a; i++) scanf("%c", &jump[i]);
for (i = 0; i <= a; i++) {
if (height[i] > 2 && jump[i] == 'J') shots++;
else if(height[i] < 3 && jump[i] == 'S') shots++;
}
printf("%d\n", shots);
}
return 0;
}
| 20.88 | 61 | 0.367816 |
5a4210a76abe2836c6aa9fb832e25913cac6cb06 | 12,294 | c | C | processors/ARM/gdb-7.10/sim/testsuite/common/bits-tst.c | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 110 | 2015-01-10T17:54:56.000Z | 2021-08-08T05:06:55.000Z | processors/ARM/gdb-7.10/sim/testsuite/common/bits-tst.c | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 36 | 2015-05-08T07:45:52.000Z | 2019-04-30T13:41:12.000Z | processors/ARM/gdb-7.10/sim/testsuite/common/bits-tst.c | pavel-krivanek/opensmalltalk-vm | 694dfe3ed015e16f5b8e9cf17d37e4bdd32bea16 | [
"MIT"
] | 45 | 2015-02-26T13:55:13.000Z | 2020-11-25T09:17:43.000Z | # 2 "bits-tst.c"
/* Drive the bit test routines */
long long
calc (const char *call,
long long val,
int row,
int col)
{
if (strcmp (call, "MASK") == 0)
return MASKED (val, row, col);
if (strcmp (call, "MASK8") == 0)
return MASKED8 (val, row, col);
if (strcmp (call, "MASK16") == 0)
return MASKED16 (val, row, col);
if (strcmp (call, "MASK32") == 0)
return MASKED32 (val, row, col);
if (strcmp (call, "MASK64") == 0)
return MASKED64 (val, row, col);
if (strcmp (call, "EXTRACT") == 0)
return EXTRACTED (val, row, col);
if (strcmp (call, "EXTRACT8") == 0)
return EXTRACTED8 (val, row, col);
if (strcmp (call, "EXTRACT16") == 0)
return EXTRACTED16 (val, row, col);
if (strcmp (call, "EXTRACT32") == 0)
return EXTRACTED32 (val, row, col);
if (strcmp (call, "EXTRACT64") == 0)
return EXTRACTED64 (val, row, col);
if (strcmp (call, "LSEXTRACT") == 0)
return LSEXTRACTED (val, row, col);
if (strcmp (call, "LSEXTRACT8") == 0)
return LSEXTRACTED8 (val, row, col);
if (strcmp (call, "LSEXTRACT16") == 0)
return LSEXTRACTED16 (val, row, col);
if (strcmp (call, "LSEXTRACT32") == 0)
return LSEXTRACTED32 (val, row, col);
if (strcmp (call, "LSEXTRACT64") == 0)
return LSEXTRACTED64 (val, row, col);
if (strcmp (call, "MSEXTRACT") == 0)
return MSEXTRACTED (val, row, col);
if (strcmp (call, "MSEXTRACT8") == 0)
return MSEXTRACTED8 (val, row, col);
if (strcmp (call, "MSEXTRACT16") == 0)
return MSEXTRACTED16 (val, row, col);
if (strcmp (call, "MSEXTRACT32") == 0)
return MSEXTRACTED32 (val, row, col);
if (strcmp (call, "MSEXTRACT64") == 0)
return MSEXTRACTED64 (val, row, col);
if (strcmp (call, "INSERT") == 0)
return INSERTED (val, row, col);
if (strcmp (call, "INSERT8") == 0)
return INSERTED8 (val, row, col);
if (strcmp (call, "INSERT16") == 0)
return INSERTED16 (val, row, col);
if (strcmp (call, "INSERT32") == 0)
return INSERTED32 (val, row, col);
if (strcmp (call, "INSERT64") == 0)
return INSERTED64 (val, row, col);
if (strcmp (call, "LSINSERT") == 0)
return LSINSERTED (val, row, col);
if (strcmp (call, "LSINSERT8") == 0)
return LSINSERTED8 (val, row, col);
if (strcmp (call, "LSINSERT16") == 0)
return LSINSERTED16 (val, row, col);
if (strcmp (call, "LSINSERT32") == 0)
return LSINSERTED32 (val, row, col);
if (strcmp (call, "LSINSERT64") == 0)
return LSINSERTED64 (val, row, col);
if (strcmp (call, "MSINSERT") == 0)
return MSINSERTED (val, row, col);
if (strcmp (call, "MSINSERT8") == 0)
return MSINSERTED8 (val, row, col);
if (strcmp (call, "MSINSERT16") == 0)
return MSINSERTED16 (val, row, col);
if (strcmp (call, "MSINSERT32") == 0)
return MSINSERTED32 (val, row, col);
if (strcmp (call, "MSINSERT64") == 0)
return MSINSERTED64 (val, row, col);
if (strcmp (call, "MSMASK") == 0)
return MSMASKED (val, row, col);
if (strcmp (call, "MSMASK8") == 0)
return MSMASKED8 (val, row, col);
if (strcmp (call, "MSMASK16") == 0)
return MSMASKED16 (val, row, col);
if (strcmp (call, "MSMASK32") == 0)
return MSMASKED32 (val, row, col);
if (strcmp (call, "MSMASK64") == 0)
return MSMASKED64 (val, row, col);
if (strcmp (call, "LSMASK") == 0)
return LSMASKED (val, row, col);
if (strcmp (call, "LSMASK8") == 0)
return LSMASKED8 (val, row, col);
if (strcmp (call, "LSMASK16") == 0)
return LSMASKED16 (val, row, col);
if (strcmp (call, "LSMASK32") == 0)
return LSMASKED32 (val, row, col);
if (strcmp (call, "LSMASK64") == 0)
return LSMASKED64 (val, row, col);
if (strcmp (call, "ROT64") == 0)
return ROT64 (val, col);
if (strcmp (call, "ROT8") == 0)
return ROT8 (val, col);
if (strcmp (call, "ROT16") == 0)
return ROT16 (val, col);
if (strcmp (call, "ROT32") == 0)
return ROT32 (val, col);
if (strcmp (call, "SEXT") == 0)
return SEXT (val, col);
if (strcmp (call, "SEXT8") == 0)
return SEXT8 (val, col);
if (strcmp (call, "SEXT16") == 0)
return SEXT16 (val, col);
if (strcmp (call, "SEXT32") == 0)
return SEXT32 (val, col);
if (strcmp (call, "SEXT64") == 0)
return SEXT64 (val, col);
if (strcmp (call, "LSSEXT") == 0)
return LSSEXT (val, col);
if (strcmp (call, "LSSEXT8") == 0)
return LSSEXT8 (val, col);
if (strcmp (call, "LSSEXT16") == 0)
return LSSEXT16 (val, col);
if (strcmp (call, "LSSEXT32") == 0)
return LSSEXT32 (val, col);
if (strcmp (call, "LSSEXT64") == 0)
return LSSEXT64 (val, col);
if (strcmp (call, "MSSEXT8") == 0)
return MSSEXT8 (val, col);
if (strcmp (call, "MSSEXT16") == 0)
return MSSEXT16 (val, col);
if (strcmp (call, "MSSEXT32") == 0)
return MSSEXT32 (val, col);
if (strcmp (call, "MSSEXT64") == 0)
return MSSEXT64 (val, col);
if (strcmp (call, "MSSEXT") == 0)
return MSSEXT (val, col);
else
{
fprintf (stderr,
"Unknown call passed to calc (%s, 0x%08lx%08lx, %d, %d)\n",
call, (long)(val >> 32), (long)val, row, col);
abort ();
return val;
}
}
int
check_sext (int nr_bits,
int msb_nr,
const char *sexted,
const char *masked,
const char *msmasked)
{
int errors = 0;
int col;
for (col = 0; col < nr_bits; col ++)
{
long long mask = calc (masked, -1, col, col);
long long msmask = calc (msmasked, -1,
0, (msb_nr ? nr_bits - col - 1 : col));
long long sext = calc (sexted, mask, -1, col);
long long mask_1 = mask >> 1;
long long sext_1 = calc (sexted, mask_1, -1, col);
long long mask_0 = (mask << 1) | mask_1;
long long sext_0 = calc (sexted, mask_0, -1, col);
if (sext_0 != mask_1)
{
fprintf (stderr,
"%s:%d: ", __FILE__, __LINE__);
fprintf (stderr,
" %s(0x%08lx%08lx,%d) == 0x%08lx%08lx wrong, != 0x%08lx%08lx\n",
sexted, (long)(mask_0 >> 32), (long)mask_0, col,
(long)(sext_0 >> 32), (long)sext_0,
(long)(mask_1 >> 32), (long)mask_1);
errors ++;
}
if (sext_1 != mask_1)
{
fprintf (stderr,
"%s:%d: ", __FILE__, __LINE__);
fprintf (stderr,
" %s(0x%08lx%08lx,%d) == 0x%08lx%08lx wrong, != 0x%08lx%08lx\n",
sexted, (long)(mask_1 >> 32), (long)mask_1, col,
(long)(sext_1 >> 32), (long)sext_1,
(long)(mask_1 >> 32), (long)mask_1);
errors ++;
}
if (sext != msmask)
{
fprintf (stderr,
"%s:%d: ", __FILE__, __LINE__);
fprintf (stderr,
" %s(0x%08lx%08lx,%d) == 0x%08lx%08lx wrong, != 0x%08lx%08lx (%s(%d,%d))\n",
sexted, (long)(mask >> 32), (long)mask, col,
(long)(sext >> 32), (long)sext,
(long)(msmask >> 32), (long)msmask,
msmasked, 0, (msb_nr ? nr_bits - col - 1 : col));
errors ++;
}
}
return errors;
}
int
check_rot (int nr_bits,
const char *roted,
const char *masked)
{
int errors = 0;
int row;
int col;
for (row = 0; row < nr_bits; row++)
for (col = 0; col < nr_bits; col++)
if ((WITH_TARGET_WORD_MSB == 0 && row <= col)
|| (WITH_TARGET_WORD_MSB != 0 && row >= col))
{
long long mask = calc (masked, -1, row, col);
int shift;
for (shift = -nr_bits + 1; shift < nr_bits; shift ++)
{
long long rot = calc (roted, mask, -1, shift);
long long urot = calc (roted, rot, -1, -shift);
if (mask != urot
|| (shift == 0 && rot != mask)
|| (shift != 0 && rot == mask && abs(row - col) != (nr_bits - 1)))
{
fprintf (stderr, "%s:%d: ", __FILE__, __LINE__);
fprintf (stderr, " %s(%s(0x%08lx%08lx,%d) == 0x%08lx%08lx, %d) failed\n",
roted, roted,
(long)(mask >> 32), (long)mask, shift,
(long)(urot >> 32), (long)urot, -shift);
errors ++;
}
}
}
return errors;
}
int
check_extract (int nr_bits,
const char *extracted,
const char *inserted,
const char *masked)
{
int errors = 0;
int row;
int col;
for (row = 0; row < nr_bits; row++)
for (col = 0; col < nr_bits; col ++)
if ((WITH_TARGET_WORD_MSB == 0 && row <= col)
|| (WITH_TARGET_WORD_MSB != 0 && row >= col))
{
long long mask = calc (masked, -1, row, col);
long long extr = calc (extracted, mask, row, col);
long long inst = calc (inserted, extr, row, col);
if (mask != inst)
{
fprintf (stderr, "%s:%d: ", __FILE__, __LINE__);
fprintf (stderr, " %s(%d,%d)=0x%08lx%08lx -> %s=0x%08lx%08lx -> %s=0x%08lx%08lx failed\n",
masked, row, col, (long)(mask >> 32), (long)mask,
extracted, (long)(extr >> 32), (long)extr,
inserted, (long)(inst >> 32), (long)inst);
errors ++;
}
}
return errors;
}
int
check_bits (int call,
test_spec **tests)
{
int r;
int c;
int errors = 0;
while (*tests != NULL)
{
int nr_rows = (*tests)->nr_rows;
int nr_cols = (*tests)->nr_cols;
test_tuples *tuples = (*tests)->tuples;
for (r = 0; r < nr_rows; r++)
for (c = 0; c < nr_cols; c++)
{
int i = r * nr_rows + c;
test_tuples *tuple = &tuples[i];
if (tuple->col >= 0)
{
long long val = (!call ? tuple->val : calc ((*tests)->macro, -1,
tuple->row, tuple->col));
long long check = tuple->check;
if (val != check)
{
fprintf (stderr, "%s:%d:", (*tests)->file, tuple->line);
fprintf (stderr, " %s", (*tests)->macro);
if (tuple->row >= 0)
fprintf (stderr, " (%d, %d)", tuple->row, tuple->col);
else
fprintf (stderr, " (%d)", tuple->col);
fprintf (stderr, " == 0x%08lx%08lx wrong, != 0x%08lx%08lx\n",
(long) (val >> 32), (long) val,
(long) (check >> 32), (long) check);
errors ++;
}
}
}
tests ++;
}
return errors;
}
int
main (argc, argv)
int argc;
char **argv;
{
int errors = 0;
#if defined (DO_BIT_TESTS)
printf ("Checking BIT*\n");
errors += check_bits (0, bit_tests);
#endif
#if defined (DO_MASK_TESTS)
printf ("Checking MASK*\n");
errors += check_bits (0, mask_tests);
printf ("Checking MASKED*\n");
errors += check_bits (1, mask_tests);
#endif
#if defined (DO_LSMASK_TESTS)
printf ("Checking LSMASK*\n");
errors += check_bits (0, lsmask_tests);
printf ("Checking LSMASKED*\n");
errors += check_bits (1, lsmask_tests);
#endif
#if defined (DO_MSMASK_TESTS)
printf ("Checking MSMASK*\n");
errors += check_bits (0, msmask_tests);
printf ("Checking MSMASKED*\n");
errors += check_bits (1, msmask_tests);
#endif
printf ("Checking EXTRACTED*\n");
errors += check_extract ( 8, "EXTRACT8", "INSERT8", "MASK8");
errors += check_extract (16, "EXTRACT16", "INSERT16", "MASK16");
errors += check_extract (32, "EXTRACT32", "INSERT32", "MASK32");
errors += check_extract (64, "EXTRACT64", "INSERT64", "MASK64");
errors += check_extract (64, "EXTRACT", "INSERT", "MASK");
printf ("Checking SEXT*\n");
errors += check_sext ( 8, WITH_TARGET_WORD_MSB, "SEXT8", "MASK8", "MSMASK8");
errors += check_sext (16, WITH_TARGET_WORD_MSB, "SEXT16", "MASK16", "MSMASK16");
errors += check_sext (32, WITH_TARGET_WORD_MSB, "SEXT32", "MASK32", "MSMASK32");
errors += check_sext (64, WITH_TARGET_WORD_MSB, "SEXT64", "MASK64", "MSMASK64");
errors += check_sext (64, WITH_TARGET_WORD_MSB, "SEXT", "MASK", "MSMASK");
printf ("Checking LSSEXT*\n");
errors += check_sext ( 8, 8 - 1, "LSSEXT8", "LSMASK8", "MSMASK8");
errors += check_sext (16, 16 - 1, "LSSEXT16", "LSMASK16", "MSMASK16");
errors += check_sext (32, 32 - 1, "LSSEXT32", "LSMASK32", "MSMASK32");
errors += check_sext (64, 64 - 1, "LSSEXT64", "LSMASK64", "MSMASK64");
errors += check_sext (64, WITH_TARGET_WORD_BITSIZE - 1, "LSSEXT", "LSMASK", "MSMASK");
printf ("Checking MSSEXT*\n");
errors += check_sext (8, 0, "MSSEXT8", "MSMASK8", "MSMASK8");
errors += check_sext (16, 0, "MSSEXT16", "MSMASK16", "MSMASK16");
errors += check_sext (32, 0, "MSSEXT32", "MSMASK32", "MSMASK32");
errors += check_sext (64, 0, "MSSEXT64", "MSMASK64", "MSMASK64");
errors += check_sext (64, 0, "MSSEXT", "MSMASK", "MSMASK");
printf ("Checking ROT*\n");
errors += check_rot (16, "ROT16", "MASK16");
errors += check_rot (32, "ROT32", "MASK32");
errors += check_rot (64, "ROT64", "MASK64");
return errors != 0;
}
| 30.05868 | 97 | 0.571905 |
e179f8427e05eed7b72edd6195a07047b168dff8 | 563 | h | C | Netcode/Uri/Texture.h | tyekx/netcode | c46fef1eeb33ad029d0c262d39309dfa83f76c4d | [
"MIT"
] | null | null | null | Netcode/Uri/Texture.h | tyekx/netcode | c46fef1eeb33ad029d0c262d39309dfa83f76c4d | [
"MIT"
] | null | null | null | Netcode/Uri/Texture.h | tyekx/netcode | c46fef1eeb33ad029d0c262d39309dfa83f76c4d | [
"MIT"
] | null | null | null | #pragma once
#include "AssetBase.h"
namespace Netcode::URI {
class Texture : public AssetBase {
public:
Texture() = default;
Texture(const wchar_t * relativePath);
Texture(std::wstring relativePath);
Texture(std::wstring fullPath, FullPathToken);
const std::wstring & GetTexturePath() const;
static Texture Parse(UriBase uri);
static Texture AsExtensionOf(const AssetBase & anotherAsset, std::wstring relativeToAssetPath);
constexpr static std::wstring_view GetGlobalId() {
return std::wstring_view{ L"/Asset/Texture/" };
}
};
}
| 21.653846 | 97 | 0.726465 |
7cc013f2a91ce02859343796e5d4ea6f8f05524d | 3,018 | h | C | Resources/WC_7_0_5_Headers/MetalImageVideoCamera.h | shuangwei-Ye/WeChat_tweak | 0f496f38f0336908258d606dcbef7067a096926a | [
"MIT"
] | 2 | 2021-05-30T07:50:20.000Z | 2022-02-23T15:42:53.000Z | Resources/WC_7_0_5_Headers/MetalImageVideoCamera.h | LP36911/WeChat_tweak | 0f496f38f0336908258d606dcbef7067a096926a | [
"MIT"
] | null | null | null | Resources/WC_7_0_5_Headers/MetalImageVideoCamera.h | LP36911/WeChat_tweak | 0f496f38f0336908258d606dcbef7067a096926a | [
"MIT"
] | null | null | null | //
// Generated by class-dump 3.5 (64 bit).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2013 by Steve Nygard.
//
#import "MetalImageOutput.h"
#import "AVCaptureVideoDataOutputSampleBufferDelegate.h"
@class AVCaptureDevice, AVCaptureDeviceInput, AVCaptureSession, AVCaptureVideoDataOutput, MetalImageColorConversion, NSObject<OS_dispatch_queue>, NSObject<OS_dispatch_semaphore>, NSString;
@interface MetalImageVideoCamera : MetalImageOutput <AVCaptureVideoDataOutputSampleBufferDelegate>
{
unsigned long long numberOfFramesCaptured;
double totalFrameTimeDuringCapture;
AVCaptureSession *_captureSession;
AVCaptureDevice *_inputCamera;
AVCaptureDeviceInput *videoInput;
AVCaptureVideoDataOutput *videoOutput;
_Bool capturePaused;
unsigned long long outputRotation;
NSObject<OS_dispatch_semaphore> *frameRenderingSemaphore;
NSObject<OS_dispatch_queue> *cameraProcessingQueue;
unsigned int _videoOutputPixelFormat;
MetalImageColorConversion *_conversion;
long long cameraPos;
_Bool _horizontallyMirrorFrontFacingCamera;
_Bool _horizontallyMirrorRearFacingCamera;
int _frameRate;
NSString *_captureSessionPreset;
long long _outputImageOrientation;
}
+ (_Bool)isBackFacingCameraPresent;
+ (_Bool)isFrontFacingCameraPresent;
- (void).cxx_destruct;
- (long long)cameraPosition;
- (void)captureOutput:(id)arg1 didOutputSampleBuffer:(struct opaqueCMSampleBuffer *)arg2 fromConnection:(id)arg3;
@property(readonly, retain, nonatomic) AVCaptureSession *captureSession; // @synthesize captureSession=_captureSession;
@property(copy, nonatomic) NSString *captureSessionPreset; // @synthesize captureSessionPreset=_captureSessionPreset;
- (void)dealloc;
@property(nonatomic) int frameRate; // @synthesize frameRate=_frameRate;
@property(nonatomic) _Bool horizontallyMirrorFrontFacingCamera; // @synthesize horizontallyMirrorFrontFacingCamera=_horizontallyMirrorFrontFacingCamera;
@property(nonatomic) _Bool horizontallyMirrorRearFacingCamera; // @synthesize horizontallyMirrorRearFacingCamera=_horizontallyMirrorRearFacingCamera;
- (id)init;
- (id)initWithSessionPreset:(id)arg1 cameraPosition:(long long)arg2;
- (_Bool)isCameraRunning;
@property(nonatomic) long long outputImageOrientation; // @synthesize outputImageOrientation=_outputImageOrientation;
- (void)pauseCameraCapture;
- (void)processVideoSampleBuffer:(struct opaqueCMSampleBuffer *)arg1;
- (void)resumeCameraCapture;
- (unsigned long long)rotationForOutput;
@property(nonatomic) unsigned int videoOutputPixelFormat; // @synthesize videoOutputPixelFormat=_videoOutputPixelFormat;
- (void)startCameraCapture;
- (void)stopCameraCapture;
- (void)switchCameraDevice;
- (void)updateColorConversionWithAttachments:(void *)arg1;
- (void)updateOrientation;
// Remaining properties
@property(readonly, copy) NSString *debugDescription;
@property(readonly, copy) NSString *description;
@property(readonly) unsigned long long hash;
@property(readonly) Class superclass;
@end
| 43.73913 | 188 | 0.815772 |
f5a47a127dc0cbffd79d80b5f076f1b9850d0642 | 1,975 | h | C | src/sendframe.h | Zurocoin/zurocoin-gui | f9b1e2d2af9e2b332ce5ce244095e5a1fdfcafc8 | [
"MIT"
] | null | null | null | src/sendframe.h | Zurocoin/zurocoin-gui | f9b1e2d2af9e2b332ce5ce244095e5a1fdfcafc8 | [
"MIT"
] | null | null | null | src/sendframe.h | Zurocoin/zurocoin-gui | f9b1e2d2af9e2b332ce5ce244095e5a1fdfcafc8 | [
"MIT"
] | null | null | null | // Copyright (c) 2015-2018, The Bytecoin developers, The Zurocoin developers.
// Licensed under the GNU Lesser General Public License. See LICENSE for details.
#pragma once
#include <QFrame>
#include <QScrollArea>
class QAbstractItemModel;
namespace Ui {
class SendFrame;
}
namespace RpcApi {
struct Transaction;
}
namespace WalletGUI {
class TransferFrame;
class WalletModel;
class MainWindow;
class AddressBookManager;
class SendFrame : public QFrame
{
Q_OBJECT
Q_DISABLE_COPY(SendFrame)
public:
explicit SendFrame(QWidget* parent);
~SendFrame();
void addRecipient(const QString& address, const QString& label = QString());
void setWalletModel(WalletModel* model);
void setMainWindow(MainWindow* mainWindow);
void setAddressBookModel(QAbstractItemModel* model);
void setAddressBookManager(AddressBookManager* manager);
Q_SLOT void clearAll();
Q_SLOT void cancelSend();
private:
QScopedPointer<Ui::SendFrame> m_ui;
MainWindow* m_mainWindow;
QList<TransferFrame*> m_transfers;
WalletModel* walletModel_;
QAbstractItemModel* addressBookModel_;
AddressBookManager* addressBookManager_;
void setPaymentIdError(bool error);
void setMixinError(bool error);
void setFeeFormatError(bool error);
void updateMixinSliderStyleSheet();
void amountStringChanged(const QString& amountString);
void addressChanged(const QString& address);
bool readyToSend() const;
quint64 getFeeFromSlider(int sliderValue) const;
Q_SLOT void addRecipientClicked();
Q_SLOT void sendClicked();
Q_SLOT void mixinValueChanged(int value);
Q_SLOT void feeValueChanged(int value);
Q_SLOT void validatePaymentId(const QString& paymentId);
Q_SLOT void updateFee(const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector<int> &roles);
Q_SIGNALS:
void showTransactionsFrameSignal();
void createTxSignal(const RpcApi::Transaction& tx, quint64 fee);
};
}
| 26.689189 | 113 | 0.756456 |
f5b8580d256737d9d77f6a08971a268cea5e9f35 | 1,570 | h | C | AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/alideviceinfoDeviceBusinessReqPB.h | ceekay1991/AliPayForDebug | 5795e5db31e5b649d4758469b752585e63e84d94 | [
"MIT"
] | 5 | 2020-03-29T12:08:37.000Z | 2021-05-26T05:20:11.000Z | AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/alideviceinfoDeviceBusinessReqPB.h | ceekay1991/AliPayForDebug | 5795e5db31e5b649d4758469b752585e63e84d94 | [
"MIT"
] | null | null | null | AliPayForDebug/AliPayForDebug/AlipayWallet_Headers/alideviceinfoDeviceBusinessReqPB.h | ceekay1991/AliPayForDebug | 5795e5db31e5b649d4758469b752585e63e84d94 | [
"MIT"
] | 5 | 2020-04-17T03:24:04.000Z | 2022-03-30T05:42:17.000Z | //
// Generated by class-dump 3.5 (64 bit) (Debug version compiled Sep 17 2017 16:24:48).
//
// class-dump is Copyright (C) 1997-1998, 2000-2001, 2004-2015 by Steve Nygard.
//
#import "APDPBGeneratedMessage.h"
@class NSString, PBMapStringString;
@interface alideviceinfoDeviceBusinessReqPB : APDPBGeneratedMessage
{
}
+ (CDStruct_af61540b *)_fieldInfos;
// Remaining properties
@property(retain, nonatomic) NSString *bizId; // @dynamic bizId;
@property(retain, nonatomic) PBMapStringString *bizParams; // @dynamic bizParams;
@property(retain, nonatomic) NSString *bizType; // @dynamic bizType;
@property(retain, nonatomic) PBMapStringString *extParams; // @dynamic extParams;
@property(readonly) _Bool hasBizId; // @dynamic hasBizId;
@property(readonly) _Bool hasBizParams; // @dynamic hasBizParams;
@property(readonly) _Bool hasBizType; // @dynamic hasBizType;
@property(readonly) _Bool hasExtParams; // @dynamic hasExtParams;
@property(readonly) _Bool hasTerminalId; // @dynamic hasTerminalId;
@property(readonly) _Bool hasTerminalParams; // @dynamic hasTerminalParams;
@property(readonly) _Bool hasTerminalType; // @dynamic hasTerminalType;
@property(readonly) _Bool hasVerifyParams; // @dynamic hasVerifyParams;
@property(retain, nonatomic) NSString *terminalId; // @dynamic terminalId;
@property(retain, nonatomic) PBMapStringString *terminalParams; // @dynamic terminalParams;
@property(retain, nonatomic) NSString *terminalType; // @dynamic terminalType;
@property(retain, nonatomic) PBMapStringString *verifyParams; // @dynamic verifyParams;
@end
| 42.432432 | 91 | 0.773248 |
11e59007b48f0634d6363ad037397c07ec9f1169 | 3,037 | c | C | pier14/avr/main.c | FlamingLotusGirls/soma | df0da411d5b4e1f3a37a09fd4bd3ec3407aec7b5 | [
"Apache-2.0"
] | 1 | 2015-01-15T17:01:29.000Z | 2015-01-15T17:01:29.000Z | pier14/avr/main.c | FlamingLotusGirls/soma | df0da411d5b4e1f3a37a09fd4bd3ec3407aec7b5 | [
"Apache-2.0"
] | null | null | null | pier14/avr/main.c | FlamingLotusGirls/soma | df0da411d5b4e1f3a37a09fd4bd3ec3407aec7b5 | [
"Apache-2.0"
] | 1 | 2015-10-29T18:15:53.000Z | 2015-10-29T18:15:53.000Z | // vim:set ts=4 sw=4 ai:
/*
* Copyright 2009 Erik Gilling
* Copyright 2014 Michael Toren <mct@toren.net>
*
* 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 <avr/interrupt.h>
#include <avr/wdt.h>
#include "uart.h"
#include "config.h"
#include "pins.h"
#include "gamma_correction_table_1023.h"
#define PWM_RESOLUTION 1023
#ifdef OLD_PROTO
#include "proto.h"
#else
#include "proto2.h"
#endif
uint16_t led_val[3];
uint16_t back_buffer[3];
void handle_rgb(uint8_t red, uint8_t green, uint8_t blue)
{
back_buffer[0] = gamma_correction[red];
back_buffer[1] = gamma_correction[green];
back_buffer[2] = gamma_correction[blue];
}
void handle_latch(void)
{
led_val[0] = back_buffer[0];
led_val[1] = back_buffer[1];
led_val[2] = back_buffer[2];
}
void handle_baud(uint32_t baud)
{
if (!baud)
baud = BAUD;
uart_init(baud);
}
proto_t state = {
.latch_callback = handle_latch,
.rgb_callback = handle_rgb,
.baud_callback = handle_baud,
};
ISR( TIMER0_COMPA_vect )
{
static uint16_t phase;
uint16_t tmp_phase;
uint8_t port;
PORTD ^= _BV(D_TP1);
PORTD |= _BV(D_TP2);
port = PORTC;
phase++;
if (phase > PWM_RESOLUTION)
phase = 1;
tmp_phase = phase;
if (led_val[0] >= tmp_phase)
port |= _BV(C_RED);
else
port &= ~_BV(C_RED);
// if (tmp_phase <= led_val[0])
// tmp_phase += PWM_RESOLUTION - led_val[0];
// else
// tmp_phase -= led_val[0];
if (led_val[1] >= tmp_phase)
port |= _BV(C_GREEN);
else
port &= ~_BV(C_GREEN);
// if (tmp_phase <= led_val[1])
// tmp_phase += PWM_RESOLUTION - led_val[1];
// else
// tmp_phase -= led_val[1];
if (led_val[2] >= tmp_phase)
port |= _BV(C_BLUE);
else
port &= ~_BV(C_BLUE);
PORTC = port;
PORTD &= ~_BV(D_TP2);
}
void hw_setup(void)
{
DDRB = _BV(B_TP4) | _BV(B_TP5);
DDRC = _BV(C_RED) | _BV(C_GREEN) | _BV(C_BLUE) | _BV(C_RED_OD) | _BV(C_GREEN_OD) | _BV(C_BLUE_OD);
DDRD = _BV(D_DATA_LED) | _BV(D_GREEN_OD2) | _BV(D_BLUE_OD2) | _BV(D_TP1) | _BV(D_TP2) | _BV(D_TP3);
/* set TC into CTC mode */
TCCR0A = _BV(WGM01);
/* enable output compare interrupt */
TIMSK0 = _BV(OCIE0A);
/* interrupt at ~146 kHz (1024 levels at ~140 Hz PWM) */
TCCR0B = _BV(CS01) | _BV(CS00);
OCR0A = 1;
}
int main(void)
{
cli();
hw_setup();
config_init();
uart_init(BAUD);
proto_init(&state, config.addr);
sei();
wdt_enable(WDTO_1S);
while (1) {
wdt_reset();
if (uart_char_avail()) {
PORTD |= _BV(D_DATA_LED);
PORTD |= _BV(D_TP3);
proto_recv(&state, UDR0);
PORTD &= ~_BV(D_TP3);
PORTD &= ~_BV(D_DATA_LED);
}
}
} | 20.659864 | 100 | 0.671057 |
102a67d43538336abc7cf5f526a738a1694605cd | 374 | c | C | origin_code/code/07/queues.c | ShaneDean/ooc | 6f841fdfb0211fe0bc106514d36ddaac4a8bf865 | [
"MIT"
] | null | null | null | origin_code/code/07/queues.c | ShaneDean/ooc | 6f841fdfb0211fe0bc106514d36ddaac4a8bf865 | [
"MIT"
] | null | null | null | origin_code/code/07/queues.c | ShaneDean/ooc | 6f841fdfb0211fe0bc106514d36ddaac4a8bf865 | [
"MIT"
] | null | null | null | #include "Queue.h"
int main (int argc, char ** argv)
{ void * q;
unsigned n;
initQueue();
q = new(Queue, 1);
while (* ++ argv)
switch (** argv) {
case '+':
add(q, *argv + 1);
break;
case '-':
puts((char *) take(q));
break;
default:
n = count(q);
while (n -- > 0)
{ const void * p = take(q);
puts(p), add(q, p);
}
}
return 0;
}
| 13.357143 | 33 | 0.481283 |
efe96dbc598d8d67859ddbf11954959b6c020b48 | 23,556 | c | C | src/common_packages.c | nptcl/npt | 608c1bf38380aaa9e20748458b7f091da898d535 | [
"Unlicense"
] | 37 | 2019-02-24T00:07:11.000Z | 2022-03-03T09:41:43.000Z | src/common_packages.c | nptcl/npt | 608c1bf38380aaa9e20748458b7f091da898d535 | [
"Unlicense"
] | 9 | 2019-07-01T04:08:36.000Z | 2021-06-13T03:51:43.000Z | src/common_packages.c | nptcl/npt | 608c1bf38380aaa9e20748458b7f091da898d535 | [
"Unlicense"
] | 2 | 2019-04-11T04:01:02.000Z | 2019-07-15T08:21:00.000Z | /*
* ANSI COMMON LISP: 11. Packages
*/
#include "call_packages.h"
#include "common_header.h"
#include "cons.h"
#include "cons_list.h"
#include "package.h"
#include "package_delete.h"
#include "package_defpackage.h"
#include "package_object.h"
/* (defun export (symbols &optional package) ...) -> (eql t)
* symbols (or list symbol)
* package (or string character symbol package) ;; package-designer
*/
static int function_export(Execute ptr, addr symbols, addr package)
{
Return(export_common_(ptr, symbols, package));
setresult_control(ptr, T);
return 0;
}
static void defun_export(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_EXPORT, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_export);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, Export);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun find-symbol (string &optional package) ...) -> symbol, status
* package package-designer
* status (member :inherited :external :interal nil)
*/
static int function_find_symbol(Execute ptr, addr name, addr package)
{
Return(find_symbol_common_(ptr, name, package, &name, &package));
setvalues_control(ptr, name, package, NULL);
return 0;
}
static void defun_find_symbol(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_FIND_SYMBOL, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_find_symbol);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, Intern);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun find-package (name) ...) -> package */
static int function_find_package(Execute ptr, addr name)
{
Return(find_package_(name, &name));
setresult_control(ptr, name);
return 0;
}
static void type_find_package(addr *ret)
{
addr args, values;
GetTypeTable(&args, StringDesigner);
typeargs_var1(&args, args);
GetTypeValues(&values, PackageNull);
type_compiled_heap(args, values, ret);
}
static void defun_find_package(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_FIND_PACKAGE, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_find_package);
SetFunctionCommon(symbol, pos);
/* type */
type_find_package(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun find-all-symbols (string) ...) -> symbols
* string string-designer
* symbols list
*/
static int function_find_all_symbols(Execute ptr, addr name)
{
Return(find_allsymbols_package_(name, &name));
setresult_control(ptr, name);
return 0;
}
static void type_find_all_symbols(addr *ret)
{
addr args, values;
GetTypeTable(&args, StringDesigner);
typeargs_var1(&args, args);
GetTypeValues(&values, List);
type_compiled_heap(args, values, ret);
}
static void defun_find_all_symbols(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_FIND_ALL_SYMBOLS, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_find_all_symbols);
SetFunctionCommon(symbol, pos);
/* type */
type_find_all_symbols(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun import (symbols &optional package) ...) -> (eql t)
* symbols (or list symbol)
* package package-designer
*/
static int function_import(Execute ptr, addr symbols, addr package)
{
Return(import_common_(ptr, symbols, package));
setresult_control(ptr, T);
return 0;
}
static void defun_import(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_IMPORT, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_import);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, Export);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun list-all-packages () ...) -> list */
static int function_list_all_packages(Execute ptr)
{
addr list;
Return(list_all_packages_(&list));
setresult_control(ptr, list);
return 0;
}
static void type_list_all_packages(addr *ret)
{
addr args, values;
GetTypeArgs(&args, Empty);
GetTypeValues(&values, List);
type_compiled_heap(args, values, ret);
}
static void defun_list_all_packages(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_LIST_ALL_PACKAGES, &symbol);
compiled_system(&pos, symbol);
setcompiled_empty(pos, p_defun_list_all_packages);
SetFunctionCommon(symbol, pos);
/* type */
type_list_all_packages(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun rename-package (package name &optional nicknames) ...) -> value
* package package-designer
* name package-designer
* nicknames list
* value package
*/
static int function_rename_package(Execute ptr,
addr package, addr name, addr nicknames)
{
Return(rename_package_common_(ptr, package, name, nicknames, &package));
setresult_control(ptr, package);
return 0;
}
static void type_rename_package(addr *ret)
{
addr args, values;
GetTypeTable(&args, PackageDesigner);
GetTypeTable(&values, List);
typeargs_var2opt1(&args, args, args, values);
GetTypeValues(&values, Package);
type_compiled_heap(args, values, ret);
}
static void defun_rename_package(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_RENAME_PACKAGE, &symbol);
compiled_system(&pos, symbol);
setcompiled_var2opt1(pos, p_defun_rename_package);
SetFunctionCommon(symbol, pos);
/* type */
type_rename_package(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun shadow (symbols &optional package) ...) -> (eql t)
* symbols (or list string-designer)
* package package-designer
*/
static int function_shadow(Execute ptr, addr symbols, addr package)
{
Return(shadow_common_(ptr, symbols, package));
setresult_control(ptr, T);
return 0;
}
static void type_shadow(addr *ret)
{
addr args, values, type1, type2;
GetTypeTable(&type1, List);
GetTypeTable(&type2, StringDesigner);
type2or_heap(type1, type2, &args);
GetTypeTable(&values, PackageDesigner);
typeargs_var1opt1(&args, args, values);
GetTypeValues(&values, EqlT);
type_compiled_heap(args, values, ret);
}
static void defun_shadow(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_SHADOW, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_shadow);
SetFunctionCommon(symbol, pos);
/* type */
type_shadow(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun shadowing-import (symbols &optional package) ...) -> (eql t)
* symbols (or list symbol)
* package package-designer
*/
static int function_shadowing_import(Execute ptr, addr symbols, addr package)
{
Return(shadowing_import_common_(ptr, symbols, package));
setresult_control(ptr, T);
return 0;
}
static void defun_shadowing_import(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_SHADOWING_IMPORT, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_shadowing_import);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, Export);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun delete-package (package) ...) -> booelan
* package package-designer
*/
static int function_delete_package(Execute ptr, addr package)
{
int check;
Return(delete_package_(package, &check));
setbool_control(ptr, ! check);
return 0;
}
static void type_delete_package(addr *ret)
{
addr args, values;
GetTypeArgs(&args, PackageDesigner);
GetTypeValues(&values, Boolean);
type_compiled_heap(args, values, ret);
}
static void defun_delete_package(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_DELETE_PACKAGE, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_delete_package);
SetFunctionCommon(symbol, pos);
/* type */
type_delete_package(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun make-package (name &key nicknames use) ...) -> package
* name string-designer
* nicknames list
* use list
* package package
*/
static int function_make_package(Execute ptr, addr name, addr rest)
{
Return(make_package_common_(ptr, name, rest, &name));
setresult_control(ptr, name);
return 0;
}
static void type_make_package(addr *ret)
{
addr args, values, type1, type2, symbol, type, key;
/* args */
GetTypeTable(&args, StringDesigner);
GetTypeTable(&type, List);
GetConst(KEYWORD_NICKNAMES, &symbol);
cons_heap(&type1, symbol, type);
GetConst(KEYWORD_USE, &symbol);
cons_heap(&type2, symbol, type);
list_heap(&key, type1, type2, NULL);
typeargs_var1key(&args, args, key);
/* values */
GetTypeValues(&values, Package);
type_compiled_heap(args, values, ret);
}
static void defun_make_package(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_MAKE_PACKAGE, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1dynamic(pos, p_defun_make_package);
SetFunctionCommon(symbol, pos);
/* type */
type_make_package(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defmacro with-package-iterator ((name list &rest types) &body body) ...) */
static int function_with_package_iterator(Execute ptr, addr form, addr env)
{
Return(with_package_iterator_common(ptr, form, env, &form));
setresult_control(ptr, form);
return 0;
}
static void defmacro_with_package_iterator(void)
{
addr symbol, pos, type;
GetConst(COMMON_WITH_PACKAGE_ITERATOR, &symbol);
compiled_macro_system(&pos, symbol);
setcompiled_macro(pos, p_defmacro_with_package_iterator);
SetMacroCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, MacroFunction);
settype_function(pos, type);
}
/* (defun unexport (symbols &optional package) ...) -> (eql t)
* symbols (or list symbol)
* package (or string character symbol package) ;; package-designer
*/
static int function_unexport(Execute ptr, addr symbols, addr package)
{
Return(unexport_common_(ptr, symbols, package));
setresult_control(ptr, T);
return 0;
}
static void defun_unexport(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_UNEXPORT, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_unexport);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, Export);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun unintern (symbol &optional package) ...) -> boolean
* package package-designer
*/
static int function_unintern(Execute ptr, addr symbol, addr package)
{
Return(unintern_common_(ptr, symbol, package, &package));
setresult_control(ptr, package);
return 0;
}
static void type_unintern(addr *ret)
{
addr args, values;
GetTypeTable(&args, Symbol);
GetTypeTable(&values, PackageDesigner);
typeargs_var1opt1(&args, args, values);
GetTypeValues(&values, Boolean);
type_compiled_heap(args, values, ret);
}
static void defun_unintern(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_UNINTERN, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_unintern);
SetFunctionCommon(symbol, pos);
/* type */
type_unintern(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defmacro in-package (name) ...) */
static int function_in_package(Execute ptr, addr form, addr env)
{
Return(in_package_common(ptr, form, env, &form));
setresult_control(ptr, form);
return 0;
}
static void defmacro_in_package(void)
{
addr symbol, pos, type;
GetConst(COMMON_IN_PACKAGE, &symbol);
compiled_macro_system(&pos, symbol);
setcompiled_macro(pos, p_defmacro_in_package);
SetMacroCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, MacroFunction);
settype_function(pos, type);
}
/* (defun unuse-package (list &optional package) ...) -> t
* list (or package-designer list)
* package package-designer
*/
static int function_unuse_package(Execute ptr, addr unuse, addr package)
{
Return(unuse_package_common_(ptr, unuse, package));
setresult_control(ptr, T);
return 0;
}
static void defun_unuse_package(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_UNUSE_PACKAGE, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_unuse_package);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, UsePackage);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun use-package (list &optional package) ...) -> t
* list (or package-designer list)
* package package-designer
*/
static int function_use_package(Execute ptr, addr use, addr package)
{
Return(use_package_common_(ptr, use, package));
setresult_control(ptr, T);
return 0;
}
static void defun_use_package(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_USE_PACKAGE, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_use_package);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, UsePackage);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defmacro defpackage (name &rest options) ...) -> package
* options ::= (:nicknames nickname*)* |
* (:documentation string) |
* (:use package-name*)* |
* (:shadow {symbol-name}*)* |
* (:shadowing-import-from package-name {symbol-name}*)* |
* (:import-from package-name {symbol-name}*)* |
* (:export {symbol-name}*)* |
* (:intern {symbol-name}*)* |
* (:size integer)
*/
static int function_defpackage(Execute ptr, addr form, addr env)
{
Return(defpackage_common(form, env, &form));
setresult_control(ptr, form);
return 0;
}
static void defmacro_defpackage(void)
{
addr symbol, pos, type;
GetConst(COMMON_DEFPACKAGE, &symbol);
compiled_macro_system(&pos, symbol);
setcompiled_macro(pos, p_defmacro_defpackage);
SetMacroCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, MacroFunction);
settype_function(pos, type);
}
/* (defmacro do-symbols (var &optional package result) . tagbody) */
static int function_do_symbols(Execute ptr, addr form, addr env)
{
Return(do_symbols_common(form, env, &form));
setresult_control(ptr, form);
return 0;
}
static void defmacro_do_symbols(void)
{
addr symbol, pos, type;
GetConst(COMMON_DO_SYMBOLS, &symbol);
compiled_macro_system(&pos, symbol);
setcompiled_macro(pos, p_defmacro_do_symbols);
SetMacroCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, MacroFunction);
settype_function(pos, type);
}
/* (defmacro do-external-symbols (var &optional package result) . tagbody) */
static int function_do_external_symbols(Execute ptr, addr form, addr env)
{
Return(do_external_symbols_common(form, env, &form));
setresult_control(ptr, form);
return 0;
}
static void defmacro_do_external_symbols(void)
{
addr symbol, pos, type;
GetConst(COMMON_DO_EXTERNAL_SYMBOLS, &symbol);
compiled_macro_system(&pos, symbol);
setcompiled_macro(pos, p_defmacro_do_external_symbols);
SetMacroCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, MacroFunction);
settype_function(pos, type);
}
/* (defmacro do-all-symbols (var &optional result) . tagbody) */
static int function_do_all_symbols(Execute ptr, addr form, addr env)
{
Return(do_all_symbols_common(form, env, &form));
setresult_control(ptr, form);
return 0;
}
static void defmacro_do_all_symbols(void)
{
addr symbol, pos, type;
GetConst(COMMON_DO_ALL_SYMBOLS, &symbol);
compiled_macro_system(&pos, symbol);
setcompiled_macro(pos, p_defmacro_do_all_symbols);
SetMacroCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, MacroFunction);
settype_function(pos, type);
}
/* (defun intern (string &optional package) ...) -> symbol, status
* package package-designer
* status (member :inherited :external :interal nil)
*/
static int function_intern(Execute ptr, addr name, addr package)
{
Return(intern_common_(ptr, name, package, &name, &package));
setvalues_control(ptr, name, package, NULL);
return 0;
}
static void defun_intern(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_INTERN, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1opt1(pos, p_defun_intern);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, Intern);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun package-name (package) ...) -> name
* package package-designer
* name (or string null)
*/
static int function_package_name(Execute ptr, addr package)
{
Return(getname_package_(package, &package));
setresult_control(ptr, package);
return 0;
}
static void type_package_name(addr *ret)
{
addr args, values;
GetTypeArgs(&args, PackageDesigner);
GetTypeValues(&values, StringNull);
type_compiled_heap(args, values, ret);
}
static void defun_package_name(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_PACKAGE_NAME, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_package_name);
SetFunctionCommon(symbol, pos);
/* type */
type_package_name(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun package-nicknames (package) ...) -> list */
static int function_package_nicknames(Execute ptr, addr package)
{
Return(getnickname_package_(package, &package));
setresult_control(ptr, package);
return 0;
}
static void defun_package_nicknames(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_PACKAGE_NICKNAMES, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_package_nicknames);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, PackageNicknames);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun package-shadowing-symbols (package) ...) -> list */
static int function_package_shadowing_symbols(Execute ptr, addr package)
{
Return(getshadow_package_(package, &package));
setresult_control(ptr, package);
return 0;
}
static void defun_package_shadowing_symbols(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_PACKAGE_SHADOWING_SYMBOLS, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_package_shadowing_symbols);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, PackageNicknames);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun package-use-list (package) ...) -> list */
static int function_package_use_list(Execute ptr, addr package)
{
Return(getuselist_package_(package, &package));
setresult_control(ptr, package);
return 0;
}
static void defun_package_use_list(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_PACKAGE_USE_LIST, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_package_use_list);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, PackageNicknames);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun package-used-by-list (package) ...) -> list */
static int function_package_used_by_list(Execute ptr, addr package)
{
Return(getusedbylist_package_(package, &package));
setresult_control(ptr, package);
return 0;
}
static void defun_package_used_by_list(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_PACKAGE_USED_BY_LIST, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_package_used_by_list);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, PackageNicknames);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defun packagep (object) ...) -> boolean */
static int function_packagep(Execute ptr, addr var)
{
setbool_control(ptr, GetType(var) == LISPTYPE_PACKAGE);
return 0;
}
static void defun_packagep(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_PACKAGEP, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_packagep);
SetFunctionCommon(symbol, pos);
/* type */
GetTypeCompiled(&type, Object_Boolean);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/* (defvar *package*) */
static void defvar_package(void)
{
addr symbol, type;
/* symbol */
GetConst(SPECIAL_PACKAGE, &symbol);
setspecial_symbol(symbol);
/* type */
GetTypeTable(&type, Package);
settype_value_symbol(symbol, type);
}
/* (defun package-error-package (package-error) ...) -> package-designer */
static int function_package_error_package(Execute ptr, addr var)
{
Return(package_error_package_(var, &var));
setresult_control(ptr, var);
return 0;
}
static void type_package_error_package(addr *ret)
{
addr args, values;
GetTypeTable(&args, PackageError);
typeargs_var1(&args, args);
GetTypeTable(&values, PackageDesigner);
typevalues_result(&values, values);
type_compiled_heap(args, values, ret);
}
static void defun_package_error_package(void)
{
addr symbol, pos, type;
/* function */
GetConst(COMMON_PACKAGE_ERROR_PACKAGE, &symbol);
compiled_system(&pos, symbol);
setcompiled_var1(pos, p_defun_package_error_package);
SetFunctionCommon(symbol, pos);
/* type */
type_package_error_package(&type);
settype_function(pos, type);
settype_function_symbol(symbol, type);
}
/*
* function
*/
void init_common_packages(void)
{
SetPointerCall(defun, var1opt1, export);
SetPointerCall(defun, var1opt1, find_symbol);
SetPointerCall(defun, var1, find_package);
SetPointerCall(defun, var1, find_all_symbols);
SetPointerCall(defun, var1opt1, import);
SetPointerCall(defun, empty, list_all_packages);
SetPointerCall(defun, var2opt1, rename_package);
SetPointerCall(defun, var1opt1, shadow);
SetPointerCall(defun, var1opt1, shadowing_import);
SetPointerCall(defun, var1, delete_package);
SetPointerCall(defun, var1dynamic, make_package);
SetPointerCall(defmacro, macro, with_package_iterator);
SetPointerCall(defun, var1opt1, unexport);
SetPointerCall(defun, var1opt1, unintern);
SetPointerCall(defmacro, macro, in_package);
SetPointerCall(defun, var1opt1, unuse_package);
SetPointerCall(defun, var1opt1, use_package);
SetPointerCall(defmacro, macro, defpackage);
SetPointerCall(defmacro, macro, do_symbols);
SetPointerCall(defmacro, macro, do_external_symbols);
SetPointerCall(defmacro, macro, do_all_symbols);
SetPointerCall(defun, var1opt1, intern);
SetPointerCall(defun, var1, package_name);
SetPointerCall(defun, var1, package_nicknames);
SetPointerCall(defun, var1, package_shadowing_symbols);
SetPointerCall(defun, var1, package_use_list);
SetPointerCall(defun, var1, package_used_by_list);
SetPointerCall(defun, var1, packagep);
SetPointerCall(defun, var1, package_error_package);
}
void build_common_packages(void)
{
defun_export();
defun_find_symbol();
defun_find_package();
defun_find_all_symbols();
defun_import();
defun_list_all_packages();
defun_rename_package();
defun_shadow();
defun_shadowing_import();
defun_delete_package();
defun_make_package();
defmacro_with_package_iterator();
defun_unexport();
defun_unintern();
defmacro_in_package();
defun_unuse_package();
defun_use_package();
defmacro_defpackage();
defmacro_do_symbols();
defmacro_do_external_symbols();
defmacro_do_all_symbols();
defun_intern();
defun_package_name();
defun_package_nicknames();
defun_package_shadowing_symbols();
defun_package_use_list();
defun_package_used_by_list();
defun_packagep();
defvar_package();
defun_package_error_package();
}
| 24.640167 | 79 | 0.738962 |
efec168cc3d22482bbe7e623c425d3f305b2946a | 333 | h | C | src/tesseract-ocr-app/tesseract-ocr-demo/tesseract-ocr-demo.h | xingyun86/tesseract-ocr-app | ac498c09e249625270d4aa55c21028981c0bbbd1 | [
"MIT"
] | null | null | null | src/tesseract-ocr-app/tesseract-ocr-demo/tesseract-ocr-demo.h | xingyun86/tesseract-ocr-app | ac498c09e249625270d4aa55c21028981c0bbbd1 | [
"MIT"
] | null | null | null | src/tesseract-ocr-app/tesseract-ocr-demo/tesseract-ocr-demo.h | xingyun86/tesseract-ocr-app | ac498c09e249625270d4aa55c21028981c0bbbd1 | [
"MIT"
] | null | null | null | // tesseractocr.h : Include file for standard system include files,
// or project specific include files.
#pragma once
#include <string>
#include <vector>
#include <iostream>
#include <tesseract/baseapi.h>
//#include <allheaders.h>
#include <opencv2/opencv.hpp>
// TODO: Reference additional headers your program requires here.
| 22.2 | 68 | 0.753754 |
c670b1d301c3cb18db7f5a73da4918cfabefdeca | 475 | h | C | weibo/ThemeManager.h | Pikdays/weibo | 6c7af60aa682ee03230565ad692e98f4c61e7e93 | [
"Apache-2.0"
] | 1 | 2016-08-05T09:45:22.000Z | 2016-08-05T09:45:22.000Z | weibo/ThemeManager.h | Pikdays/weibo | 6c7af60aa682ee03230565ad692e98f4c61e7e93 | [
"Apache-2.0"
] | null | null | null | weibo/ThemeManager.h | Pikdays/weibo | 6c7af60aa682ee03230565ad692e98f4c61e7e93 | [
"Apache-2.0"
] | null | null | null | //
// ThemeManager.h
// weibo
//
// Created by laijiawei on 14-3-16.
// Copyright (c) 2014年 laijiawei. All rights reserved.
//
#import <Foundation/Foundation.h>
#define KThemeDidChangeNotification @"kThemeDidChangeNofication"
@interface ThemeManager : NSObject
//当前使用的主题名称
@property(nonatomic,copy)NSString * themeName;
@property(nonatomic,retain)NSDictionary *themesPlist;
+(ThemeManager *)shareInstance;
-(UIImage *)getThemeImage:(NSString * )imageName;
@end
| 17.592593 | 64 | 0.749474 |
4cbff8787c24310e2e8078e63d08bb786ca6a04e | 59,663 | c | C | kernel/lge/msm8226/drivers/platform/msm/ipa/ipa.c | Uswer/LineageOS-14.1_jag3gds | 6fe76987fad4fca7b3c08743b067d5e79892e77f | [
"Apache-2.0"
] | 1 | 2020-06-01T10:53:47.000Z | 2020-06-01T10:53:47.000Z | kernel/lge/msm8226/drivers/platform/msm/ipa/ipa.c | Uswer/LineageOS-14.1_jag3gds | 6fe76987fad4fca7b3c08743b067d5e79892e77f | [
"Apache-2.0"
] | 1 | 2020-05-28T13:06:06.000Z | 2020-05-28T13:13:15.000Z | kernel/lge/msm8226/drivers/platform/msm/ipa/ipa.c | Uswer/LineageOS-14.1_jag3gds | 6fe76987fad4fca7b3c08743b067d5e79892e77f | [
"Apache-2.0"
] | null | null | null | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* 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.
*/
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/dmapool.h>
#include <linux/fs.h>
#include <linux/genalloc.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/rbtree.h>
#include <linux/uaccess.h>
#include <mach/msm_bus.h>
#include <mach/msm_bus_board.h>
#include "ipa_i.h"
#include "ipa_rm_i.h"
#define IPA_SUMMING_THRESHOLD (0x10)
#define IPA_PIPE_MEM_START_OFST (0x0)
#define IPA_PIPE_MEM_SIZE (0x0)
#define IPA_MOBILE_AP_MODE(x) (x == IPA_MODE_MOBILE_AP_ETH || \
x == IPA_MODE_MOBILE_AP_WAN || \
x == IPA_MODE_MOBILE_AP_WLAN)
#define IPA_CNOC_CLK_RATE (75 * 1000 * 1000UL)
#define IPA_V1_CLK_RATE (92.31 * 1000 * 1000UL)
#define IPA_V1_1_CLK_RATE (100 * 1000 * 1000UL)
#define IPA_DEFAULT_HEADER_LENGTH (8)
#define IPA_DMA_POOL_SIZE (512)
#define IPA_DMA_POOL_ALIGNMENT (4)
#define IPA_DMA_POOL_BOUNDARY (1024)
#define IPA_NUM_DESC_PER_SW_TX (2)
#define IPA_ROUTING_RULE_BYTE_SIZE (4)
#define IPA_BAM_CNFG_BITS_VAL (0x7FFFE004)
#define IPA_AGGR_MAX_STR_LENGTH (10)
#define IPA_AGGR_STR_IN_BYTES(str) \
(strnlen((str), IPA_AGGR_MAX_STR_LENGTH - 1) + 1)
static struct ipa_plat_drv_res ipa_res = {0, };
static struct of_device_id ipa_plat_drv_match[] = {
{
.compatible = "qcom,ipa",
},
{
}
};
static struct clk *ipa_clk_src;
static struct clk *ipa_clk;
static struct clk *sys_noc_ipa_axi_clk;
static struct clk *ipa_cnoc_clk;
static struct clk *ipa_inactivity_clk;
static struct msm_bus_vectors ipa_init_vectors[] = {
{
.src = MSM_BUS_MASTER_IPA,
.dst = MSM_BUS_SLAVE_EBI_CH0,
.ab = 0,
.ib = 0,
},
{
.src = MSM_BUS_MASTER_BAM_DMA,
.dst = MSM_BUS_SLAVE_EBI_CH0,
.ab = 0,
.ib = 0,
},
{
.src = MSM_BUS_MASTER_BAM_DMA,
.dst = MSM_BUS_SLAVE_OCIMEM,
.ab = 0,
.ib = 0,
},
};
static struct msm_bus_vectors ipa_max_perf_vectors[] = {
{
.src = MSM_BUS_MASTER_IPA,
.dst = MSM_BUS_SLAVE_EBI_CH0,
.ab = 50000000,
.ib = 960000000,
},
{
.src = MSM_BUS_MASTER_BAM_DMA,
.dst = MSM_BUS_SLAVE_EBI_CH0,
.ab = 50000000,
.ib = 960000000,
},
{
.src = MSM_BUS_MASTER_BAM_DMA,
.dst = MSM_BUS_SLAVE_OCIMEM,
.ab = 50000000,
.ib = 960000000,
},
};
static struct msm_bus_paths ipa_usecases[] = {
{
ARRAY_SIZE(ipa_init_vectors),
ipa_init_vectors,
},
{
ARRAY_SIZE(ipa_max_perf_vectors),
ipa_max_perf_vectors,
},
};
static struct msm_bus_scale_pdata ipa_bus_client_pdata = {
ipa_usecases,
ARRAY_SIZE(ipa_usecases),
.name = "ipa",
};
static uint32_t ipa_bus_hdl;
static struct device *ipa_dev;
struct ipa_context *ipa_ctx;
static bool polling_mode;
module_param(polling_mode, bool, 0644);
MODULE_PARM_DESC(polling_mode,
"1 - pure polling mode; 0 - interrupt+polling mode");
static uint polling_delay_ms = 50;
module_param(polling_delay_ms, uint, 0644);
MODULE_PARM_DESC(polling_delay_ms, "set to desired delay between polls");
static bool hdr_tbl_lcl = 1;
module_param(hdr_tbl_lcl, bool, 0644);
MODULE_PARM_DESC(hdr_tbl_lcl, "where hdr tbl resides 1-local; 0-system");
static bool ip4_rt_tbl_lcl;
module_param(ip4_rt_tbl_lcl, bool, 0644);
MODULE_PARM_DESC(ip4_rt_tbl_lcl,
"where ip4 rt tables reside 1-local; 0-system");
static bool ip6_rt_tbl_lcl;
module_param(ip6_rt_tbl_lcl, bool, 0644);
MODULE_PARM_DESC(ip6_rt_tbl_lcl,
"where ip6 rt tables reside 1-local; 0-system");
static bool ip4_flt_tbl_lcl = 1;
module_param(ip4_flt_tbl_lcl, bool, 0644);
MODULE_PARM_DESC(ip4_flt_tbl_lcl,
"where ip4 flt tables reside 1-local; 0-system");
static bool ip6_flt_tbl_lcl = 1;
module_param(ip6_flt_tbl_lcl, bool, 0644);
MODULE_PARM_DESC(ip6_flt_tbl_lcl,
"where ip6 flt tables reside 1-local; 0-system");
static int ipa_load_pipe_connection(struct platform_device *pdev,
enum a2_mux_pipe_direction pipe_dir,
struct a2_mux_pipe_connection *pdata);
static int ipa_update_connections_info(struct device_node *node,
struct a2_mux_pipe_connection *pipe_connection);
static void ipa_set_aggregation_params(void);
static int ipa_open(struct inode *inode, struct file *filp)
{
struct ipa_context *ctx = NULL;
IPADBG("ENTER\n");
ctx = container_of(inode->i_cdev, struct ipa_context, cdev);
filp->private_data = ctx;
return 0;
}
static long ipa_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
int retval = 0;
u32 pyld_sz;
u8 header[128] = { 0 };
u8 *param = NULL;
struct ipa_ioc_nat_alloc_mem nat_mem;
struct ipa_ioc_v4_nat_init nat_init;
struct ipa_ioc_v4_nat_del nat_del;
struct ipa_ioc_rm_dependency rm_depend;
size_t sz;
int pre_entry;
IPADBG("cmd=%x nr=%d\n", cmd, _IOC_NR(cmd));
if (_IOC_TYPE(cmd) != IPA_IOC_MAGIC)
return -ENOTTY;
if (_IOC_NR(cmd) >= IPA_IOCTL_MAX)
return -ENOTTY;
ipa_inc_client_enable_clks();
switch (cmd) {
case IPA_IOC_ALLOC_NAT_MEM:
if (copy_from_user((u8 *)&nat_mem, (u8 *)arg,
sizeof(struct ipa_ioc_nat_alloc_mem))) {
retval = -EFAULT;
break;
}
/* null terminate the string */
nat_mem.dev_name[IPA_RESOURCE_NAME_MAX - 1] = '\0';
if (allocate_nat_device(&nat_mem)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, (u8 *)&nat_mem,
sizeof(struct ipa_ioc_nat_alloc_mem))) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_V4_INIT_NAT:
if (copy_from_user((u8 *)&nat_init, (u8 *)arg,
sizeof(struct ipa_ioc_v4_nat_init))) {
retval = -EFAULT;
break;
}
if (ipa_nat_init_cmd(&nat_init)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_NAT_DMA:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_nat_dma_cmd))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_nat_dma_cmd *)header)->entries;
pyld_sz =
sizeof(struct ipa_ioc_nat_dma_cmd) +
pre_entry * sizeof(struct ipa_ioc_nat_dma_one);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_nat_dma_cmd *)param)->entries
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_nat_dma_cmd *)param)->entries,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_nat_dma_cmd((struct ipa_ioc_nat_dma_cmd *)param)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_V4_DEL_NAT:
if (copy_from_user((u8 *)&nat_del, (u8 *)arg,
sizeof(struct ipa_ioc_v4_nat_del))) {
retval = -EFAULT;
break;
}
if (ipa_nat_del_cmd(&nat_del)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_ADD_HDR:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_add_hdr))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_add_hdr *)header)->num_hdrs;
pyld_sz =
sizeof(struct ipa_ioc_add_hdr) +
pre_entry * sizeof(struct ipa_hdr_add);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_add_hdr *)param)->num_hdrs
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_add_hdr *)param)->num_hdrs,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_add_hdr((struct ipa_ioc_add_hdr *)param)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_DEL_HDR:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_del_hdr))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_del_hdr *)header)->num_hdls;
pyld_sz =
sizeof(struct ipa_ioc_del_hdr) +
pre_entry * sizeof(struct ipa_hdr_del);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_del_hdr *)param)->num_hdls
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_del_hdr *)param)->num_hdls,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_del_hdr((struct ipa_ioc_del_hdr *)param)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_ADD_RT_RULE:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_add_rt_rule))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_add_rt_rule *)header)->num_rules;
pyld_sz =
sizeof(struct ipa_ioc_add_rt_rule) +
pre_entry * sizeof(struct ipa_rt_rule_add);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_add_rt_rule *)param)->num_rules
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_add_rt_rule *)param)->
num_rules,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_add_rt_rule((struct ipa_ioc_add_rt_rule *)param)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_DEL_RT_RULE:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_del_rt_rule))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_del_rt_rule *)header)->num_hdls;
pyld_sz =
sizeof(struct ipa_ioc_del_rt_rule) +
pre_entry * sizeof(struct ipa_rt_rule_del);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_del_rt_rule *)param)->num_hdls
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_del_rt_rule *)param)->num_hdls,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_del_rt_rule((struct ipa_ioc_del_rt_rule *)param)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_ADD_FLT_RULE:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_add_flt_rule))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_add_flt_rule *)header)->num_rules;
pyld_sz =
sizeof(struct ipa_ioc_add_flt_rule) +
pre_entry * sizeof(struct ipa_flt_rule_add);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_add_flt_rule *)param)->num_rules
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_add_flt_rule *)param)->
num_rules,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_add_flt_rule((struct ipa_ioc_add_flt_rule *)param)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_DEL_FLT_RULE:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_del_flt_rule))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_del_flt_rule *)header)->num_hdls;
pyld_sz =
sizeof(struct ipa_ioc_del_flt_rule) +
pre_entry * sizeof(struct ipa_flt_rule_del);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_del_flt_rule *)param)->num_hdls
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_del_flt_rule *)param)->
num_hdls,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_del_flt_rule((struct ipa_ioc_del_flt_rule *)param)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_COMMIT_HDR:
retval = ipa_commit_hdr();
break;
case IPA_IOC_RESET_HDR:
retval = ipa_reset_hdr();
break;
case IPA_IOC_COMMIT_RT:
retval = ipa_commit_rt(arg);
break;
case IPA_IOC_RESET_RT:
retval = ipa_reset_rt(arg);
break;
case IPA_IOC_COMMIT_FLT:
retval = ipa_commit_flt(arg);
break;
case IPA_IOC_RESET_FLT:
retval = ipa_reset_flt(arg);
break;
case IPA_IOC_DUMP:
ipa_dump();
break;
case IPA_IOC_GET_RT_TBL:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_get_rt_tbl))) {
retval = -EFAULT;
break;
}
if (ipa_get_rt_tbl((struct ipa_ioc_get_rt_tbl *)header)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, header,
sizeof(struct ipa_ioc_get_rt_tbl))) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_PUT_RT_TBL:
retval = ipa_put_rt_tbl(arg);
break;
case IPA_IOC_GET_HDR:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_get_hdr))) {
retval = -EFAULT;
break;
}
if (ipa_get_hdr((struct ipa_ioc_get_hdr *)header)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, header,
sizeof(struct ipa_ioc_get_hdr))) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_PUT_HDR:
retval = ipa_put_hdr(arg);
break;
case IPA_IOC_SET_FLT:
retval = ipa_cfg_filter(arg);
break;
case IPA_IOC_COPY_HDR:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_copy_hdr))) {
retval = -EFAULT;
break;
}
if (ipa_copy_hdr((struct ipa_ioc_copy_hdr *)header)) {
retval = -EFAULT;
break;
}
if (copy_to_user((u8 *)arg, header,
sizeof(struct ipa_ioc_copy_hdr))) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_QUERY_INTF:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_ioc_query_intf))) {
retval = -EFAULT;
break;
}
if (ipa_query_intf((struct ipa_ioc_query_intf *)header)) {
retval = -1;
break;
}
if (copy_to_user((u8 *)arg, header,
sizeof(struct ipa_ioc_query_intf))) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_QUERY_INTF_TX_PROPS:
sz = sizeof(struct ipa_ioc_query_intf_tx_props);
if (copy_from_user(header, (u8 *)arg, sz)) {
retval = -EFAULT;
break;
}
if (((struct ipa_ioc_query_intf_tx_props *)
header)->num_tx_props > IPA_NUM_PROPS_MAX) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_query_intf_tx_props *)
header)->num_tx_props;
pyld_sz = sz + pre_entry *
sizeof(struct ipa_ioc_tx_intf_prop);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_query_intf_tx_props *)
param)->num_tx_props
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_query_intf_tx_props *)
param)->num_tx_props, pre_entry);
retval = -EFAULT;
break;
}
if (ipa_query_intf_tx_props(
(struct ipa_ioc_query_intf_tx_props *)param)) {
retval = -1;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_QUERY_INTF_RX_PROPS:
sz = sizeof(struct ipa_ioc_query_intf_rx_props);
if (copy_from_user(header, (u8 *)arg, sz)) {
retval = -EFAULT;
break;
}
if (((struct ipa_ioc_query_intf_rx_props *)
header)->num_rx_props > IPA_NUM_PROPS_MAX) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_ioc_query_intf_rx_props *)
header)->num_rx_props;
pyld_sz = sz + pre_entry *
sizeof(struct ipa_ioc_rx_intf_prop);
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_ioc_query_intf_rx_props *)
param)->num_rx_props != pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_ioc_query_intf_rx_props *)
param)->num_rx_props, pre_entry);
retval = -EFAULT;
break;
}
if (ipa_query_intf_rx_props(
(struct ipa_ioc_query_intf_rx_props *)param)) {
retval = -1;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_PULL_MSG:
if (copy_from_user(header, (u8 *)arg,
sizeof(struct ipa_msg_meta))) {
retval = -EFAULT;
break;
}
pre_entry =
((struct ipa_msg_meta *)header)->msg_len;
pyld_sz = sizeof(struct ipa_msg_meta) +
pre_entry;
param = kzalloc(pyld_sz, GFP_KERNEL);
if (!param) {
retval = -ENOMEM;
break;
}
if (copy_from_user(param, (u8 *)arg, pyld_sz)) {
retval = -EFAULT;
break;
}
/* add check in case user-space module compromised */
if (unlikely(((struct ipa_msg_meta *)param)->msg_len
!= pre_entry)) {
IPAERR("current %d pre %d\n",
((struct ipa_msg_meta *)param)->msg_len,
pre_entry);
retval = -EFAULT;
break;
}
if (ipa_pull_msg((struct ipa_msg_meta *)param,
(char *)param + sizeof(struct ipa_msg_meta),
((struct ipa_msg_meta *)param)->msg_len) !=
((struct ipa_msg_meta *)param)->msg_len) {
retval = -1;
break;
}
if (copy_to_user((u8 *)arg, param, pyld_sz)) {
retval = -EFAULT;
break;
}
break;
case IPA_IOC_RM_ADD_DEPENDENCY:
if (copy_from_user((u8 *)&rm_depend, (u8 *)arg,
sizeof(struct ipa_ioc_rm_dependency))) {
retval = -EFAULT;
break;
}
retval = ipa_rm_add_dependency(rm_depend.resource_name,
rm_depend.depends_on_name);
break;
case IPA_IOC_RM_DEL_DEPENDENCY:
if (copy_from_user((u8 *)&rm_depend, (u8 *)arg,
sizeof(struct ipa_ioc_rm_dependency))) {
retval = -EFAULT;
break;
}
retval = ipa_rm_delete_dependency(rm_depend.resource_name,
rm_depend.depends_on_name);
break;
default: /* redundant, as cmd was checked against MAXNR */
ipa_dec_client_disable_clks();
return -ENOTTY;
}
kfree(param);
ipa_dec_client_disable_clks();
return retval;
}
/**
* ipa_setup_dflt_rt_tables() - Setup default routing tables
*
* Return codes:
* 0: success
* -ENOMEM: failed to allocate memory
* -EPERM: failed to add the tables
*/
int ipa_setup_dflt_rt_tables(void)
{
struct ipa_ioc_add_rt_rule *rt_rule;
struct ipa_rt_rule_add *rt_rule_entry;
rt_rule =
kzalloc(sizeof(struct ipa_ioc_add_rt_rule) + 1 *
sizeof(struct ipa_rt_rule_add), GFP_KERNEL);
if (!rt_rule) {
IPAERR("fail to alloc mem\n");
return -ENOMEM;
}
/* setup a default v4 route to point to A5 */
rt_rule->num_rules = 1;
rt_rule->commit = 1;
rt_rule->ip = IPA_IP_v4;
strlcpy(rt_rule->rt_tbl_name, IPA_DFLT_RT_TBL_NAME,
IPA_RESOURCE_NAME_MAX);
rt_rule_entry = &rt_rule->rules[0];
rt_rule_entry->at_rear = 1;
rt_rule_entry->rule.dst = IPA_CLIENT_A5_LAN_WAN_CONS;
rt_rule_entry->rule.hdr_hdl = ipa_ctx->excp_hdr_hdl;
if (ipa_add_rt_rule(rt_rule)) {
IPAERR("fail to add dflt v4 rule\n");
kfree(rt_rule);
return -EPERM;
}
IPADBG("dflt v4 rt rule hdl=%x\n", rt_rule_entry->rt_rule_hdl);
ipa_ctx->dflt_v4_rt_rule_hdl = rt_rule_entry->rt_rule_hdl;
/* setup a default v6 route to point to A5 */
rt_rule->ip = IPA_IP_v6;
if (ipa_add_rt_rule(rt_rule)) {
IPAERR("fail to add dflt v6 rule\n");
kfree(rt_rule);
return -EPERM;
}
IPADBG("dflt v6 rt rule hdl=%x\n", rt_rule_entry->rt_rule_hdl);
ipa_ctx->dflt_v6_rt_rule_hdl = rt_rule_entry->rt_rule_hdl;
/*
* because these tables are the very first to be added, they will both
* have the same index (0) which is essential for programming the
* "route" end-point config
*/
kfree(rt_rule);
return 0;
}
static int ipa_setup_exception_path(void)
{
struct ipa_ioc_add_hdr *hdr;
struct ipa_hdr_add *hdr_entry;
struct ipa_route route = { 0 };
int ret;
/* install the basic exception header */
hdr = kzalloc(sizeof(struct ipa_ioc_add_hdr) + 1 *
sizeof(struct ipa_hdr_add), GFP_KERNEL);
if (!hdr) {
IPAERR("fail to alloc exception hdr\n");
return -ENOMEM;
}
hdr->num_hdrs = 1;
hdr->commit = 1;
hdr_entry = &hdr->hdr[0];
strlcpy(hdr_entry->name, IPA_DFLT_HDR_NAME, IPA_RESOURCE_NAME_MAX);
/*
* only single stream for MBIM supported and no exception packets
* expected so set default header to zero
* for IPA HW 1.1 and up the default header length is 8 (exception)
*/
if (ipa_ctx->ipa_hw_type == IPA_HW_v1_0) {
hdr_entry->hdr_len = 1;
hdr_entry->hdr[0] = 0;
} else {
hdr_entry->hdr_len = IPA_DEFAULT_HEADER_LENGTH;
}
/*
* SW does not know anything about default exception header so
* we don't set it. IPA HW will use it as a template
*/
if (ipa_add_hdr(hdr)) {
IPAERR("fail to add exception hdr\n");
ret = -EPERM;
goto bail;
}
if (hdr_entry->status) {
IPAERR("fail to add exception hdr\n");
ret = -EPERM;
goto bail;
}
ipa_ctx->excp_hdr_hdl = hdr_entry->hdr_hdl;
/* exception packets goto LAN-WAN pipe from IPA to A5 */
route.route_def_pipe = IPA_A5_LAN_WAN_IN;
route.route_def_hdr_table = !ipa_ctx->hdr_tbl_lcl;
if (ipa_cfg_route(&route)) {
IPAERR("fail to add exception hdr\n");
ret = -EPERM;
goto bail;
}
ret = 0;
bail:
kfree(hdr);
return ret;
}
static void ipa_poll_function(struct work_struct *work)
{
int ret;
int tx_pipes[] = { IPA_A5_CMD, IPA_A5_LAN_WAN_OUT,
IPA_A5_WLAN_AMPDU_OUT };
int i;
int num_tx_pipes;
int cnt;
num_tx_pipes = sizeof(tx_pipes) / sizeof(tx_pipes[0]);
if (!IPA_MOBILE_AP_MODE(ipa_ctx->mode))
num_tx_pipes--;
do {
cnt = 0;
/* check all the system pipes for tx comp and rx avail */
if (ipa_ctx->sys[IPA_A5_LAN_WAN_IN].ep->valid)
cnt |= ipa_handle_rx_core(
&ipa_ctx->sys[IPA_A5_LAN_WAN_IN],
false, true);
for (i = 0; i < num_tx_pipes; i++)
if (ipa_ctx->sys[tx_pipes[i]].ep->valid)
cnt |= ipa_handle_tx_core(
&ipa_ctx->sys[tx_pipes[i]],
false, true);
} while (cnt);
/* re-post the poll work */
INIT_DELAYED_WORK(&ipa_ctx->poll_work, ipa_poll_function);
ret = schedule_delayed_work_on(smp_processor_id(), &ipa_ctx->poll_work,
msecs_to_jiffies(polling_delay_ms));
return;
}
static int ipa_setup_a5_pipes(void)
{
struct ipa_sys_connect_params sys_in;
int result = 0;
/* CMD OUT (A5->IPA) */
memset(&sys_in, 0, sizeof(struct ipa_sys_connect_params));
sys_in.client = IPA_CLIENT_A5_CMD_PROD;
sys_in.desc_fifo_sz = IPA_SYS_DESC_FIFO_SZ;
sys_in.ipa_ep_cfg.mode.mode = IPA_DMA;
sys_in.ipa_ep_cfg.mode.dst = IPA_CLIENT_A5_LAN_WAN_CONS;
if (ipa_setup_sys_pipe(&sys_in, &ipa_ctx->clnt_hdl_cmd)) {
IPAERR(":setup sys pipe failed.\n");
result = -EPERM;
goto fail_cmd;
}
/* Start polling, only if needed */
if (ipa_ctx->polling_mode) {
INIT_DELAYED_WORK(&ipa_ctx->poll_work, ipa_poll_function);
result =
schedule_delayed_work_on(smp_processor_id(),
&ipa_ctx->poll_work,
msecs_to_jiffies(polling_delay_ms));
if (!result) {
IPAERR(":schedule delayed work failed.\n");
goto fail_schedule_delayed_work;
}
}
if (ipa_setup_exception_path()) {
IPAERR(":fail to setup excp path\n");
result = -EPERM;
goto fail_schedule_delayed_work;
}
if (ipa_ctx->ipa_hw_type != IPA_HW_v1_0) {
if (ipa_setup_dflt_rt_tables()) {
IPAERR(":fail to setup dflt routes\n");
result = -EPERM;
goto fail_schedule_delayed_work;
}
}
/* LAN-WAN IN (IPA->A5) */
memset(&sys_in, 0, sizeof(struct ipa_sys_connect_params));
sys_in.client = IPA_CLIENT_A5_LAN_WAN_CONS;
sys_in.desc_fifo_sz = IPA_SYS_DESC_FIFO_SZ;
sys_in.ipa_ep_cfg.hdr.hdr_a5_mux = 1;
sys_in.ipa_ep_cfg.hdr.hdr_len = 8; /* size of A5 exception hdr */
if (ipa_setup_sys_pipe(&sys_in, &ipa_ctx->clnt_hdl_data_in)) {
IPAERR(":setup sys pipe failed.\n");
result = -EPERM;
goto fail_schedule_delayed_work;
}
/* LAN-WAN OUT (A5->IPA) */
memset(&sys_in, 0, sizeof(struct ipa_sys_connect_params));
sys_in.client = IPA_CLIENT_A5_LAN_WAN_PROD;
sys_in.desc_fifo_sz = IPA_SYS_TX_DATA_DESC_FIFO_SZ;
sys_in.ipa_ep_cfg.mode.mode = IPA_BASIC;
sys_in.ipa_ep_cfg.mode.dst = IPA_CLIENT_A5_LAN_WAN_CONS;
if (ipa_setup_sys_pipe(&sys_in, &ipa_ctx->clnt_hdl_data_out)) {
IPAERR(":setup sys pipe failed.\n");
result = -EPERM;
goto fail_data_out;
}
return 0;
fail_data_out:
ipa_teardown_sys_pipe(ipa_ctx->clnt_hdl_data_in);
fail_schedule_delayed_work:
if (ipa_ctx->dflt_v6_rt_rule_hdl)
__ipa_del_rt_rule(ipa_ctx->dflt_v6_rt_rule_hdl);
if (ipa_ctx->dflt_v4_rt_rule_hdl)
__ipa_del_rt_rule(ipa_ctx->dflt_v4_rt_rule_hdl);
if (ipa_ctx->excp_hdr_hdl)
__ipa_del_hdr(ipa_ctx->excp_hdr_hdl);
ipa_teardown_sys_pipe(ipa_ctx->clnt_hdl_cmd);
fail_cmd:
return result;
}
static void ipa_teardown_a5_pipes(void)
{
cancel_delayed_work(&ipa_ctx->poll_work);
ipa_teardown_sys_pipe(ipa_ctx->clnt_hdl_data_out);
ipa_teardown_sys_pipe(ipa_ctx->clnt_hdl_data_in);
__ipa_del_rt_rule(ipa_ctx->dflt_v6_rt_rule_hdl);
__ipa_del_rt_rule(ipa_ctx->dflt_v4_rt_rule_hdl);
__ipa_del_hdr(ipa_ctx->excp_hdr_hdl);
ipa_teardown_sys_pipe(ipa_ctx->clnt_hdl_cmd);
}
static int ipa_load_pipe_connection(struct platform_device *pdev,
enum a2_mux_pipe_direction pipe_dir,
struct a2_mux_pipe_connection *pdata)
{
struct device_node *node = pdev->dev.of_node;
int rc = 0;
if (!pdata || !pdev)
goto err;
/* retrieve device tree parameters */
for_each_child_of_node(pdev->dev.of_node, node)
{
const char *str;
rc = of_property_read_string(node, "label", &str);
if (rc) {
IPAERR("Cannot read string\n");
goto err;
}
/* Check if connection type is supported */
if (strncmp(str, "a2-to-ipa", 10)
&& strncmp(str, "ipa-to-a2", 10))
goto err;
if (strnstr(str, "a2-to-ipa", strnlen("a2-to-ipa", 10))
&& IPA_TO_A2 == pipe_dir)
continue; /* skip to the next pipe */
else if (strnstr(str, "ipa-to-a2", strnlen("ipa-to-a2", 10))
&& A2_TO_IPA == pipe_dir)
continue; /* skip to the next pipe */
rc = ipa_update_connections_info(node, pdata);
if (rc)
goto err;
}
return 0;
err:
IPAERR("%s: failed\n", __func__);
return rc;
}
static int ipa_update_connections_info(struct device_node *node,
struct a2_mux_pipe_connection *pipe_connection)
{
u32 rc;
char *key;
uint32_t val;
enum ipa_pipe_mem_type mem_type;
if (!pipe_connection || !node)
return -EINVAL;
key = "qcom,src-bam-physical-address";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->src_phy_addr = val;
key = "qcom,ipa-bam-mem-type";
rc = of_property_read_u32(node, key, &mem_type);
if (rc)
goto err;
pipe_connection->mem_type = mem_type;
key = "qcom,src-bam-pipe-index";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->src_pipe_index = val;
key = "qcom,dst-bam-physical-address";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->dst_phy_addr = val;
key = "qcom,dst-bam-pipe-index";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->dst_pipe_index = val;
key = "qcom,data-fifo-offset";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->data_fifo_base_offset = val;
key = "qcom,data-fifo-size";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->data_fifo_size = val;
key = "qcom,descriptor-fifo-offset";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->desc_fifo_base_offset = val;
key = "qcom,descriptor-fifo-size";
rc = of_property_read_u32(node, key, &val);
if (rc)
goto err;
pipe_connection->desc_fifo_size = val;
return 0;
err:
IPAERR("%s: Error in name %s key %s\n", __func__, node->full_name, key);
return rc;
}
/**
* ipa_get_a2_mux_pipe_info() - Exposes A2 parameters fetched from DTS
*
* @pipe_dir: pipe direction
* @pipe_connect: connect structure containing the parameters fetched from DTS
*
* Return codes:
* 0: success
* -EFAULT: invalid parameters
*/
int ipa_get_a2_mux_pipe_info(enum a2_mux_pipe_direction pipe_dir,
struct a2_mux_pipe_connection *pipe_connect)
{
if (!pipe_connect) {
IPAERR("ipa_get_a2_mux_pipe_info switch null args\n");
return -EFAULT;
}
switch (pipe_dir) {
case A2_TO_IPA:
*pipe_connect = ipa_res.a2_to_ipa_pipe;
break;
case IPA_TO_A2:
*pipe_connect = ipa_res.ipa_to_a2_pipe;
break;
default:
IPAERR("ipa_get_a2_mux_pipe_info switch in default\n");
return -EFAULT;
}
return 0;
}
/**
* ipa_get_a2_mux_bam_info() - Exposes A2 parameters fetched from
* DTS
*
* @a2_bam_mem_base: A2 BAM Memory base
* @a2_bam_mem_size: A2 BAM Memory size
* @a2_bam_irq: A2 BAM IRQ
*
* Return codes:
* 0: success
* -EFAULT: invalid parameters
*/
int ipa_get_a2_mux_bam_info(u32 *a2_bam_mem_base, u32 *a2_bam_mem_size,
u32 *a2_bam_irq)
{
if (!a2_bam_mem_base || !a2_bam_mem_size || !a2_bam_irq) {
IPAERR("ipa_get_a2_mux_bam_info null args\n");
return -EFAULT;
}
*a2_bam_mem_base = ipa_res.a2_bam_mem_base;
*a2_bam_mem_size = ipa_res.a2_bam_mem_size;
*a2_bam_irq = ipa_res.a2_bam_irq;
return 0;
}
static void ipa_set_aggregation_params(void)
{
struct ipa_ep_cfg_aggr agg_params;
struct ipa_ep_cfg_hdr hdr_params;
u32 producer_hdl = 0;
u32 consumer_hdl = 0;
teth_bridge_get_client_handles(&producer_hdl, &consumer_hdl);
/* configure aggregation on producer */
memset(&agg_params, 0, sizeof(struct ipa_ep_cfg_aggr));
agg_params.aggr_en = IPA_ENABLE_AGGR;
agg_params.aggr = ipa_ctx->aggregation_type;
agg_params.aggr_byte_limit = ipa_ctx->aggregation_byte_limit;
agg_params.aggr_time_limit = ipa_ctx->aggregation_time_limit;
ipa_cfg_ep_aggr(producer_hdl, &agg_params);
if (ipa_ctx->ipa_hw_type == IPA_HW_v1_0) {
/* configure header on producer */
memset(&hdr_params, 0, sizeof(struct ipa_ep_cfg_hdr));
hdr_params.hdr_len = 1;
ipa_cfg_ep_hdr(producer_hdl, &hdr_params);
}
/* configure deaggregation on consumer */
memset(&agg_params, 0, sizeof(struct ipa_ep_cfg_aggr));
agg_params.aggr_en = IPA_ENABLE_DEAGGR;
agg_params.aggr = ipa_ctx->aggregation_type;
ipa_cfg_ep_aggr(consumer_hdl, &agg_params);
}
/*
* The following device attributes are for configuring the aggregation
* attributes when the driver is already running.
* The attributes are for configuring the aggregation type
* (MBIM_16/MBIM_32/TLP), the aggregation byte limit and the aggregation
* time limit.
*/
static ssize_t ipa_show_aggregation_type(struct device *dev,
struct device_attribute *attr,
char *buf)
{
ssize_t ret_val;
char str[IPA_AGGR_MAX_STR_LENGTH];
if (!buf) {
IPAERR("buffer for ipa_show_aggregation_type is NULL\n");
return -EINVAL;
}
memset(str, 0, sizeof(str));
switch (ipa_ctx->aggregation_type) {
case IPA_MBIM_16:
strlcpy(str, "MBIM_16", IPA_AGGR_STR_IN_BYTES("MBIM_16"));
break;
case IPA_MBIM_32:
strlcpy(str, "MBIM_32", IPA_AGGR_STR_IN_BYTES("MBIM_32"));
break;
case IPA_TLP:
strlcpy(str, "TLP", IPA_AGGR_STR_IN_BYTES("TLP"));
break;
default:
strlcpy(str, "NONE", IPA_AGGR_STR_IN_BYTES("NONE"));
break;
}
ret_val = scnprintf(buf, PAGE_SIZE, "%s\n", str);
return ret_val;
}
static ssize_t ipa_store_aggregation_type(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
char str[IPA_AGGR_MAX_STR_LENGTH], *pstr;
if (!buf) {
IPAERR("buffer for ipa_store_aggregation_type is NULL\n");
return -EINVAL;
}
strlcpy(str, buf, sizeof(str));
pstr = strim(str);
if (!strncmp(pstr, "MBIM_16", IPA_AGGR_STR_IN_BYTES("MBIM_16")))
ipa_ctx->aggregation_type = IPA_MBIM_16;
else if (!strncmp(pstr, "MBIM_32", IPA_AGGR_STR_IN_BYTES("MBIM_32")))
ipa_ctx->aggregation_type = IPA_MBIM_32;
else if (!strncmp(pstr, "TLP", IPA_AGGR_STR_IN_BYTES("TLP")))
ipa_ctx->aggregation_type = IPA_TLP;
else {
IPAERR("ipa_store_aggregation_type wrong input\n");
return -EINVAL;
}
ipa_set_aggregation_params();
return count;
}
static DEVICE_ATTR(aggregation_type, S_IWUSR | S_IRUSR,
ipa_show_aggregation_type,
ipa_store_aggregation_type);
static ssize_t ipa_show_aggregation_byte_limit(struct device *dev,
struct device_attribute *attr,
char *buf)
{
ssize_t ret_val;
if (!buf) {
IPAERR("buffer for ipa_show_aggregation_byte_limit is NULL\n");
return -EINVAL;
}
ret_val = scnprintf(buf, PAGE_SIZE, "%u\n",
ipa_ctx->aggregation_byte_limit);
return ret_val;
}
static ssize_t ipa_store_aggregation_byte_limit(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
char str[IPA_AGGR_MAX_STR_LENGTH];
char *pstr;
u32 ret = 0;
if (!buf) {
IPAERR("buffer for ipa_store_aggregation_byte_limit is NULL\n");
return -EINVAL;
}
strlcpy(str, buf, sizeof(str));
pstr = strim(str);
if (kstrtouint(pstr, IPA_AGGR_MAX_STR_LENGTH, &ret)) {
IPAERR("ipa_store_aggregation_byte_limit wrong input\n");
return -EINVAL;
}
ipa_ctx->aggregation_byte_limit = ret;
ipa_set_aggregation_params();
return count;
}
static DEVICE_ATTR(aggregation_byte_limit, S_IWUSR | S_IRUSR,
ipa_show_aggregation_byte_limit,
ipa_store_aggregation_byte_limit);
static ssize_t ipa_show_aggregation_time_limit(struct device *dev,
struct device_attribute *attr,
char *buf)
{
ssize_t ret_val;
if (!buf) {
IPAERR("buffer for ipa_show_aggregation_time_limit is NULL\n");
return -EINVAL;
}
ret_val = scnprintf(buf,
PAGE_SIZE,
"%u\n",
ipa_ctx->aggregation_time_limit);
return ret_val;
}
static ssize_t ipa_store_aggregation_time_limit(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
char str[IPA_AGGR_MAX_STR_LENGTH], *pstr;
u32 ret = 0;
if (!buf) {
IPAERR("buffer for ipa_store_aggregation_time_limit is NULL\n");
return -EINVAL;
}
strlcpy(str, buf, sizeof(str));
pstr = strim(str);
if (kstrtouint(pstr, IPA_AGGR_MAX_STR_LENGTH, &ret)) {
IPAERR("ipa_store_aggregation_time_limit wrong input\n");
return -EINVAL;
}
ipa_ctx->aggregation_time_limit = ret;
ipa_set_aggregation_params();
return count;
}
static DEVICE_ATTR(aggregation_time_limit, S_IWUSR | S_IRUSR,
ipa_show_aggregation_time_limit,
ipa_store_aggregation_time_limit);
static const struct file_operations ipa_drv_fops = {
.owner = THIS_MODULE,
.open = ipa_open,
.read = ipa_read,
.unlocked_ioctl = ipa_ioctl,
};
static int ipa_get_clks(struct device *dev)
{
ipa_cnoc_clk = clk_get(dev, "iface_clk");
if (IS_ERR(ipa_cnoc_clk)) {
ipa_cnoc_clk = NULL;
IPAERR("fail to get cnoc clk\n");
return -ENODEV;
}
ipa_clk_src = clk_get(dev, "core_src_clk");
if (IS_ERR(ipa_clk_src)) {
ipa_clk_src = NULL;
IPAERR("fail to get ipa clk src\n");
return -ENODEV;
}
ipa_clk = clk_get(dev, "core_clk");
if (IS_ERR(ipa_clk)) {
ipa_clk = NULL;
IPAERR("fail to get ipa clk\n");
return -ENODEV;
}
sys_noc_ipa_axi_clk = clk_get(dev, "bus_clk");
if (IS_ERR(sys_noc_ipa_axi_clk)) {
sys_noc_ipa_axi_clk = NULL;
IPAERR("fail to get sys_noc_ipa_axi clk\n");
return -ENODEV;
}
ipa_inactivity_clk = clk_get(dev, "inactivity_clk");
if (IS_ERR(ipa_inactivity_clk)) {
ipa_inactivity_clk = NULL;
IPAERR("fail to get inactivity clk\n");
return -ENODEV;
}
return 0;
}
/**
* ipa_enable_clks() - Turn on IPA clocks
*
* Return codes:
* None
*/
void ipa_enable_clks(void)
{
if (ipa_cnoc_clk) {
clk_prepare(ipa_cnoc_clk);
clk_enable(ipa_cnoc_clk);
clk_set_rate(ipa_cnoc_clk, IPA_CNOC_CLK_RATE);
} else {
WARN_ON(1);
}
if (ipa_clk_src)
if (ipa_res.ipa_hw_type == IPA_HW_v1_0)
clk_set_rate(ipa_clk_src, IPA_V1_CLK_RATE);
else if (ipa_res.ipa_hw_type == IPA_HW_v1_1)
clk_set_rate(ipa_clk_src, IPA_V1_1_CLK_RATE);
else
WARN_ON(1);
else
WARN_ON(1);
if (ipa_clk)
clk_prepare(ipa_clk);
else
WARN_ON(1);
if (sys_noc_ipa_axi_clk)
clk_prepare(sys_noc_ipa_axi_clk);
else
WARN_ON(1);
if (ipa_inactivity_clk)
clk_prepare(ipa_inactivity_clk);
else
WARN_ON(1);
if (ipa_clk)
clk_enable(ipa_clk);
else
WARN_ON(1);
if (sys_noc_ipa_axi_clk)
clk_enable(sys_noc_ipa_axi_clk);
else
WARN_ON(1);
if (ipa_inactivity_clk)
clk_enable(ipa_inactivity_clk);
else
WARN_ON(1);
if (msm_bus_scale_client_update_request(ipa_bus_hdl, 1))
WARN_ON(1);
}
/**
* ipa_disable_clks() - Turn off IPA clocks
*
* Return codes:
* None
*/
void ipa_disable_clks(void)
{
if (ipa_inactivity_clk)
clk_disable_unprepare(ipa_inactivity_clk);
else
WARN_ON(1);
if (sys_noc_ipa_axi_clk)
clk_disable_unprepare(sys_noc_ipa_axi_clk);
else
WARN_ON(1);
if (ipa_clk)
clk_disable_unprepare(ipa_clk);
else
WARN_ON(1);
if (ipa_cnoc_clk)
clk_disable_unprepare(ipa_cnoc_clk);
else
WARN_ON(1);
if (msm_bus_scale_client_update_request(ipa_bus_hdl, 0))
WARN_ON(1);
}
/**
* ipa_inc_client_enable_clks() - Increase active clients counter, and
* enable ipa clocks if necessary
*
* Return codes:
* None
*/
void ipa_inc_client_enable_clks(void)
{
mutex_lock(&ipa_ctx->ipa_active_clients_lock);
ipa_ctx->ipa_active_clients++;
if (ipa_ctx->ipa_active_clients == 1)
if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_NORMAL)
ipa_enable_clks();
mutex_unlock(&ipa_ctx->ipa_active_clients_lock);
}
/**
* ipa_dec_client_disable_clks() - Decrease active clients counter, and
* disable ipa clocks if necessary
*
* Return codes:
* None
*/
void ipa_dec_client_disable_clks(void)
{
mutex_lock(&ipa_ctx->ipa_active_clients_lock);
ipa_ctx->ipa_active_clients--;
if (ipa_ctx->ipa_active_clients == 0)
if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_NORMAL)
ipa_disable_clks();
mutex_unlock(&ipa_ctx->ipa_active_clients_lock);
}
static int ipa_setup_bam_cfg(const struct ipa_plat_drv_res *res)
{
void *bam_cnfg_bits;
if ((ipa_ctx->ipa_hw_type == IPA_HW_v1_0) ||
(ipa_ctx->ipa_hw_type == IPA_HW_v1_1)) {
bam_cnfg_bits = ioremap(res->ipa_mem_base +
IPA_BAM_REG_BASE_OFST,
IPA_BAM_REMAP_SIZE);
if (!bam_cnfg_bits)
return -ENOMEM;
ipa_write_reg(bam_cnfg_bits, IPA_BAM_CNFG_BITS_OFST,
IPA_BAM_CNFG_BITS_VAL);
iounmap(bam_cnfg_bits);
}
return 0;
}
static int ipa_init_flt_block(void)
{
int result = 0;
/*
* SW workaround for Improper Filter Behaviour when neiher Global nor
* Pipe Rules are present => configure dummy global filter rule
* always which results in a miss
*/
struct ipa_ioc_add_flt_rule *rules;
struct ipa_flt_rule_add *rule;
struct ipa_ioc_get_rt_tbl rt_lookup;
enum ipa_ip_type ip;
if (ipa_ctx->ipa_hw_type == IPA_HW_v1_1) {
size_t sz = sizeof(struct ipa_ioc_add_flt_rule) +
sizeof(struct ipa_flt_rule_add);
rules = kmalloc(sz, GFP_KERNEL);
if (rules == NULL) {
IPAERR("fail to alloc mem for dummy filter rule\n");
return -ENOMEM;
}
for (ip = IPA_IP_v4; ip < IPA_IP_MAX; ip++) {
memset(&rt_lookup, 0,
sizeof(struct ipa_ioc_get_rt_tbl));
rt_lookup.ip = ip;
strlcpy(rt_lookup.name, IPA_DFLT_RT_TBL_NAME,
IPA_RESOURCE_NAME_MAX);
ipa_get_rt_tbl(&rt_lookup);
ipa_put_rt_tbl(rt_lookup.hdl);
memset(rules, 0, sz);
rule = &rules->rules[0];
rules->commit = 1;
rules->ip = ip;
rules->global = 1;
rules->num_rules = 1;
rule->at_rear = 1;
if (ip == IPA_IP_v4) {
rule->rule.attrib.attrib_mask =
IPA_FLT_PROTOCOL;
rule->rule.attrib.u.v4.protocol =
IPA_INVALID_L4_PROTOCOL;
} else if (ip == IPA_IP_v6) {
rule->rule.attrib.attrib_mask =
IPA_FLT_NEXT_HDR;
rule->rule.attrib.u.v6.next_hdr =
IPA_INVALID_L4_PROTOCOL;
} else {
result = -EINVAL;
WARN_ON(1);
break;
}
rule->rule.action = IPA_PASS_TO_ROUTING;
rule->rule.rt_tbl_hdl = rt_lookup.hdl;
if (ipa_add_flt_rule(rules) || rules->rules[0].status) {
result = -EINVAL;
WARN_ON(1);
break;
}
}
kfree(rules);
}
return result;
}
/**
* ipa_init() - Initialize the IPA Driver
*@resource_p: contain platform specific values from DST file
*
* Function initialization process:
* - Allocate memory for the driver context data struct
* - Initializing the ipa_ctx with:
* 1)parsed values from the dts file
* 2)parameters passed to the module initialization
* 3)read HW values(such as core memory size)
* - Map IPA core registers to CPU memory
* - Restart IPA core(HW reset)
* - Register IPA BAM to SPS driver and get a BAM handler
* - Set configuration for IPA BAM via BAM_CNFG_BITS
* - Initialize the look-aside caches(kmem_cache/slab) for filter,
* routing and IPA-tree
* - Create memory pool with 4 objects for DMA operations(each object
* is 512Bytes long), this object will be use for tx(A5->IPA)
* - Initialize lists head(routing,filter,hdr,system pipes)
* - Initialize mutexes (for ipa_ctx and NAT memory mutexes)
* - Initialize spinlocks (for list related to A5<->IPA pipes)
* - Initialize 2 single-threaded work-queue named "ipa rx wq" and "ipa tx wq"
* - Initialize Red-Black-Tree(s) for handles of header,routing rule,
* routing table ,filtering rule
* - Setup all A5<->IPA pipes by calling to ipa_setup_a5_pipes
* - Preparing the descriptors for System pipes
* - Initialize the filter block by committing IPV4 and IPV6 default rules
* - Create empty routing table in system memory(no committing)
* - Initialize pipes memory pool with ipa_pipe_mem_init for supported platforms
* - Create a char-device for IPA
* - Initialize IPA RM (resource manager)
*/
static int ipa_init(const struct ipa_plat_drv_res *resource_p)
{
int result = 0;
int i;
struct sps_bam_props bam_props = { 0 };
struct ipa_flt_tbl *flt_tbl;
struct ipa_rt_tbl_set *rset;
IPADBG("IPA init\n");
ipa_ctx = kzalloc(sizeof(*ipa_ctx), GFP_KERNEL);
if (!ipa_ctx) {
IPAERR(":kzalloc err.\n");
result = -ENOMEM;
goto fail_mem;
}
IPADBG("polling_mode=%u delay_ms=%u\n", polling_mode, polling_delay_ms);
ipa_ctx->polling_mode = polling_mode;
IPADBG("hdr_lcl=%u ip4_rt=%u ip6_rt=%u ip4_flt=%u ip6_flt=%u\n",
hdr_tbl_lcl, ip4_rt_tbl_lcl, ip6_rt_tbl_lcl, ip4_flt_tbl_lcl,
ip6_flt_tbl_lcl);
ipa_ctx->hdr_tbl_lcl = hdr_tbl_lcl;
ipa_ctx->ip4_rt_tbl_lcl = ip4_rt_tbl_lcl;
ipa_ctx->ip6_rt_tbl_lcl = ip6_rt_tbl_lcl;
ipa_ctx->ip4_flt_tbl_lcl = ip4_flt_tbl_lcl;
ipa_ctx->ip6_flt_tbl_lcl = ip6_flt_tbl_lcl;
ipa_ctx->ipa_wrapper_base = resource_p->ipa_mem_base;
ipa_ctx->ipa_hw_type = resource_p->ipa_hw_type;
ipa_ctx->ipa_hw_mode = resource_p->ipa_hw_mode;
/* setup IPA register access */
ipa_ctx->mmio = ioremap(resource_p->ipa_mem_base + IPA_REG_BASE_OFST,
resource_p->ipa_mem_size);
if (!ipa_ctx->mmio) {
IPAERR(":ipa-base ioremap err.\n");
result = -EFAULT;
goto fail_remap;
}
/* do POR programming to setup HW */
result = ipa_init_hw();
if (result) {
IPAERR(":error initializing driver.\n");
result = -ENODEV;
goto fail_init_hw;
}
if (ipa_ctx->ipa_hw_type == IPA_HW_v1_0) {
/* setup chicken bits */
result = ipa_set_single_ndp_per_mbim(true);
if (result) {
IPAERR(":failed to set single ndp per mbim.\n");
result = -EFAULT;
goto fail_init_hw;
}
result = ipa_set_hw_timer_fix_for_mbim_aggr(true);
if (result) {
IPAERR(":failed to set HW timer fix for MBIM agg.\n");
result = -EFAULT;
goto fail_init_hw;
}
}
/* read how much SRAM is available for SW use */
if (ipa_ctx->ipa_hw_type == IPA_HW_v1_0)
ipa_ctx->smem_sz = ipa_read_reg(ipa_ctx->mmio,
IPA_SHARED_MEM_SIZE_OFST_v1);
else
ipa_ctx->smem_sz = ipa_read_reg(ipa_ctx->mmio,
IPA_SHARED_MEM_SIZE_OFST_v2);
if (IPA_RAM_END_OFST > ipa_ctx->smem_sz) {
IPAERR("SW expect more core memory, needed %d, avail %d\n",
IPA_RAM_END_OFST, ipa_ctx->smem_sz);
result = -ENOMEM;
goto fail_init_hw;
}
/* register IPA with SPS driver */
bam_props.phys_addr = resource_p->bam_mem_base;
bam_props.virt_size = resource_p->bam_mem_size;
bam_props.irq = resource_p->bam_irq;
bam_props.num_pipes = IPA_NUM_PIPES;
bam_props.summing_threshold = IPA_SUMMING_THRESHOLD;
bam_props.event_threshold = IPA_EVENT_THRESHOLD;
bam_props.options |= SPS_BAM_NO_LOCAL_CLK_GATING;
result = sps_register_bam_device(&bam_props, &ipa_ctx->bam_handle);
if (result) {
IPAERR(":bam register err.\n");
result = -ENODEV;
goto fail_init_hw;
}
if (ipa_setup_bam_cfg(resource_p)) {
IPAERR(":bam cfg err.\n");
result = -ENODEV;
goto fail_flt_rule_cache;
}
/* set up the default op mode */
ipa_ctx->mode = IPA_MODE_MOBILE_AP_WAN;
/* init the lookaside cache */
ipa_ctx->flt_rule_cache = kmem_cache_create("IPA FLT",
sizeof(struct ipa_flt_entry), 0, 0, NULL);
if (!ipa_ctx->flt_rule_cache) {
IPAERR(":ipa flt cache create failed\n");
result = -ENOMEM;
goto fail_flt_rule_cache;
}
ipa_ctx->rt_rule_cache = kmem_cache_create("IPA RT",
sizeof(struct ipa_rt_entry), 0, 0, NULL);
if (!ipa_ctx->rt_rule_cache) {
IPAERR(":ipa rt cache create failed\n");
result = -ENOMEM;
goto fail_rt_rule_cache;
}
ipa_ctx->hdr_cache = kmem_cache_create("IPA HDR",
sizeof(struct ipa_hdr_entry), 0, 0, NULL);
if (!ipa_ctx->hdr_cache) {
IPAERR(":ipa hdr cache create failed\n");
result = -ENOMEM;
goto fail_hdr_cache;
}
ipa_ctx->hdr_offset_cache =
kmem_cache_create("IPA HDR OFF", sizeof(struct ipa_hdr_offset_entry),
0, 0, NULL);
if (!ipa_ctx->hdr_offset_cache) {
IPAERR(":ipa hdr off cache create failed\n");
result = -ENOMEM;
goto fail_hdr_offset_cache;
}
ipa_ctx->rt_tbl_cache = kmem_cache_create("IPA RT TBL",
sizeof(struct ipa_rt_tbl), 0, 0, NULL);
if (!ipa_ctx->rt_tbl_cache) {
IPAERR(":ipa rt tbl cache create failed\n");
result = -ENOMEM;
goto fail_rt_tbl_cache;
}
ipa_ctx->tx_pkt_wrapper_cache =
kmem_cache_create("IPA TX PKT WRAPPER",
sizeof(struct ipa_tx_pkt_wrapper), 0, 0, NULL);
if (!ipa_ctx->tx_pkt_wrapper_cache) {
IPAERR(":ipa tx pkt wrapper cache create failed\n");
result = -ENOMEM;
goto fail_tx_pkt_wrapper_cache;
}
ipa_ctx->rx_pkt_wrapper_cache =
kmem_cache_create("IPA RX PKT WRAPPER",
sizeof(struct ipa_rx_pkt_wrapper), 0, 0, NULL);
if (!ipa_ctx->rx_pkt_wrapper_cache) {
IPAERR(":ipa rx pkt wrapper cache create failed\n");
result = -ENOMEM;
goto fail_rx_pkt_wrapper_cache;
}
ipa_ctx->tree_node_cache =
kmem_cache_create("IPA TREE", sizeof(struct ipa_tree_node), 0, 0,
NULL);
if (!ipa_ctx->tree_node_cache) {
IPAERR(":ipa tree node cache create failed\n");
result = -ENOMEM;
goto fail_tree_node_cache;
}
/*
* setup DMA pool 4 byte aligned, don't cross 1k boundaries, nominal
* size 512 bytes
* This is an issue with IPA HW v1.0 only.
*/
if (ipa_ctx->ipa_hw_type == IPA_HW_v1_0) {
ipa_ctx->dma_pool = dma_pool_create("ipa_1k",
NULL,
IPA_DMA_POOL_SIZE, IPA_DMA_POOL_ALIGNMENT,
IPA_DMA_POOL_BOUNDARY);
} else {
ipa_ctx->dma_pool = dma_pool_create("ipa_tx", NULL,
IPA_NUM_DESC_PER_SW_TX * sizeof(struct sps_iovec),
0, 0);
}
if (!ipa_ctx->dma_pool) {
IPAERR("cannot alloc DMA pool.\n");
result = -ENOMEM;
goto fail_dma_pool;
}
ipa_ctx->glob_flt_tbl[IPA_IP_v4].in_sys = !ipa_ctx->ip4_flt_tbl_lcl;
ipa_ctx->glob_flt_tbl[IPA_IP_v6].in_sys = !ipa_ctx->ip6_flt_tbl_lcl;
/* init the various list heads */
INIT_LIST_HEAD(&ipa_ctx->glob_flt_tbl[IPA_IP_v4].head_flt_rule_list);
INIT_LIST_HEAD(&ipa_ctx->glob_flt_tbl[IPA_IP_v6].head_flt_rule_list);
INIT_LIST_HEAD(&ipa_ctx->hdr_tbl.head_hdr_entry_list);
for (i = 0; i < IPA_HDR_BIN_MAX; i++) {
INIT_LIST_HEAD(&ipa_ctx->hdr_tbl.head_offset_list[i]);
INIT_LIST_HEAD(&ipa_ctx->hdr_tbl.head_free_offset_list[i]);
}
INIT_LIST_HEAD(&ipa_ctx->rt_tbl_set[IPA_IP_v4].head_rt_tbl_list);
INIT_LIST_HEAD(&ipa_ctx->rt_tbl_set[IPA_IP_v6].head_rt_tbl_list);
for (i = 0; i < IPA_NUM_PIPES; i++) {
flt_tbl = &ipa_ctx->flt_tbl[i][IPA_IP_v4];
INIT_LIST_HEAD(&flt_tbl->head_flt_rule_list);
flt_tbl->in_sys = !ipa_ctx->ip4_flt_tbl_lcl;
flt_tbl = &ipa_ctx->flt_tbl[i][IPA_IP_v6];
INIT_LIST_HEAD(&flt_tbl->head_flt_rule_list);
flt_tbl->in_sys = !ipa_ctx->ip6_flt_tbl_lcl;
}
rset = &ipa_ctx->reap_rt_tbl_set[IPA_IP_v4];
INIT_LIST_HEAD(&rset->head_rt_tbl_list);
rset = &ipa_ctx->reap_rt_tbl_set[IPA_IP_v6];
INIT_LIST_HEAD(&rset->head_rt_tbl_list);
INIT_LIST_HEAD(&ipa_ctx->intf_list);
INIT_LIST_HEAD(&ipa_ctx->msg_list);
INIT_LIST_HEAD(&ipa_ctx->pull_msg_list);
init_waitqueue_head(&ipa_ctx->msg_waitq);
mutex_init(&ipa_ctx->msg_lock);
mutex_init(&ipa_ctx->lock);
mutex_init(&ipa_ctx->nat_mem.lock);
for (i = 0; i < IPA_A5_SYS_MAX; i++) {
INIT_LIST_HEAD(&ipa_ctx->sys[i].head_desc_list);
spin_lock_init(&ipa_ctx->sys[i].spinlock);
if (i != IPA_A5_WLAN_AMPDU_OUT)
ipa_ctx->sys[i].ep = &ipa_ctx->ep[i];
else
ipa_ctx->sys[i].ep = &ipa_ctx->ep[WLAN_AMPDU_TX_EP];
if (ipa_ctx->polling_mode)
atomic_set(&ipa_ctx->sys[i].curr_polling_state, 1);
else
atomic_set(&ipa_ctx->sys[i].curr_polling_state, 0);
}
ipa_ctx->rx_wq = create_singlethread_workqueue("ipa rx wq");
if (!ipa_ctx->rx_wq) {
IPAERR(":fail to create rx wq\n");
result = -ENOMEM;
goto fail_rx_wq;
}
ipa_ctx->tx_wq = alloc_workqueue("ipa tx wq", WQ_MEM_RECLAIM |
WQ_CPU_INTENSIVE, 1);
if (!ipa_ctx->tx_wq) {
IPAERR(":fail to create tx wq\n");
result = -ENOMEM;
goto fail_tx_wq;
}
ipa_ctx->hdr_hdl_tree = RB_ROOT;
ipa_ctx->rt_rule_hdl_tree = RB_ROOT;
ipa_ctx->rt_tbl_hdl_tree = RB_ROOT;
ipa_ctx->flt_rule_hdl_tree = RB_ROOT;
mutex_init(&ipa_ctx->ipa_active_clients_lock);
ipa_ctx->ipa_active_clients = 0;
result = ipa_bridge_init();
if (result) {
IPAERR("ipa bridge init err.\n");
result = -ENODEV;
goto fail_a5_pipes;
}
/* setup the A5-IPA pipes */
if (ipa_setup_a5_pipes()) {
IPAERR(":failed to setup IPA-A5 pipes.\n");
result = -ENODEV;
goto fail_a5_pipes;
}
ipa_replenish_rx_cache();
if (ipa_init_flt_block()) {
IPAERR("fail to setup dummy filter rules\n");
result = -ENODEV;
goto fail_empty_rt_tbl;
}
/*
* setup an empty routing table in system memory, this will be used
* to delete a routing table cleanly and safely
*/
ipa_ctx->empty_rt_tbl_mem.size = IPA_ROUTING_RULE_BYTE_SIZE;
ipa_ctx->empty_rt_tbl_mem.base =
dma_alloc_coherent(NULL, ipa_ctx->empty_rt_tbl_mem.size,
&ipa_ctx->empty_rt_tbl_mem.phys_base,
GFP_KERNEL);
if (!ipa_ctx->empty_rt_tbl_mem.base) {
IPAERR("DMA buff alloc fail %d bytes for empty routing tbl\n",
ipa_ctx->empty_rt_tbl_mem.size);
result = -ENOMEM;
goto fail_empty_rt_tbl;
}
memset(ipa_ctx->empty_rt_tbl_mem.base, 0,
ipa_ctx->empty_rt_tbl_mem.size);
/* setup the IPA pipe mem pool */
ipa_pipe_mem_init(resource_p->ipa_pipe_mem_start_ofst,
resource_p->ipa_pipe_mem_size);
ipa_ctx->class = class_create(THIS_MODULE, DRV_NAME);
result = alloc_chrdev_region(&ipa_ctx->dev_num, 0, 1, DRV_NAME);
if (result) {
IPAERR("alloc_chrdev_region err.\n");
result = -ENODEV;
goto fail_alloc_chrdev_region;
}
ipa_ctx->dev = device_create(ipa_ctx->class, NULL, ipa_ctx->dev_num,
ipa_ctx, DRV_NAME);
if (IS_ERR(ipa_ctx->dev)) {
IPAERR(":device_create err.\n");
result = -ENODEV;
goto fail_device_create;
}
cdev_init(&ipa_ctx->cdev, &ipa_drv_fops);
ipa_ctx->cdev.owner = THIS_MODULE;
ipa_ctx->cdev.ops = &ipa_drv_fops; /* from LDD3 */
result = cdev_add(&ipa_ctx->cdev, ipa_ctx->dev_num, 1);
if (result) {
IPAERR(":cdev_add err=%d\n", -result);
result = -ENODEV;
goto fail_cdev_add;
}
/* default aggregation parameters */
ipa_ctx->aggregation_type = IPA_MBIM_16;
ipa_ctx->aggregation_byte_limit = 1;
ipa_ctx->aggregation_time_limit = 0;
if (ipa_ctx->ipa_hw_mode != IPA_HW_MODE_PCIE) {
/* Initialize IPA RM (resource manager) */
result = ipa_rm_initialize();
if (result) {
IPAERR(":cdev_add err=%d\n", -result);
result = -ENODEV;
goto fail_ipa_rm_init;
}
}
if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_NORMAL) {
a2_mux_init();
/* Initialize the tethering bridge driver */
result = teth_bridge_driver_init();
if (result) {
IPAERR(":teth_bridge_driver_init() failed\n");
result = -ENODEV;
goto fail_cdev_add;
}
}
/* gate IPA clocks */
if (ipa_ctx->ipa_hw_mode == IPA_HW_MODE_NORMAL)
ipa_disable_clks();
IPADBG(":IPA driver init OK.\n");
return 0;
fail_ipa_rm_init:
cdev_del(&ipa_ctx->cdev);
fail_cdev_add:
device_destroy(ipa_ctx->class, ipa_ctx->dev_num);
fail_device_create:
unregister_chrdev_region(ipa_ctx->dev_num, 1);
fail_alloc_chrdev_region:
if (ipa_ctx->pipe_mem_pool)
gen_pool_destroy(ipa_ctx->pipe_mem_pool);
dma_free_coherent(NULL,
ipa_ctx->empty_rt_tbl_mem.size,
ipa_ctx->empty_rt_tbl_mem.base,
ipa_ctx->empty_rt_tbl_mem.phys_base);
fail_empty_rt_tbl:
ipa_cleanup_rx();
ipa_teardown_a5_pipes();
fail_a5_pipes:
destroy_workqueue(ipa_ctx->tx_wq);
fail_tx_wq:
destroy_workqueue(ipa_ctx->rx_wq);
fail_rx_wq:
/*
* DMA pool need to be released only for IPA HW v1.0 only.
*/
if (ipa_ctx->ipa_hw_type == IPA_HW_v1_0)
dma_pool_destroy(ipa_ctx->dma_pool);
fail_dma_pool:
kmem_cache_destroy(ipa_ctx->tree_node_cache);
fail_tree_node_cache:
kmem_cache_destroy(ipa_ctx->rx_pkt_wrapper_cache);
fail_rx_pkt_wrapper_cache:
kmem_cache_destroy(ipa_ctx->tx_pkt_wrapper_cache);
fail_tx_pkt_wrapper_cache:
kmem_cache_destroy(ipa_ctx->rt_tbl_cache);
fail_rt_tbl_cache:
kmem_cache_destroy(ipa_ctx->hdr_offset_cache);
fail_hdr_offset_cache:
kmem_cache_destroy(ipa_ctx->hdr_cache);
fail_hdr_cache:
kmem_cache_destroy(ipa_ctx->rt_rule_cache);
fail_rt_rule_cache:
kmem_cache_destroy(ipa_ctx->flt_rule_cache);
fail_flt_rule_cache:
sps_deregister_bam_device(ipa_ctx->bam_handle);
fail_init_hw:
iounmap(ipa_ctx->mmio);
fail_remap:
kfree(ipa_ctx);
ipa_ctx = NULL;
fail_mem:
return result;
}
static int ipa_plat_drv_probe(struct platform_device *pdev_p)
{
int result = 0;
struct resource *resource_p;
IPADBG("IPA plat drv probe\n");
/* initialize ipa_res */
ipa_res.ipa_pipe_mem_start_ofst = IPA_PIPE_MEM_START_OFST;
ipa_res.ipa_pipe_mem_size = IPA_PIPE_MEM_SIZE;
ipa_res.ipa_hw_type = 0;
ipa_res.ipa_hw_mode = 0;
result = ipa_load_pipe_connection(pdev_p,
A2_TO_IPA,
&ipa_res.a2_to_ipa_pipe);
if (0 != result)
IPAERR(":ipa_load_pipe_connection failed!\n");
result = ipa_load_pipe_connection(pdev_p, IPA_TO_A2,
&ipa_res.ipa_to_a2_pipe);
if (0 != result)
IPAERR(":ipa_load_pipe_connection failed!\n");
/* Get IPA wrapper address */
resource_p = platform_get_resource_byname(pdev_p, IORESOURCE_MEM,
"ipa-base");
if (!resource_p) {
IPAERR(":get resource failed for ipa-base!\n");
return -ENODEV;
} else {
ipa_res.ipa_mem_base = resource_p->start;
ipa_res.ipa_mem_size = resource_size(resource_p);
}
/* Get IPA BAM address */
resource_p = platform_get_resource_byname(pdev_p, IORESOURCE_MEM,
"bam-base");
if (!resource_p) {
IPAERR(":get resource failed for bam-base!\n");
return -ENODEV;
} else {
ipa_res.bam_mem_base = resource_p->start;
ipa_res.bam_mem_size = resource_size(resource_p);
}
/* Get IPA A2 BAM address */
resource_p = platform_get_resource_byname(pdev_p, IORESOURCE_MEM,
"a2-bam-base");
if (!resource_p) {
IPAERR(":get resource failed for a2-bam-base!\n");
return -ENODEV;
} else {
ipa_res.a2_bam_mem_base = resource_p->start;
ipa_res.a2_bam_mem_size = resource_size(resource_p);
}
/* Get IPA pipe mem start ofst */
resource_p = platform_get_resource_byname(pdev_p, IORESOURCE_MEM,
"ipa-pipe-mem");
if (!resource_p) {
IPADBG(":get resource failed for ipa-pipe-mem\n");
} else {
ipa_res.ipa_pipe_mem_start_ofst = resource_p->start;
ipa_res.ipa_pipe_mem_size = resource_size(resource_p);
}
/* Get IPA IRQ number */
resource_p = platform_get_resource_byname(pdev_p, IORESOURCE_IRQ,
"ipa-irq");
if (!resource_p) {
IPAERR(":get resource failed for ipa-irq!\n");
return -ENODEV;
} else {
ipa_res.ipa_irq = resource_p->start;
}
/* Get IPA BAM IRQ number */
resource_p = platform_get_resource_byname(pdev_p, IORESOURCE_IRQ,
"bam-irq");
if (!resource_p) {
IPAERR(":get resource failed for bam-irq!\n");
return -ENODEV;
} else {
ipa_res.bam_irq = resource_p->start;
}
/* Get IPA A2 BAM IRQ number */
resource_p = platform_get_resource_byname(pdev_p, IORESOURCE_IRQ,
"a2-bam-irq");
if (!resource_p) {
IPAERR(":get resource failed for a2-bam-irq!\n");
return -ENODEV;
} else {
ipa_res.a2_bam_irq = resource_p->start;
}
/* Get IPA HW Version */
result = of_property_read_u32(pdev_p->dev.of_node, "qcom,ipa-hw-ver",
&ipa_res.ipa_hw_type);
if ((result) || (ipa_res.ipa_hw_type == 0)) {
IPAERR(":get resource failed for ipa-hw-ver!\n");
return -ENODEV;
}
IPADBG(": found ipa_res.ipa_hw_type = %d", ipa_res.ipa_hw_type);
/* Get IPA HW mode */
result = of_property_read_u32(pdev_p->dev.of_node, "ipa-hw-mode",
&ipa_res.ipa_hw_mode);
if (result)
IPADBG("using default (IPA_MODE_NORMAL) for ipa-hw-mode\n");
else
IPADBG(": found ipa_res.ipa_hw_mode = %d", ipa_res.ipa_hw_mode);
IPADBG(":ipa_mem_base = 0x%x, ipa_mem_size = 0x%x\n",
ipa_res.ipa_mem_base, ipa_res.ipa_mem_size);
IPADBG(":bam_mem_base = 0x%x, bam_mem_size = 0x%x\n",
ipa_res.bam_mem_base, ipa_res.bam_mem_size);
IPADBG(":pipe_mem_start_ofst = 0x%x, pipe_mem_size = 0x%x\n",
ipa_res.ipa_pipe_mem_start_ofst, ipa_res.ipa_pipe_mem_size);
IPADBG(":ipa_irq = %d\n", ipa_res.ipa_irq);
IPADBG(":bam_irq = %d\n", ipa_res.bam_irq);
/* stash the IPA dev ptr */
ipa_dev = &pdev_p->dev;
if (ipa_res.ipa_hw_mode == IPA_HW_MODE_NORMAL) {
/* get IPA clocks */
if (ipa_get_clks(ipa_dev) != 0) {
IPAERR(":fail to get clk handle's!\n");
return -ENODEV;
}
/* get BUS handle */
ipa_bus_hdl =
msm_bus_scale_register_client(&ipa_bus_client_pdata);
if (!ipa_bus_hdl) {
IPAERR(":fail to register with bus mgr!\n");
return -ENODEV;
}
/* enable IPA clocks */
ipa_enable_clks();
}
/* Proceed to real initialization */
result = ipa_init(&ipa_res);
if (result) {
IPAERR("ipa_init failed\n");
/* gate IPA clocks */
if (ipa_res.ipa_hw_mode == IPA_HW_MODE_NORMAL)
ipa_disable_clks();
}
result = device_create_file(&pdev_p->dev,
&dev_attr_aggregation_type);
if (result)
IPAERR("failed to create device file\n");
result = device_create_file(&pdev_p->dev,
&dev_attr_aggregation_byte_limit);
if (result)
IPAERR("failed to create device file\n");
result = device_create_file(&pdev_p->dev,
&dev_attr_aggregation_time_limit);
if (result)
IPAERR("failed to create device file\n");
return result;
}
static struct platform_driver ipa_plat_drv = {
.probe = ipa_plat_drv_probe,
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
.of_match_table = ipa_plat_drv_match,
},
};
struct ipa_context *ipa_get_ctx(void)
{
return ipa_ctx;
}
static int __init ipa_module_init(void)
{
int result = 0;
IPADBG("IPA module init\n");
/* Register as a platform device driver */
platform_driver_register(&ipa_plat_drv);
ipa_debugfs_init();
return result;
}
subsys_initcall(ipa_module_init);
MODULE_LICENSE("GPL v2");
MODULE_DESCRIPTION("IPA HW device driver");
| 25.464362 | 79 | 0.707323 |
295962a4260d506247f244a9b51e0563496e35a4 | 484 | h | C | src/TreeMetrics.h | ls-cwi/JRF | 1932dc7268ec90ffdcca6ba63c26ce987077e2b5 | [
"MIT"
] | 3 | 2016-08-12T16:29:19.000Z | 2020-07-04T18:30:53.000Z | src/TreeMetrics.h | ls-cwi/JRF | 1932dc7268ec90ffdcca6ba63c26ce987077e2b5 | [
"MIT"
] | null | null | null | src/TreeMetrics.h | ls-cwi/JRF | 1932dc7268ec90ffdcca6ba63c26ce987077e2b5 | [
"MIT"
] | null | null | null | #ifndef TREE_METRICS_H
#define TREE_METRICS_H
#include <iostream>
#include "PhylogeneticTree.h"
using namespace lemon;
double RobinsonFouldsDistance(const PhylogeneticTree &t1, const PhylogeneticTree &t2);
pair<double, int> JaccardRobinsonFouldsDistance(const PhylogeneticTree &t1, const PhylogeneticTree &t2, double k);
pair<pair<double, double>, pair<double, double> > JaccardRobinsonFouldsDistanceCPLEX(const PhylogeneticTree &t1, const PhylogeneticTree &t2, double k);
#endif
| 34.571429 | 151 | 0.816116 |
90c94312eb434bfeeae152fd5b94c8b201ff6a3e | 2,730 | h | C | indigo_drivers/ccd_apogee/bin_externals/libapogee/AltaEthernetIo.h | RusDavies/indigo | f46003ffd0d9f5fd5d3cf1daf8292ca216ad982f | [
"RSA-MD"
] | 83 | 2016-11-02T19:37:05.000Z | 2022-03-25T00:46:48.000Z | indigo_drivers/ccd_apogee/bin_externals/libapogee/AltaEthernetIo.h | RusDavies/indigo | f46003ffd0d9f5fd5d3cf1daf8292ca216ad982f | [
"RSA-MD"
] | 202 | 2016-11-05T10:58:09.000Z | 2022-03-30T23:51:45.000Z | indigo_drivers/ccd_apogee/bin_externals/libapogee/AltaEthernetIo.h | RusDavies/indigo | f46003ffd0d9f5fd5d3cf1daf8292ca216ad982f | [
"RSA-MD"
] | 57 | 2016-12-15T06:43:29.000Z | 2022-03-10T17:53:16.000Z | /*!
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* Copyright(c) 2009 Apogee Instruments, Inc.
* \class AltaEthernetIo
* \brief First generation implemenation (alta) of the ethernet interface
*
*/
#ifndef ALTAETHERNETIO_INCLUDE_H__
#define ALTAETHERNETIO_INCLUDE_H__
#include <string>
#include <vector>
#include <map>
#include "ICamIo.h"
#include "IAltaSerialPortIo.h"
class AltaEthernetIo : public ICamIo, public IAltaSerialPortIo
{
public:
AltaEthernetIo(const std::string url);
virtual ~AltaEthernetIo();
std::map<uint16_t,uint16_t> ReadRegs(const std::vector<uint16_t> & Regs);
uint16_t ReadReg(uint16_t reg) const;
void WriteReg(uint16_t reg, uint16_t val) ;
void WriteSRMD(uint16_t reg, const std::vector<uint16_t> & data);
void WriteMRMD(uint16_t reg, const std::vector<uint16_t> & data);
void SetupImgXfer(uint16_t Rows,
uint16_t Cols,
uint16_t NumOfImages, bool IsBulkSeq);
void CancelImgXfer();
void GetImageData(std::vector<uint16_t> & data);
void GetStatus(CameraStatusRegs::AdvStatus & status);
void GetStatus(CameraStatusRegs::BasicStatus & status);
void GetMacAddress(std::string & Mac);
void Reboot();
std::string GetNetworkSettings();
std::string GetDriverVersion();
uint16_t GetFirmwareRev();
std::string GetInfo();
void SetSerialBaudRate(uint16_t PortId , uint32_t BaudRate);
uint32_t GetSerialBaudRate( uint16_t PortId );
Apg::SerialFC GetSerialFlowControl(uint16_t PortId);
void SetSerialFlowControl(uint16_t PortId,
Apg::SerialFC FlowControl);
Apg::SerialParity GetSerialParity(uint16_t PortId);
void SetSerialParity(uint16_t PortId, Apg::SerialParity Parity);
void ReadSerial(uint16_t PortId, std::string & buffer);
void WriteSerial(uint16_t PortId, const std::string & buffer);
// TODO - see if we can do same error
// trapping we do in USB
bool IsError() { return false; }
private:
void OpenSession();
void CloseSession();
const std::string m_url;
const std::string m_fileName;
std::vector<uint16_t> m_StatusRegs;
//disabling the copy ctor and assignment operator
//generated by the compiler - don't want them
//Effective C++ Item 6
AltaEthernetIo(const AltaEthernetIo&);
AltaEthernetIo& operator=(AltaEthernetIo&);
};
#endif
| 28.4375 | 81 | 0.658242 |
ad2b0d717d3e850efc16690fd627a919f0b7403f | 1,162 | h | C | GPUImage/ImageFramebuffer.h | machenshuang/GPUImage | f44667541167ad9669bd8bd0434a386cd705b7f8 | [
"MIT"
] | null | null | null | GPUImage/ImageFramebuffer.h | machenshuang/GPUImage | f44667541167ad9669bd8bd0434a386cd705b7f8 | [
"MIT"
] | null | null | null | GPUImage/ImageFramebuffer.h | machenshuang/GPUImage | f44667541167ad9669bd8bd0434a386cd705b7f8 | [
"MIT"
] | null | null | null | //
// ImageFramebuffer.hpp
// GPUImage
//
// Created by 马陈爽 on 2022/2/19.
//
#ifndef ImageFramebuffer_h
#define ImageFramebuffer_h
#include <stdio.h>
#include <OpenGLES/ES3/gl.h>
#include <OpenGLES/ES3/glext.h>
#include "Size.h"
namespace gpu {
struct TextureOptions {
GLenum minFilter;
GLenum magFilter;
GLenum wrapS;
GLenum wrapT;
GLenum internalFormal;
GLenum format;
GLenum type;
};
class ImageFramebuffer {
public:
ImageFramebuffer(const Size &size, const TextureOptions &options, const bool &onlyTexture);
ImageFramebuffer(const Size &size, const GLuint &overriddenTexture);
~ImageFramebuffer();
void activateFramebuffer();
void lock();
void unlock();
void clearAllLock();
Size size() const;
GLuint texture() const;
TextureOptions options() const;
bool onlyTexture() const;
private:
Size mSize;
TextureOptions mOptions;
GLuint mTexture;
GLuint mFramebuffer;
bool mOnlyTexture;
unsigned int mReferenceCount;
void generateFramebuffer();
void generateTexture();
void destroyFramebuffer();
};
}
#endif /* ImageFramebuffer_h */
| 19.694915 | 95 | 0.688468 |
ad8d2603a28011a4a1268d581f97e66d1acae7c2 | 3,831 | c | C | bench/bench-libdynamic.c | oussemanaffetyy/mlib | e72aa5fb791b23150dab1c6037a078dba839b4b3 | [
"BSD-2-Clause"
] | 501 | 2017-02-24T12:19:59.000Z | 2022-03-31T10:12:21.000Z | bench/bench-libdynamic.c | oussemanaffetyy/mlib | e72aa5fb791b23150dab1c6037a078dba839b4b3 | [
"BSD-2-Clause"
] | 90 | 2017-03-03T21:18:11.000Z | 2022-03-25T09:25:55.000Z | bench/bench-libdynamic.c | oussemanaffetyy/mlib | e72aa5fb791b23150dab1c6037a078dba839b4b3 | [
"BSD-2-Clause"
] | 42 | 2017-03-26T13:53:52.000Z | 2022-02-23T00:01:30.000Z | #define NDEBUG
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <string.h>
#include <stdint.h>
#include <unistd.h>
// Needed due to compilation error in pool.h
#include <pthread.h>
#include "dynamic.h"
#include "common.h"
/********************************************************************************************/
static void test_array(size_t n)
{
vector a1, a2;
vector_construct(&a1, sizeof(unsigned int));
vector_construct(&a2, sizeof(unsigned int));
for(size_t i = 0; i < n; i++) {
unsigned int v = rand_get();
vector_push_back(&a1, &v);
v = rand_get();
vector_push_back(&a2, &v);
}
unsigned int s = 0;
for(unsigned long i = 0; i < n; i++) {
s += *(unsigned int*) vector_at(&a1, i) * *(unsigned int*) vector_at(&a2, i);
}
g_result = s;
vector_destruct(&a1, NULL);
vector_destruct(&a2, NULL);
}
/********************************************************************************************/
static size_t hash_func (void *a)
{
return hash_data(a, sizeof (unsigned long));
}
static int equal_func(void *a, void *b)
{
const unsigned long *pa = a;
if (b == NULL) {
return *pa == -1U;
}
const unsigned long *pb = b;
return *pa == *pb;
}
static void set_func(void *a, void *b)
{
unsigned long *pa = a;
if (b == NULL) {
*pa = -1U;
} else {
const unsigned long *pb = b;
*pa = *pb;
}
}
typedef struct map_element map_element;
struct map_element
{
unsigned long key;
unsigned long value;
};
static void
test_dict(size_t n)
{
map dict;
map_construct(&dict, sizeof(map_element), set_func);
for (size_t i = 0; i < n; i++) {
map_insert(&dict, (map_element[]) {{.key = rand_get(), .value = rand_get()}}, hash_func, set_func, equal_func, NULL);
}
rand_init();
unsigned int s = 0;
for (size_t i = 0; i < n; i++) {
map_element *p = map_at(&dict, (map_element[]){{.key = rand_get()}}, hash_func, equal_func);
if (p)
s += p->value;
}
g_result = s;
map_destruct(&dict, NULL, NULL);
}
/********************************************************************************************/
typedef char char_array_t[256];
static int char_equal (void *a, void *b)
{
const char_array_t *pa = (const char_array_t *)a;
if (b == NULL)
return strcmp(*pa, "") == 0;
const char_array_t *pb = (const char_array_t *)b;
return strcmp(*pa,*pb)==0;
}
static size_t char_hash(void *a)
{
char_array_t *pa = (char_array_t *)a;
return hash_string(*pa);
}
static void char_set(void *a, void *b)
{
char_array_t *pa = (char_array_t *)a;
if (b == NULL) {
strcpy(*pa, "");
} else {
const char_array_t *pb = (const char_array_t *)b;
strcpy(*pa,*pb);
}
}
typedef struct big_map_element big_map_element;
struct big_map_element
{
char_array_t key;
char_array_t value;
};
static void
test_dict_big(size_t n)
{
map dict;
map_construct(&dict, sizeof(big_map_element), char_set);
for (size_t i = 0; i < n; i++) {
big_map_element el;
sprintf(el.key, "%u", rand_get());
sprintf(el.value, "%u", rand_get());
map_insert(&dict, &el, char_hash, char_set, char_equal, NULL);
}
rand_init();
unsigned int s = 0;
for (size_t i = 0; i < n; i++) {
big_map_element el;
sprintf(el.key, "%u", rand_get());
big_map_element *p = map_at(&dict, &el, char_hash, char_equal);
if (p)
s ++;
}
g_result = s;
map_destruct(&dict, NULL, NULL);
}
/********************************************************************************************/
const config_func_t table[] = {
{ 20, "Array", 100000000, 0, test_array, 0},
{ 40, "dict", 1000000, 0, test_dict, 0},
{ 41, "dictBig", 1000000, 0, test_dict_big, 0},
};
int main(int argc, const char *argv[])
{
test("LIBDYNAMIC", numberof(table), table, argc, argv);
exit(0);
}
| 22.403509 | 121 | 0.554424 |
4258cefe788a06089a1c1307dc0d31eadeddedf3 | 769 | h | C | Source/Engine.h | JuanDiegoMontoya/EngineBase | e9b3f35d1a49e24a23c322c554176da55272e680 | [
"MIT"
] | null | null | null | Source/Engine.h | JuanDiegoMontoya/EngineBase | e9b3f35d1a49e24a23c322c554176da55272e680 | [
"MIT"
] | null | null | null | Source/Engine.h | JuanDiegoMontoya/EngineBase | e9b3f35d1a49e24a23c322c554176da55272e680 | [
"MIT"
] | null | null | null | #pragma once
struct EngineConfig
{
glm::uvec2 windowDim = { 0, 0 };
bool forceWindowDim = false; // false = use native resolution
bool verticalSync = true;
};
namespace Engine
{
/*
Initialization functions
*/
// initialize
void Init(EngineConfig);
// functions to be called no matter in the main loop
void PushRenderCallback(void(*fnPtr)(), int priority);
// functions to be called during the main loop, can be paused
void PushUpdateCallback(void(*fnPtr)(), int priority);
// runs the main loop
void Run();
void Cleanup();
/*
Runtime functions
*/
double GetDT();
float GetTimescale();
void SetTimescale(float sc);
class GLFWwindow* GetWindow();
void Pause();
void Unpause();
bool& GetPauseRef();
} | 19.717949 | 63 | 0.6658 |
554662e9e382becde689a0c06413b3ec59967867 | 436 | h | C | src/memory/FlagRegister.h | JohnHMoses/cppBoy | c74a778b9d186bf84ab4ae76e3fa1405d78a257c | [
"MIT"
] | 1 | 2018-10-25T16:58:51.000Z | 2018-10-25T16:58:51.000Z | src/memory/FlagRegister.h | JohnHMoses/cppBoy | c74a778b9d186bf84ab4ae76e3fa1405d78a257c | [
"MIT"
] | null | null | null | src/memory/FlagRegister.h | JohnHMoses/cppBoy | c74a778b9d186bf84ab4ae76e3fa1405d78a257c | [
"MIT"
] | null | null | null | #pragma once
#include "memory/ByteAddressable.h"
#include <memory>
namespace GameBoy {
class FlagRegister {
public:
FlagRegister(std::unique_ptr<ByteAddressable>&& flagRef);
auto set_zero(bool) -> void;
auto set_substract(bool) -> void;
auto set_half_carry(bool) -> void;
auto set_carry(bool) -> void;
private:
auto set_bit(size_t pos, bool) -> void;
std::unique_ptr<ByteAddressable> m_flagRef;
};
}
| 17.44 | 61 | 0.692661 |
1fb1b5a220652ba24e06d338cecfec888f9b9b97 | 534 | h | C | PersistenceCore/RepositoryCore.h | yaoxiao89/StaticFrameworks | 3afc2efe87b545752071d81a6505c0564a4f30ba | [
"MIT"
] | null | null | null | PersistenceCore/RepositoryCore.h | yaoxiao89/StaticFrameworks | 3afc2efe87b545752071d81a6505c0564a4f30ba | [
"MIT"
] | null | null | null | PersistenceCore/RepositoryCore.h | yaoxiao89/StaticFrameworks | 3afc2efe87b545752071d81a6505c0564a4f30ba | [
"MIT"
] | null | null | null | //
// RepositoryCore.h
// RepositoryCore
//
// Copyright © 2018 Xiao Yao. All rights reserved.
// See LICENSE.txt for licensing information
//
#import <UIKit/UIKit.h>
//! Project version number for RepositoryCore.
FOUNDATION_EXPORT double RepositoryCoreVersionNumber;
//! Project version string for RepositoryCore.
FOUNDATION_EXPORT const unsigned char RepositoryCoreVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <RepositoryCore/PublicHeader.h>
| 26.7 | 139 | 0.780899 |
9529e76dac39e613f9427772330fac804e395695 | 82 | h | C | Backdoor.Win32.C.a/process.h | 010001111/Vx-Suites | 6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79 | [
"MIT"
] | 2 | 2021-02-04T06:47:45.000Z | 2021-07-28T10:02:10.000Z | Backdoor.Win32.C.a/process.h | 010001111/Vx-Suites | 6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79 | [
"MIT"
] | null | null | null | Backdoor.Win32.C.a/process.h | 010001111/Vx-Suites | 6b4b90a60512cce48aa7b87aec5e5ac1c4bb9a79 | [
"MIT"
] | null | null | null | bool isprocess(const char *name);
bool processkill(int pid);
void processlist(); | 16.4 | 33 | 0.756098 |
99c70c89a4f1758ff06a20ba8fb594bc93f1462d | 1,451 | h | C | source/msynth/msynth/model/note/MDefaultMessageNoteList.h | MRoc/MSynth | 3eb5c6cf0ad6a3d12f555ebca5fbe84c1b255829 | [
"MIT"
] | 1 | 2022-01-30T07:40:31.000Z | 2022-01-30T07:40:31.000Z | source/msynth/msynth/model/note/MDefaultMessageNoteList.h | MRoc/MSynth | 3eb5c6cf0ad6a3d12f555ebca5fbe84c1b255829 | [
"MIT"
] | null | null | null | source/msynth/msynth/model/note/MDefaultMessageNoteList.h | MRoc/MSynth | 3eb5c6cf0ad6a3d12f555ebca5fbe84c1b255829 | [
"MIT"
] | null | null | null | /*
(C)2001 MRoc hifiShock
*/
#ifndef __MDefaultMessageNoteList
#define __MDefaultMessageNoteList
#include "MDefaultMessageNote.h"
#include "..\list\MListUtil.h"
#include "MDefaultNoteList.h"
#include "MMEssage.h"
class MDefaultMessageNoteList :
public MDefaultNoteList
{
public:
static int TYPE_ID;
static char* TYPE_USER_NAME;
public:
MDefaultMessageNoteList();
MDefaultMessageNoteList( MDefaultMessageNoteList* ptNoteList );
virtual ~MDefaultMessageNoteList();
// MMessage functions
virtual void applyDynamics( unsigned int index, FP value );
virtual MDefaultMessageNote* postMessage( MMessage *message, int index );
virtual MMessage* getMessageForId( int index, int id );
virtual void deleteMessageForId( int index, int id );
virtual void removeMessageForId( int index, int id );
virtual void cutId( int id );
virtual void setHighestId( int id );
virtual MMessage* createDefaultMessage();
virtual bool canPostMessageAt( unsigned int index, int id );
// Note functions
virtual IAbstractNote* createDefaultNote();
// Serialisation
virtual MTreeNode* save();
virtual void load( MTreeNode* node );
virtual MColor getPreferedColor();
virtual MDefaultNoteList* createNewInstance();
static MDefaultNoteList* createInstance();
virtual ICopyCutPaste* getCopy();
virtual int getTypeId();
virtual char* getUserTypeName();
};
#endif
| 25.45614 | 75 | 0.727085 |
05d9ded287fda1f18d1f6757de5205689b867b36 | 357 | h | C | NoAdSpotify/logger/logger.h | zimzika/NoAdSpotify | d3331afdf405ddd976fb7d22b52bc0824fd1d536 | [
"MIT"
] | 4 | 2021-06-07T03:13:54.000Z | 2021-11-03T04:23:14.000Z | NoAdSpotify/logger/logger.h | zimzika/NoAdSpotify | d3331afdf405ddd976fb7d22b52bc0824fd1d536 | [
"MIT"
] | null | null | null | NoAdSpotify/logger/logger.h | zimzika/NoAdSpotify | d3331afdf405ddd976fb7d22b52bc0824fd1d536 | [
"MIT"
] | 1 | 2021-10-19T23:52:24.000Z | 2021-10-19T23:52:24.000Z | #pragma once
#include <iostream>
class logger
{
public:
logger( );
~logger( );
static logger* instance( );
uint8_t* m_fn_is_skippable = nullptr;
uint8_t* m_fn_require_focus = nullptr;
uint8_t* m_fn_now_playing = nullptr;
uint8_t* m_jne_ad_missing_id = nullptr;
uint8_t* m_mov_skip_stuck_seconds = nullptr;
bool valid_ptrs( );
private:
};
| 17.85 | 45 | 0.72549 |
0544fee1c123add1be893a80ffdeb49b8bd53a56 | 4,561 | c | C | blackjack.c | subhashissuara/blackjack | ce62f21efc3dcc84785f3035e92c877e9c9fefbc | [
"MIT"
] | 3 | 2019-08-25T17:31:29.000Z | 2020-02-28T05:25:16.000Z | blackjack.c | subhashissuara/blackjack | ce62f21efc3dcc84785f3035e92c877e9c9fefbc | [
"MIT"
] | null | null | null | blackjack.c | subhashissuara/blackjack | ce62f21efc3dcc84785f3035e92c877e9c9fefbc | [
"MIT"
] | 2 | 2019-08-24T18:00:49.000Z | 2020-02-28T05:25:21.000Z | /*
Made by Subhashis Suara
*/
#include<stdio.h>
#include<stdlib.h>
#include <stdbool.h>
#include <time.h>
/*
To prevent repeating of cards:
type ->
1 - Spades
2 - Hearts
3 - Diamonds
4 - Clubs
number ->
1 to 13
*/
struct card
{
int type;
int number;
};
// Array to keep track and avoid of repeating cards
struct card noRepeat[30];
int noRepeat_counter = 0;
int givePoint();
int cardRound(int players[], int size);
int randfor2();
bool checkDisqualify(int points);
bool checkWin(int points);
bool checkRepeat(struct card card_);
int printType(struct card card_);
int main(){
int players[2] = {0}, size = 2;
bool flag = true;
int points = 0;
srand (time(NULL));
cardRound(players, size);
cardRound(players, size);
char choice;
while(flag){
for(int i = 0; i < size; i++){
if(checkDisqualify(players[i])){
if(i == (size - 1)){
if(checkDisqualify(players[i - 1])){
printf("\nNo one won the game!\n");
flag = false;
break;
}
else
{
printf("Player %d exceeded 21 points and got disqualified!\n", i + 1);
printf("Player %d won with %d points!\n", i, players[i - 1]);
flag = false;
break;
}
}
else{
if(checkDisqualify(players[i + 1])){
printf("No one won the game!\n");
flag = false;
break;
}
else
{
printf("Player %d exceeded 21 points and got disqualified!\n", i + 1);
printf("Player %d won with %d points!\n", i + 2, players[i + 1]);
flag = false;
break;
}
}
}
if(checkWin(players[i])){
printf("blackjack! Player %d won with %d points!\n", i + 1, players[i]);
flag = false;
break;
}
printf("\nPlayer %d -> %d points!\n", i + 1, players[i]);
printf("Do you want to hit, player %d? y or n\n", i + 1);
scanf(" %c", &choice);
if(choice == 'y' || choice == 'Y'){
points = givePoint();
players[i] += points;
}
else if(choice == 'n' || choice == 'N')
continue;
else{
printf("Invalid input!\n");
flag = false;
break;
}
}
}
return 0;
}
/*
Gives random between 2 given number
1 - returns 1 points
2 - returns 11 points
*/
int randfor2(){
int chosen = ((rand()) % (2 - 1 + 1) + 1);
if(chosen == 1)
return 1;
else if(chosen == 2)
return 11;
}
// Checks so that cards are not repeated
bool checkRepeat(struct card card_){
for(int i = 0; i < 30; i = i + 2){
if(card_.type == noRepeat[i].type && card_.type == noRepeat[i].type)
return true;
noRepeat[noRepeat_counter].type = card_.type;
noRepeat[noRepeat_counter + 1].number = card_.number;
noRepeat_counter = noRepeat_counter + 2;
return false;
}
}
// Gets the card and returns the point
int givePoint(){
int random_number = rand();
int lwr = 1, upr = 4;
struct card card_;
card_.type = ((random_number) % (upr - lwr + 1)) + lwr;
lwr = 1, upr = 13;
card_.number = ((random_number) % (upr - lwr + 1)) + lwr;
if(checkRepeat(card_)){
givePoint();
}
else
{
if(card_.number < 11){
if(card_.number == 1){
int chosen = randfor2();
return chosen;
}
return card_.number;
}
else
return 10;
}
}
// Checks if a player has more than 21 points
bool checkDisqualify(int points){
if(points > 21)
return true;
else
return false;
}
// Checks if a player has 21 points and won
bool checkWin(int points){
if(points == 21)
return true;
else
return false;
}
// To assign cards and points to players every round
int cardRound(int players[], int size){
int points = 0;
for(int i = 0; i < size; i++){
points = givePoint();
players[i] += points;
}
}
/*
// To print card if required
int printCard(struct card card_){
char Picture[1];
bool pic;
if(card_.number < 11 && card_.number > 1){
pic = false;
}
else if(card_.number == 11){
pic = true;
Picture[1] = "Jack";
}
else if(card_.number == 12){
pic = true;
Picture[1] = "Queen";
}
else if(card_.number == 13){
pic = true;
Picture[1] = "King";
}
else
{
pic = true;
Picture[1] = "Ace";
}
switch(card_.type){
case 1:
if(pic){
printf("%s of Spades", Picture[1]);
}
else{
printf("%d of Spades", card_.number);
}
break;
case 2:
if(pic){
printf("%s of Hearts", Picture[1]);
}
else{
printf("%d of Hearts", card_.number);
}
break;
case 3:
if(pic){
printf("%s of Diamonds", Picture[1]);
}
else{
printf("%d of Diamonds", card_.number);
}
break;
case 4:
if(pic){
printf("%s of Clubs", Picture[1]);
}
else{
printf("%d of Clubs", card_.number);
}
break;
default:
break;
}
}
*/
| 18.616327 | 75 | 0.591098 |
9fbd8985b8e6bd7d1187003f3a46ef6c339b14bf | 463 | c | C | base/win32/fusion/tests/shfusion2/uselibc.c | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | base/win32/fusion/tests/shfusion2/uselibc.c | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | base/win32/fusion/tests/shfusion2/uselibc.c | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /* Copyright (c) Microsoft Corporation */
#define ISOLATION_AWARE_ENABLED 1
#define ISOLATION_AWARE_USE_STATIC_LIBRARY 1
#include "windows.h"
#include "winuser.h"
#include "prsht.h"
#include "commdlg.h"
#include "commctrl.h"
#include <stdio.h>
int __cdecl main()
{
printf("%p\n", (void*)&LoadLibraryA);
printf("%p\n", (void*)&LoadLibraryW);
printf("%p\n", (void*)&CreateWindowExA);
printf("%p\n", (void*)&CreateWindowExW);
}
| 23.15 | 45 | 0.656587 |
f956fb3f95ef23ab18bd3827da70c3d3fdc84312 | 949 | h | C | src/xrt/include/xrt/xrt_openxr_includes.h | ltstein/monado_integration | 4e5348e3dbf3bb9584eec9a761488274a7deddbd | [
"BSL-1.0"
] | null | null | null | src/xrt/include/xrt/xrt_openxr_includes.h | ltstein/monado_integration | 4e5348e3dbf3bb9584eec9a761488274a7deddbd | [
"BSL-1.0"
] | 3 | 2020-09-08T18:32:13.000Z | 2021-05-22T00:13:29.000Z | src/xrt/include/xrt/xrt_openxr_includes.h | ltstein/monado_integration | 4e5348e3dbf3bb9584eec9a761488274a7deddbd | [
"BSL-1.0"
] | 3 | 2020-01-31T01:19:41.000Z | 2022-03-30T22:32:31.000Z | // Copyright 2018-2019, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
* @brief Include all of the openxr headers in one place.
* @author Jakob Bornecrantz <jakob@collabora.com>
* @ingroup xrt_iface
*/
#pragma once
//! @todo Move these to the build system instead.
#define XR_USE_GRAPHICS_API_VULKAN
#define XR_USE_TIMESPEC 1
#ifdef XR_USE_PLATFORM_XLIB
typedef void *Display;
typedef void *GLXFBConfig;
typedef void *GLXDrawable;
typedef void *GLXContext;
#endif
#ifdef XR_USE_PLATFORM_EGL
typedef void *EGLDisplay;
typedef void *EGLContext;
typedef void *EGLConfig;
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
typedef __eglMustCastToProperFunctionPointerType (*PFNEGLGETPROCADDRESSPROC)(
const char *procname);
#endif
#ifdef XR_USE_TIMESPEC
#include <time.h>
#endif
#include "openxr_includes/openxr.h"
#include "openxr_includes/openxr_platform.h"
#include "openxr_includes/loader_interfaces.h"
| 24.333333 | 77 | 0.788198 |
667afacbaf1d33de23ed19f5b85e02877cc91b51 | 1,153 | h | C | win/win.h | loridigia/ps-server | f1bd336a4979d7cfb25bbe16f46951936f9dc03b | [
"MIT"
] | 2 | 2019-11-07T10:21:59.000Z | 2021-03-15T09:52:13.000Z | win/win.h | jacopoRufini/gopher-c-server | eb10a6e14309a8d3eb311989e20a561f0fb7a2d5 | [
"MIT"
] | null | null | null | win/win.h | jacopoRufini/gopher-c-server | eb10a6e14309a8d3eb311989e20a561f0fb7a2d5 | [
"MIT"
] | 1 | 2019-11-07T10:22:22.000Z | 2019-11-07T10:22:22.000Z | #include <winsock2.h>
#include <ws2tcpip.h>
#include <iphlpapi.h>
#include <stdio.h>
#include <windows.h>
#include <tchar.h>
#include "../shared/shared.h"
#include CONSTANTS
#include CORE_PATH
#pragma comment(lib,"ws2_32.lib")
#define BUF_SIZE 256
#define PIPENAME "\\\\.\\pipe\\LogPipe"
#define GLOBAL_MUTEX "Global\\Mutex"
#define GLOBAL_CONFIG "Global\\Config"
#define LOGGER_EVENT "Logger_Event"
#define PIPE_EVENT "Pipe_Event"
STARTUPINFO info;
PROCESS_INFORMATION listener_info;
HANDLE pipe_event;
HANDLE logger_event;
HANDLE mutex;
HANDLE map_handle;
typedef struct thread_arg_controller {
SOCKET socket;
HANDLE hProcess;
} thread_arg_controller;
int set_shared_config();
int get_shared_config();
BOOL WINAPI CtrlHandler(DWORD fdwCtrlType);
DWORD WINAPI listener_routine(void *args);
DWORD WINAPI receiver_routine(void *args);
DWORD WINAPI sender_routine(void *args);
DWORD WINAPI controller_routine(void *args);
PROCESS_INFORMATION create_receiver_process(char *args);
int listen_on(int port, struct sockaddr_in *server, int *addrlen, SOCKET *sock);
int restart();
void print_error(char *err);
void print_WSA_error(char *err); | 25.622222 | 80 | 0.780572 |
66dedf67f7a5f293faacf4a9abd81ffbd567bb2e | 1,099 | h | C | services/media/framework/parts/decoder.h | smklein/motown | eb4cd4f30c134eb411f6e6390ebe1b396769e2d5 | [
"BSD-3-Clause"
] | null | null | null | services/media/framework/parts/decoder.h | smklein/motown | eb4cd4f30c134eb411f6e6390ebe1b396769e2d5 | [
"BSD-3-Clause"
] | null | null | null | services/media/framework/parts/decoder.h | smklein/motown | eb4cd4f30c134eb411f6e6390ebe1b396769e2d5 | [
"BSD-3-Clause"
] | null | null | null | // Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_
#define SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_
#include "services/media/framework/models/transform.h"
#include "services/media/framework/packet.h"
#include "services/media/framework/payload_allocator.h"
#include "services/media/framework/result.h"
#include "services/media/framework/types/stream_type.h"
namespace mojo {
namespace media {
// Abstract base class for transforms that decode compressed media.
class Decoder : public Transform {
public:
// Creates a Decoder object for a given stream type.
static Result Create(const StreamType& stream_type,
std::shared_ptr<Decoder>* decoder_out);
~Decoder() override {}
// Returns the type of the stream the decoder will produce.
virtual std::unique_ptr<StreamType> output_stream_type() = 0;
};
} // namespace media
} // namespace mojo
#endif // SERVICES_MEDIA_FRAMEWORK_PARTS_DECODER_H_
| 32.323529 | 73 | 0.766151 |
3ad85ffdb296a88656b538723cc59c229a3daaa9 | 478 | h | C | include/lang/type.h | zellio/zlisp | d40b8c30a100a3f0ce85fb962ce3dba3f35869f8 | [
"MIT"
] | 2 | 2015-03-09T12:34:43.000Z | 2017-05-03T07:41:47.000Z | include/lang/type.h | zellio/zlisp | d40b8c30a100a3f0ce85fb962ce3dba3f35869f8 | [
"MIT"
] | null | null | null | include/lang/type.h | zellio/zlisp | d40b8c30a100a3f0ce85fb962ce3dba3f35869f8 | [
"MIT"
] | null | null | null | #ifndef __ZL_LANG_TYPE_H__
#define __ZL_LANG_TYPE_H__ 1
#include "lang/type/object.h"
#include "lang/type/nil.h"
#include "lang/type/true.h"
#include "lang/type/false.h"
#include "lang/type/character.h"
#include "lang/type/fixnum.h"
#include "lang/type/real.h"
#include "lang/type/symbol.h"
#include "lang/type/pair.h"
#include "lang/type/string.h"
#include "lang/type/vector.h"
#include "lang/type/port.h"
#include "lang/type/builtin.h"
#include "lang/type/closure.h"
#endif
| 23.9 | 32 | 0.742678 |
d7647ba5da0dbe6ac7e12488cae4f38170f47c48 | 494 | h | C | pixie/UI/visualizers/MultiSprite_Horiz3.h | martonantoni/pixie | ab750d25d12f8420e68e1cb393a75b1f0a0c1056 | [
"MIT"
] | null | null | null | pixie/UI/visualizers/MultiSprite_Horiz3.h | martonantoni/pixie | ab750d25d12f8420e68e1cb393a75b1f0a0c1056 | [
"MIT"
] | null | null | null | pixie/UI/visualizers/MultiSprite_Horiz3.h | martonantoni/pixie | ab750d25d12f8420e68e1cb393a75b1f0a0c1056 | [
"MIT"
] | null | null | null | #pragma once
class cMultiSprite_Horiz3: public cAutoMultiSpriteBase
{
enum eSpriteIndex { Sprite_Left,Sprite_Center,Sprite_Right, NumberOfSprites };
int mLeftBorderWidth,mRightBorderWidth,mHeight;
virtual void ArrangeSprites() override;
virtual const char **GetPositionNames() const override;
virtual bool FinalizeInit() override;
protected:
virtual ~cMultiSprite_Horiz3() {}
public:
cMultiSprite_Horiz3();
};
USE_DROP_INSTEAD_DELETE_PARENT(cMultiSprite_Horiz3, cAutoMultiSpriteBase) | 30.875 | 81 | 0.825911 |
b5adee1ef325e500542d9a80a5abd2e093eb0461 | 465 | h | C | src/main/resources/export/cpp/ConditionalCommand-includes.h | wpilibsuite/robotbuilder | b5bd461cbb69029754191c6fdbb54bece1a121f3 | [
"BSD-3-Clause"
] | 34 | 2016-05-10T19:17:36.000Z | 2022-01-18T18:42:54.000Z | src/main/resources/export/cpp/ConditionalCommand-includes.h | wpilibsuite/robotbuilder | b5bd461cbb69029754191c6fdbb54bece1a121f3 | [
"BSD-3-Clause"
] | 227 | 2016-05-11T21:12:35.000Z | 2022-02-28T03:51:42.000Z | src/main/resources/export/cpp/ConditionalCommand-includes.h | wpilibsuite/robotbuilder | b5bd461cbb69029754191c6fdbb54bece1a121f3 | [
"BSD-3-Clause"
] | 43 | 2016-05-11T21:00:23.000Z | 2022-02-11T01:58:53.000Z | #set($command = $helper.getByName($command_name, $robot))
#set($onTrue = $command.getProperty("On True Command").getValue())
#set($onFalse = $command.getProperty("On False Command").getValue())
\#include <frc2/command/ConditionalCommand.h>
\#include "commands/#class($onTrue).h"
\#include "commands/#class($onFalse).h"
#if (${command.getProperty("Requires").getValue()} != "None")
\#include "subsystems/#class(${command.getProperty("Requires").getValue()}).h"
#end | 46.5 | 78 | 0.713978 |
80f854f202cd13637f76560fc98c5850f513e0dd | 38 | c | C | program/lib/stack.c | jovanbulck/SGX-Shield | 93be629a58062d922284ce497e6d74f92e585f25 | [
"MIT"
] | 44 | 2016-10-26T20:52:18.000Z | 2022-03-04T14:16:12.000Z | program/lib/stack.c | sslab-gatech/SGX-Shield | 04b09dd6e5dc538fbc9533a2264ed4b8612b0f48 | [
"MIT"
] | 5 | 2017-01-18T11:06:09.000Z | 2021-11-23T15:14:08.000Z | loader/target-program/lib/stack.c | StanPlatinum/cat-sgx | bfec75a312488513c803c6770f1abbd1fcb16e66 | [
"MIT"
] | 23 | 2016-11-27T09:48:12.000Z | 2021-09-22T17:32:07.000Z | unsigned char _stack[0x400000] = {0};
| 19 | 37 | 0.710526 |
b9abb32557ebeae5fd96861eb178f56cc266e244 | 109,389 | c | C | CMSIS/DSP/Testing/Source/Tests/mfccdata.c | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 2,293 | 2016-02-25T06:47:33.000Z | 2022-03-29T16:44:02.000Z | CMSIS/DSP/Testing/Source/Tests/mfccdata.c | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 1,125 | 2016-02-27T09:56:01.000Z | 2022-03-31T13:57:05.000Z | CMSIS/DSP/Testing/Source/Tests/mfccdata.c | DavidLesnjak/CMSIS_5 | e0848410d137758a3356a5ee94ca4501cea708a8 | [
"Apache-2.0"
] | 1,160 | 2016-02-27T09:06:10.000Z | 2022-03-31T19:06:24.000Z | #include "mfccdata.h"
const float32_t mfcc_dct_coefs_config1_f32[NB_MFCC_DCT_COEFS_CONFIG1_F32]={
0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,
0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,0.316228f,
0.315253f,0.307490f,0.292156f,0.269628f,0.240461f,0.205374f,0.165229f,0.121015f,0.073822f,0.024811f,
-0.024811f,-0.073822f,-0.121015f,-0.165229f,-0.205374f,-0.240461f,-0.269628f,-0.292156f,-0.307490f,-0.315253f,
0.312334f,0.281761f,0.223607f,0.143564f,0.049469f,-0.049469f,-0.143564f,-0.223607f,-0.281761f,-0.312334f,
-0.312334f,-0.281761f,-0.223607f,-0.143564f,-0.049469f,0.049469f,0.143564f,0.223607f,0.281761f,0.312334f,
0.307490f,0.240461f,0.121015f,-0.024811f,-0.165229f,-0.269628f,-0.315253f,-0.292156f,-0.205374f,-0.073822f,
0.073822f,0.205374f,0.292156f,0.315253f,0.269628f,0.165229f,0.024811f,-0.121015f,-0.240461f,-0.307490f,
0.300750f,0.185874f,0.000000f,-0.185874f,-0.300750f,-0.300750f,-0.185874f,-0.000000f,0.185874f,0.300750f,
0.300750f,0.185874f,0.000000f,-0.185874f,-0.300750f,-0.300750f,-0.185874f,-0.000000f,0.185874f,0.300750f,
0.292156f,0.121015f,-0.121015f,-0.292156f,-0.292156f,-0.121015f,0.121015f,0.292156f,0.292156f,0.121015f,
-0.121015f,-0.292156f,-0.292156f,-0.121015f,0.121015f,0.292156f,0.292156f,0.121015f,-0.121015f,-0.292156f,
0.281761f,0.049469f,-0.223607f,-0.312334f,-0.143564f,0.143564f,0.312334f,0.223607f,-0.049469f,-0.281761f,
-0.281761f,-0.049469f,0.223607f,0.312334f,0.143564f,-0.143564f,-0.312334f,-0.223607f,0.049469f,0.281761f,
0.269628f,-0.024811f,-0.292156f,-0.240461f,0.073822f,0.307490f,0.205374f,-0.121015f,-0.315253f,-0.165229f,
0.165229f,0.315253f,0.121015f,-0.205374f,-0.307490f,-0.073822f,0.240461f,0.292156f,0.024811f,-0.269628f,
0.255834f,-0.097720f,-0.316228f,-0.097720f,0.255834f,0.255834f,-0.097720f,-0.316228f,-0.097720f,0.255834f,
0.255834f,-0.097720f,-0.316228f,-0.097720f,0.255834f,0.255834f,-0.097720f,-0.316228f,-0.097720f,0.255834f,
0.240461f,-0.165229f,-0.292156f,0.073822f,0.315253f,0.024811f,-0.307490f,-0.121015f,0.269628f,0.205374f,
-0.205374f,-0.269628f,0.121015f,0.307490f,-0.024811f,-0.315253f,-0.073822f,0.292156f,0.165229f,-0.240461f,
0.223607f,-0.223607f,-0.223607f,0.223607f,0.223607f,-0.223607f,-0.223607f,0.223607f,0.223607f,-0.223607f,
-0.223607f,0.223607f,0.223607f,-0.223607f,-0.223607f,0.223607f,0.223607f,-0.223607f,-0.223607f,0.223607f,
0.205374f,-0.269628f,-0.121015f,0.307490f,0.024811f,-0.315253f,0.073822f,0.292156f,-0.165229f,-0.240461f,
0.240461f,0.165229f,-0.292156f,-0.073822f,0.315253f,-0.024811f,-0.307490f,0.121015f,0.269628f,-0.205374f,
0.185874f,-0.300750f,-0.000000f,0.300750f,-0.185874f,-0.185874f,0.300750f,0.000000f,-0.300750f,0.185874f,
0.185874f,-0.300750f,-0.000000f,0.300750f,-0.185874f,-0.185874f,0.300750f,-0.000000f,-0.300750f,0.185874f,
};
const q31_t mfcc_dct_coefs_config1_q31[NB_MFCC_DCT_COEFS_CONFIG1_Q31]={
0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,
0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,0x287A26C5,
0x285A3559,0x275BD828,0x2565612F,0x22832FBF,0x1EC77118,0x1A49ADD5,0x15263592,0x0F7D6C76,0x0972FF08,0x032D014A,
0xFCD2FEB6,0xF68D00F8,0xF082938A,0xEAD9CA6E,0xE5B6522B,0xE1388EE8,0xDD7CD041,0xDA9A9ED1,0xD8A427D8,0xD7A5CAA7,
0x27FA937F,0x2410BE9A,0x1C9F25C6,0x1260517D,0x0654FF64,0xF9AB009C,0xED9FAE83,0xE360DA3A,0xDBEF4166,0xD8056C81,
0xD8056C81,0xDBEF4166,0xE360DA3A,0xED9FAE83,0xF9AB009C,0x0654FF64,0x1260517D,0x1C9F25C6,0x2410BE9A,0x27FA937F,
0x275BD828,0x1EC77118,0x0F7D6C76,0xFCD2FEB6,0xEAD9CA6E,0xDD7CD041,0xD7A5CAA7,0xDA9A9ED1,0xE5B6522B,0xF68D00F8,
0x0972FF08,0x1A49ADD5,0x2565612F,0x285A3559,0x22832FBF,0x15263592,0x032D014A,0xF082938A,0xE1388EE8,0xD8A427D8,
0x267EFDDD,0x17CAB845,0x00000000,0xE83547BB,0xD9810223,0xD9810223,0xE83547BB,0x00000000,0x17CAB845,0x267EFDDD,
0x267EFDDD,0x17CAB845,0x00000000,0xE83547BB,0xD9810223,0xD9810223,0xE83547BB,0x00000000,0x17CAB845,0x267EFDDD,
0x2565612F,0x0F7D6C76,0xF082938A,0xDA9A9ED1,0xDA9A9ED1,0xF082938A,0x0F7D6C76,0x2565612F,0x2565612F,0x0F7D6C76,
0xF082938A,0xDA9A9ED1,0xDA9A9ED1,0xF082938A,0x0F7D6C76,0x2565612F,0x2565612F,0x0F7D6C76,0xF082938A,0xDA9A9ED1,
0x2410BE9A,0x0654FF64,0xE360DA3A,0xD8056C81,0xED9FAE83,0x1260517D,0x27FA937F,0x1C9F25C6,0xF9AB009C,0xDBEF4166,
0xDBEF4166,0xF9AB009C,0x1C9F25C6,0x27FA937F,0x1260517D,0xED9FAE83,0xD8056C81,0xE360DA3A,0x0654FF64,0x2410BE9A,
0x22832FBF,0xFCD2FEB6,0xDA9A9ED1,0xE1388EE8,0x0972FF08,0x275BD828,0x1A49ADD5,0xF082938A,0xD7A5CAA7,0xEAD9CA6E,
0x15263592,0x285A3559,0x0F7D6C76,0xE5B6522B,0xD8A427D8,0xF68D00F8,0x1EC77118,0x2565612F,0x032D014A,0xDD7CD041,
0x20BF2818,0xF37DEB4B,0xD785D93B,0xF37DEB4B,0x20BF2818,0x20BF2818,0xF37DEB4B,0xD785D93B,0xF37DEB4B,0x20BF2818,
0x20BF2818,0xF37DEB4B,0xD785D93B,0xF37DEB4B,0x20BF2818,0x20BF2818,0xF37DEB4B,0xD785D93B,0xF37DEB4B,0x20BF2818,
0x1EC77118,0xEAD9CA6E,0xDA9A9ED1,0x0972FF08,0x285A3559,0x032D014A,0xD8A427D8,0xF082938A,0x22832FBF,0x1A49ADD5,
0xE5B6522B,0xDD7CD041,0x0F7D6C76,0x275BD828,0xFCD2FEB6,0xD7A5CAA7,0xF68D00F8,0x2565612F,0x15263592,0xE1388EE8,
0x1C9F25C6,0xE360DA3A,0xE360DA3A,0x1C9F25C6,0x1C9F25C6,0xE360DA3A,0xE360DA3A,0x1C9F25C6,0x1C9F25C6,0xE360DA3A,
0xE360DA3A,0x1C9F25C6,0x1C9F25C6,0xE360DA3A,0xE360DA3A,0x1C9F25C6,0x1C9F25C6,0xE360DA3A,0xE360DA3A,0x1C9F25C6,
0x1A49ADD5,0xDD7CD041,0xF082938A,0x275BD828,0x032D014A,0xD7A5CAA7,0x0972FF08,0x2565612F,0xEAD9CA6E,0xE1388EE8,
0x1EC77118,0x15263592,0xDA9A9ED1,0xF68D00F8,0x285A3559,0xFCD2FEB6,0xD8A427D8,0x0F7D6C76,0x22832FBF,0xE5B6522B,
0x17CAB845,0xD9810223,0x00000000,0x267EFDDD,0xE83547BB,0xE83547BB,0x267EFDDD,0x00000000,0xD9810223,0x17CAB845,
0x17CAB845,0xD9810223,0x00000000,0x267EFDDD,0xE83547BB,0xE83547BB,0x267EFDDD,0x00000000,0xD9810223,0x17CAB845,
};
const q15_t mfcc_dct_coefs_config1_q15[NB_MFCC_DCT_COEFS_CONFIG1_Q15]={
0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,
0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,0x287A,
0x285A,0x275C,0x2565,0x2283,0x1EC7,0x1A4A,0x1526,0x0F7D,0x0973,0x032D,
0xFCD3,0xF68D,0xF083,0xEADA,0xE5B6,0xE139,0xDD7D,0xDA9B,0xD8A4,0xD7A6,
0x27FB,0x2411,0x1C9F,0x1260,0x0655,0xF9AB,0xEDA0,0xE361,0xDBEF,0xD805,
0xD805,0xDBEF,0xE361,0xEDA0,0xF9AB,0x0655,0x1260,0x1C9F,0x2411,0x27FB,
0x275C,0x1EC7,0x0F7D,0xFCD3,0xEADA,0xDD7D,0xD7A6,0xDA9B,0xE5B6,0xF68D,
0x0973,0x1A4A,0x2565,0x285A,0x2283,0x1526,0x032D,0xF083,0xE139,0xD8A4,
0x267F,0x17CB,0x0000,0xE835,0xD981,0xD981,0xE835,0x0000,0x17CB,0x267F,
0x267F,0x17CB,0x0000,0xE835,0xD981,0xD981,0xE835,0x0000,0x17CB,0x267F,
0x2565,0x0F7D,0xF083,0xDA9B,0xDA9B,0xF083,0x0F7D,0x2565,0x2565,0x0F7D,
0xF083,0xDA9B,0xDA9B,0xF083,0x0F7D,0x2565,0x2565,0x0F7D,0xF083,0xDA9B,
0x2411,0x0655,0xE361,0xD805,0xEDA0,0x1260,0x27FB,0x1C9F,0xF9AB,0xDBEF,
0xDBEF,0xF9AB,0x1C9F,0x27FB,0x1260,0xEDA0,0xD805,0xE361,0x0655,0x2411,
0x2283,0xFCD3,0xDA9B,0xE139,0x0973,0x275C,0x1A4A,0xF083,0xD7A6,0xEADA,
0x1526,0x285A,0x0F7D,0xE5B6,0xD8A4,0xF68D,0x1EC7,0x2565,0x032D,0xDD7D,
0x20BF,0xF37E,0xD786,0xF37E,0x20BF,0x20BF,0xF37E,0xD786,0xF37E,0x20BF,
0x20BF,0xF37E,0xD786,0xF37E,0x20BF,0x20BF,0xF37E,0xD786,0xF37E,0x20BF,
0x1EC7,0xEADA,0xDA9B,0x0973,0x285A,0x032D,0xD8A4,0xF083,0x2283,0x1A4A,
0xE5B6,0xDD7D,0x0F7D,0x275C,0xFCD3,0xD7A6,0xF68D,0x2565,0x1526,0xE139,
0x1C9F,0xE361,0xE361,0x1C9F,0x1C9F,0xE361,0xE361,0x1C9F,0x1C9F,0xE361,
0xE361,0x1C9F,0x1C9F,0xE361,0xE361,0x1C9F,0x1C9F,0xE361,0xE361,0x1C9F,
0x1A4A,0xDD7D,0xF083,0x275C,0x032D,0xD7A6,0x0973,0x2565,0xEADA,0xE139,
0x1EC7,0x1526,0xDA9B,0xF68D,0x285A,0xFCD3,0xD8A4,0x0F7D,0x2283,0xE5B6,
0x17CB,0xD981,0x0000,0x267F,0xE835,0xE835,0x267F,0x0000,0xD981,0x17CB,
0x17CB,0xD981,0x0000,0x267F,0xE835,0xE835,0x267F,0x0000,0xD981,0x17CB,
};
const float32_t mfcc_window_coefs_config1_f32[NB_MFCC_WIN_COEFS_CONFIG1_F32]={
0.080000f,0.080009f,0.080035f,0.080078f,0.080139f,0.080216f,0.080312f,0.080424f,0.080554f,0.080701f,
0.080866f,0.081047f,0.081246f,0.081463f,0.081696f,0.081947f,0.082215f,0.082500f,0.082803f,0.083123f,
0.083459f,0.083814f,0.084185f,0.084573f,0.084979f,0.085402f,0.085841f,0.086298f,0.086772f,0.087263f,
0.087771f,0.088297f,0.088839f,0.089398f,0.089974f,0.090567f,0.091177f,0.091804f,0.092448f,0.093108f,
0.093786f,0.094480f,0.095191f,0.095919f,0.096663f,0.097424f,0.098202f,0.098996f,0.099807f,0.100635f,
0.101479f,0.102340f,0.103217f,0.104111f,0.105021f,0.105947f,0.106890f,0.107849f,0.108824f,0.109816f,
0.110823f,0.111847f,0.112887f,0.113943f,0.115015f,0.116104f,0.117208f,0.118328f,0.119464f,0.120615f,
0.121783f,0.122966f,0.124165f,0.125380f,0.126610f,0.127856f,0.129117f,0.130394f,0.131686f,0.132993f,
0.134316f,0.135654f,0.137008f,0.138376f,0.139760f,0.141159f,0.142572f,0.144001f,0.145445f,0.146903f,
0.148377f,0.149865f,0.151367f,0.152885f,0.154417f,0.155963f,0.157524f,0.159099f,0.160689f,0.162293f,
0.163911f,0.165543f,0.167190f,0.168850f,0.170525f,0.172213f,0.173915f,0.175631f,0.177361f,0.179104f,
0.180861f,0.182631f,0.184415f,0.186212f,0.188023f,0.189847f,0.191684f,0.193534f,0.195397f,0.197273f,
0.199162f,0.201064f,0.202979f,0.204906f,0.206846f,0.208799f,0.210764f,0.212741f,0.214731f,0.216733f,
0.218747f,0.220773f,0.222811f,0.224862f,0.226924f,0.228997f,0.231083f,0.233180f,0.235289f,0.237409f,
0.239540f,0.241683f,0.243837f,0.246003f,0.248179f,0.250366f,0.252565f,0.254774f,0.256993f,0.259224f,
0.261465f,0.263716f,0.265978f,0.268251f,0.270533f,0.272826f,0.275128f,0.277441f,0.279763f,0.282096f,
0.284438f,0.286789f,0.289151f,0.291521f,0.293901f,0.296290f,0.298689f,0.301096f,0.303513f,0.305938f,
0.308372f,0.310815f,0.313267f,0.315727f,0.318195f,0.320672f,0.323157f,0.325651f,0.328152f,0.330662f,
0.333179f,0.335704f,0.338237f,0.340777f,0.343325f,0.345880f,0.348442f,0.351012f,0.353589f,0.356173f,
0.358764f,0.361361f,0.363966f,0.366577f,0.369194f,0.371818f,0.374448f,0.377085f,0.379727f,0.382376f,
0.385031f,0.387691f,0.390357f,0.393029f,0.395706f,0.398389f,0.401077f,0.403771f,0.406469f,0.409173f,
0.411881f,0.414594f,0.417312f,0.420035f,0.422762f,0.425493f,0.428229f,0.430969f,0.433713f,0.436461f,
0.439213f,0.441969f,0.444729f,0.447492f,0.450258f,0.453028f,0.455802f,0.458578f,0.461358f,0.464140f,
0.466925f,0.469713f,0.472504f,0.475297f,0.478093f,0.480891f,0.483691f,0.486493f,0.489298f,0.492104f,
0.494912f,0.497722f,0.500533f,0.503346f,0.506160f,0.508976f,0.511792f,0.514610f,0.517429f,0.520248f,
0.523069f,0.525890f,0.528711f,0.531533f,0.534355f,0.537178f,0.540000f,0.542822f,0.545645f,0.548467f,
0.551289f,0.554110f,0.556931f,0.559752f,0.562571f,0.565390f,0.568208f,0.571024f,0.573840f,0.576654f,
0.579467f,0.582278f,0.585088f,0.587896f,0.590702f,0.593507f,0.596309f,0.599109f,0.601907f,0.604703f,
0.607496f,0.610287f,0.613075f,0.615860f,0.618642f,0.621422f,0.624198f,0.626972f,0.629742f,0.632508f,
0.635271f,0.638031f,0.640787f,0.643539f,0.646287f,0.649031f,0.651771f,0.654507f,0.657238f,0.659965f,
0.662688f,0.665406f,0.668119f,0.670827f,0.673531f,0.676229f,0.678923f,0.681611f,0.684294f,0.686971f,
0.689643f,0.692309f,0.694969f,0.697624f,0.700273f,0.702915f,0.705552f,0.708182f,0.710806f,0.713423f,
0.716034f,0.718639f,0.721236f,0.723827f,0.726411f,0.728988f,0.731558f,0.734120f,0.736675f,0.739223f,
0.741763f,0.744296f,0.746821f,0.749338f,0.751848f,0.754349f,0.756842f,0.759328f,0.761805f,0.764273f,
0.766733f,0.769185f,0.771628f,0.774062f,0.776487f,0.778904f,0.781311f,0.783710f,0.786099f,0.788479f,
0.790850f,0.793211f,0.795562f,0.797904f,0.800237f,0.802559f,0.804872f,0.807174f,0.809467f,0.811749f,
0.814022f,0.816284f,0.818535f,0.820776f,0.823007f,0.825226f,0.827435f,0.829634f,0.831821f,0.833997f,
0.836163f,0.838317f,0.840460f,0.842591f,0.844711f,0.846820f,0.848917f,0.851003f,0.853076f,0.855138f,
0.857189f,0.859227f,0.861253f,0.863267f,0.865269f,0.867259f,0.869236f,0.871201f,0.873154f,0.875094f,
0.877021f,0.878936f,0.880838f,0.882727f,0.884603f,0.886466f,0.888316f,0.890153f,0.891977f,0.893788f,
0.895585f,0.897369f,0.899139f,0.900896f,0.902639f,0.904369f,0.906085f,0.907787f,0.909475f,0.911150f,
0.912810f,0.914457f,0.916089f,0.917707f,0.919311f,0.920901f,0.922476f,0.924037f,0.925583f,0.927115f,
0.928633f,0.930135f,0.931623f,0.933097f,0.934555f,0.935999f,0.937428f,0.938841f,0.940240f,0.941624f,
0.942992f,0.944346f,0.945684f,0.947007f,0.948314f,0.949606f,0.950883f,0.952145f,0.953390f,0.954620f,
0.955835f,0.957034f,0.958217f,0.959385f,0.960536f,0.961672f,0.962792f,0.963896f,0.964985f,0.966057f,
0.967113f,0.968153f,0.969177f,0.970184f,0.971176f,0.972151f,0.973110f,0.974053f,0.974979f,0.975889f,
0.976783f,0.977660f,0.978521f,0.979365f,0.980193f,0.981004f,0.981798f,0.982576f,0.983337f,0.984081f,
0.984809f,0.985520f,0.986214f,0.986892f,0.987552f,0.988196f,0.988823f,0.989433f,0.990026f,0.990602f,
0.991161f,0.991703f,0.992229f,0.992737f,0.993228f,0.993702f,0.994159f,0.994599f,0.995021f,0.995427f,
0.995815f,0.996186f,0.996541f,0.996877f,0.997197f,0.997500f,0.997785f,0.998053f,0.998304f,0.998537f,
0.998754f,0.998953f,0.999134f,0.999299f,0.999446f,0.999576f,0.999688f,0.999784f,0.999861f,0.999922f,
0.999965f,0.999991f,1.000000f,0.999991f,0.999965f,0.999922f,0.999861f,0.999784f,0.999688f,0.999576f,
0.999446f,0.999299f,0.999134f,0.998953f,0.998754f,0.998537f,0.998304f,0.998053f,0.997785f,0.997500f,
0.997197f,0.996877f,0.996541f,0.996186f,0.995815f,0.995427f,0.995021f,0.994599f,0.994159f,0.993702f,
0.993228f,0.992737f,0.992229f,0.991703f,0.991161f,0.990602f,0.990026f,0.989433f,0.988823f,0.988196f,
0.987552f,0.986892f,0.986214f,0.985520f,0.984809f,0.984081f,0.983337f,0.982576f,0.981798f,0.981004f,
0.980193f,0.979365f,0.978521f,0.977660f,0.976783f,0.975889f,0.974979f,0.974053f,0.973110f,0.972151f,
0.971176f,0.970184f,0.969177f,0.968153f,0.967113f,0.966057f,0.964985f,0.963896f,0.962792f,0.961672f,
0.960536f,0.959385f,0.958217f,0.957034f,0.955835f,0.954620f,0.953390f,0.952145f,0.950883f,0.949606f,
0.948314f,0.947007f,0.945684f,0.944346f,0.942992f,0.941624f,0.940240f,0.938841f,0.937428f,0.935999f,
0.934555f,0.933097f,0.931623f,0.930135f,0.928633f,0.927115f,0.925583f,0.924037f,0.922476f,0.920901f,
0.919311f,0.917707f,0.916089f,0.914457f,0.912810f,0.911150f,0.909475f,0.907787f,0.906085f,0.904369f,
0.902639f,0.900896f,0.899139f,0.897369f,0.895585f,0.893788f,0.891977f,0.890153f,0.888316f,0.886466f,
0.884603f,0.882727f,0.880838f,0.878936f,0.877021f,0.875094f,0.873154f,0.871201f,0.869236f,0.867259f,
0.865269f,0.863267f,0.861253f,0.859227f,0.857189f,0.855138f,0.853076f,0.851003f,0.848917f,0.846820f,
0.844711f,0.842591f,0.840460f,0.838317f,0.836163f,0.833997f,0.831821f,0.829634f,0.827435f,0.825226f,
0.823007f,0.820776f,0.818535f,0.816284f,0.814022f,0.811749f,0.809467f,0.807174f,0.804872f,0.802559f,
0.800237f,0.797904f,0.795562f,0.793211f,0.790850f,0.788479f,0.786099f,0.783710f,0.781311f,0.778904f,
0.776487f,0.774062f,0.771628f,0.769185f,0.766733f,0.764273f,0.761805f,0.759328f,0.756842f,0.754349f,
0.751848f,0.749338f,0.746821f,0.744296f,0.741763f,0.739223f,0.736675f,0.734120f,0.731558f,0.728988f,
0.726411f,0.723827f,0.721236f,0.718639f,0.716034f,0.713423f,0.710806f,0.708182f,0.705552f,0.702915f,
0.700273f,0.697624f,0.694969f,0.692309f,0.689643f,0.686971f,0.684294f,0.681611f,0.678923f,0.676229f,
0.673531f,0.670827f,0.668119f,0.665406f,0.662688f,0.659965f,0.657238f,0.654507f,0.651771f,0.649031f,
0.646287f,0.643539f,0.640787f,0.638031f,0.635271f,0.632508f,0.629742f,0.626972f,0.624198f,0.621422f,
0.618642f,0.615860f,0.613075f,0.610287f,0.607496f,0.604703f,0.601907f,0.599109f,0.596309f,0.593507f,
0.590702f,0.587896f,0.585088f,0.582278f,0.579467f,0.576654f,0.573840f,0.571024f,0.568208f,0.565390f,
0.562571f,0.559752f,0.556931f,0.554110f,0.551289f,0.548467f,0.545645f,0.542822f,0.540000f,0.537178f,
0.534355f,0.531533f,0.528711f,0.525890f,0.523069f,0.520248f,0.517429f,0.514610f,0.511792f,0.508976f,
0.506160f,0.503346f,0.500533f,0.497722f,0.494912f,0.492104f,0.489298f,0.486493f,0.483691f,0.480891f,
0.478093f,0.475297f,0.472504f,0.469713f,0.466925f,0.464140f,0.461358f,0.458578f,0.455802f,0.453028f,
0.450258f,0.447492f,0.444729f,0.441969f,0.439213f,0.436461f,0.433713f,0.430969f,0.428229f,0.425493f,
0.422762f,0.420035f,0.417312f,0.414594f,0.411881f,0.409173f,0.406469f,0.403771f,0.401077f,0.398389f,
0.395706f,0.393029f,0.390357f,0.387691f,0.385031f,0.382376f,0.379727f,0.377085f,0.374448f,0.371818f,
0.369194f,0.366577f,0.363966f,0.361361f,0.358764f,0.356173f,0.353589f,0.351012f,0.348442f,0.345880f,
0.343325f,0.340777f,0.338237f,0.335704f,0.333179f,0.330662f,0.328152f,0.325651f,0.323157f,0.320672f,
0.318195f,0.315727f,0.313267f,0.310815f,0.308372f,0.305938f,0.303513f,0.301096f,0.298689f,0.296290f,
0.293901f,0.291521f,0.289151f,0.286789f,0.284438f,0.282096f,0.279763f,0.277441f,0.275128f,0.272826f,
0.270533f,0.268251f,0.265978f,0.263716f,0.261465f,0.259224f,0.256993f,0.254774f,0.252565f,0.250366f,
0.248179f,0.246003f,0.243837f,0.241683f,0.239540f,0.237409f,0.235289f,0.233180f,0.231083f,0.228997f,
0.226924f,0.224862f,0.222811f,0.220773f,0.218747f,0.216733f,0.214731f,0.212741f,0.210764f,0.208799f,
0.206846f,0.204906f,0.202979f,0.201064f,0.199162f,0.197273f,0.195397f,0.193534f,0.191684f,0.189847f,
0.188023f,0.186212f,0.184415f,0.182631f,0.180861f,0.179104f,0.177361f,0.175631f,0.173915f,0.172213f,
0.170525f,0.168850f,0.167190f,0.165543f,0.163911f,0.162293f,0.160689f,0.159099f,0.157524f,0.155963f,
0.154417f,0.152885f,0.151367f,0.149865f,0.148377f,0.146903f,0.145445f,0.144001f,0.142572f,0.141159f,
0.139760f,0.138376f,0.137008f,0.135654f,0.134316f,0.132993f,0.131686f,0.130394f,0.129117f,0.127856f,
0.126610f,0.125380f,0.124165f,0.122966f,0.121783f,0.120615f,0.119464f,0.118328f,0.117208f,0.116104f,
0.115015f,0.113943f,0.112887f,0.111847f,0.110823f,0.109816f,0.108824f,0.107849f,0.106890f,0.105947f,
0.105021f,0.104111f,0.103217f,0.102340f,0.101479f,0.100635f,0.099807f,0.098996f,0.098202f,0.097424f,
0.096663f,0.095919f,0.095191f,0.094480f,0.093786f,0.093108f,0.092448f,0.091804f,0.091177f,0.090567f,
0.089974f,0.089398f,0.088839f,0.088297f,0.087771f,0.087263f,0.086772f,0.086298f,0.085841f,0.085402f,
0.084979f,0.084573f,0.084185f,0.083814f,0.083459f,0.083123f,0.082803f,0.082500f,0.082215f,0.081947f,
0.081696f,0.081463f,0.081246f,0.081047f,0.080866f,0.080701f,0.080554f,0.080424f,0.080312f,0.080216f,
0.080139f,0.080078f,0.080035f,0.080009f,};
const q31_t mfcc_window_coefs_config1_q31[NB_MFCC_WIN_COEFS_CONFIG1_Q31]={
0x0A3D70A4,0x0A3DB948,0x0A3E9333,0x0A3FFE62,0x0A41FAD4,0x0A448881,0x0A47A765,0x0A4B5778,0x0A4F98AF,0x0A546B02,
0x0A59CE64,0x0A5FC2C7,0x0A66481E,0x0A6D5E57,0x0A750562,0x0A7D3D2C,0x0A86059F,0x0A8F5EA8,0x0A99482E,0x0AA3C219,
0x0AAECC4F,0x0ABA66B5,0x0AC6912F,0x0AD34B9E,0x0AE095E3,0x0AEE6FDD,0x0AFCD96A,0x0B0BD267,0x0B1B5AAE,0x0B2B7219,
0x0B3C1881,0x0B4D4DBC,0x0B5F11A0,0x0B716401,0x0B8444B2,0x0B97B384,0x0BABB048,0x0BC03ACC,0x0BD552DD,0x0BEAF847,
0x0C012AD5,0x0C17EA50,0x0C2F3681,0x0C470F2C,0x0C5F7419,0x0C78650A,0x0C91E1C2,0x0CABEA02,0x0CC67D89,0x0CE19C17,
0x0CFD4569,0x0D197939,0x0D363743,0x0D537F3F,0x0D7150E6,0x0D8FABEE,0x0DAE900B,0x0DCDFCF2,0x0DEDF256,0x0E0E6FE6,
0x0E2F7553,0x0E51024D,0x0E73167E,0x0E95B195,0x0EB8D33B,0x0EDC7B1A,0x0F00A8D9,0x0F255C20,0x0F4A9493,0x0F7051D8,
0x0F969391,0x0FBD595F,0x0FE4A2E2,0x100C6FBB,0x1034BF87,0x105D91E1,0x1086E667,0x10B0BCB1,0x10DB1458,0x1105ECF4,
0x1131461B,0x115D1F62,0x1189785D,0x11B6509F,0x11E3A7B8,0x12117D3A,0x123FD0B3,0x126EA1B0,0x129DEFBE,0x12CDBA69,
0x12FE013A,0x132EC3BB,0x13600172,0x1391B9E8,0x13C3ECA0,0x13F6991F,0x1429BEE8,0x145D5D7C,0x1491745E,0x14C6030B,
0x14FB0902,0x153085C1,0x156678C3,0x159CE183,0x15D3BF7C,0x160B1225,0x1642D8F6,0x167B1366,0x16B3C0E9,0x16ECE0F5,
0x172672FB,0x1760766F,0x179AEAC0,0x17D5CF5F,0x181123BA,0x184CE73F,0x1889195B,0x18C5B978,0x1902C702,0x19404161,
0x197E27FE,0x19BC7A41,0x19FB378F,0x1A3A5F4D,0x1A79F0E1,0x1AB9EBAC,0x1AFA4F12,0x1B3B1A73,0x1B7C4D2F,0x1BBDE6A6,
0x1BFFE635,0x1C424B3A,0x1C851511,0x1CC84316,0x1D0BD4A2,0x1D4FC90E,0x1D941FB4,0x1DD8D7EA,0x1E1DF107,0x1E636A60,
0x1EA9434A,0x1EEF7B19,0x1F36111F,0x1F7D04AF,0x1FC45518,0x200C01AC,0x205409B9,0x209C6C8D,0x20E52977,0x212E3FC2,
0x2177AEBA,0x21C175AB,0x220B93DD,0x2256089A,0x22A0D32B,0x22EBF2D6,0x233766E3,0x23832E97,0x23CF4938,0x241BB609,
0x2468744E,0x24B5834A,0x2502E23E,0x2550906C,0x259E8D13,0x25ECD774,0x263B6ECE,0x268A525E,0x26D98161,0x2728FB15,
0x2778BEB5,0x27C8CB7D,0x281920A6,0x2869BD6C,0x28BAA106,0x290BCAAD,0x295D3999,0x29AEED02,0x2A00E41C,0x2A531E1F,
0x2AA59A40,0x2AF857B2,0x2B4B55AA,0x2B9E935B,0x2BF20FF7,0x2C45CAB1,0x2C99C2B9,0x2CEDF742,0x2D42677A,0x2D971292,
0x2DEBF7B9,0x2E41161D,0x2E966CEC,0x2EEBFB54,0x2F41C081,0x2F97BBA0,0x2FEDEBDD,0x30445063,0x309AE85D,0x30F1B2F6,
0x3148AF56,0x319FDCA8,0x31F73A15,0x324EC6C4,0x32A681DE,0x32FE6A8B,0x33567FF1,0x33AEC137,0x34072D83,0x345FC3FC,
0x34B883C6,0x35116C07,0x356A7BE3,0x35C3B27E,0x361D0EFD,0x36769083,0x36D03633,0x3729FF30,0x3783EA9C,0x37DDF799,
0x3838254A,0x389272CF,0x38ECDF4B,0x394769DD,0x39A211A7,0x39FCD5C8,0x3A57B561,0x3AB2AF92,0x3B0DC37A,0x3B68F038,
0x3BC434EC,0x3C1F90B4,0x3C7B02AE,0x3CD689FA,0x3D3225B5,0x3D8DD4FE,0x3DE996F1,0x3E456AAD,0x3EA14F50,0x3EFD43F5,
0x3F5947BB,0x3FB559BF,0x4011791C,0x406DA4F1,0x40C9DC59,0x41261E71,0x41826A56,0x41DEBF23,0x423B1BF5,0x42977FE8,
0x42F3EA18,0x435059A0,0x43ACCD9E,0x4409452C,0x4465BF67,0x44C23B6A,0x451EB852,0x457B3539,0x45D7B13D,0x46342B78,
0x4690A306,0x46ED1704,0x4749868C,0x47A5F0BC,0x480254AF,0x485EB181,0x48BB064E,0x49175233,0x4973944B,0x49CFCBB3,
0x4A2BF788,0x4A8816E5,0x4AE428E9,0x4B402CAF,0x4B9C2154,0x4BF805F7,0x4C53D9B3,0x4CAF9BA6,0x4D0B4AEF,0x4D66E6AA,
0x4DC26DF5,0x4E1DDFF0,0x4E793BB8,0x4ED4806C,0x4F2FAD2A,0x4F8AC112,0x4FE5BB42,0x50409ADC,0x509B5EFD,0x50F606C7,
0x51509159,0x51AAFDD4,0x52054B5A,0x525F790B,0x52B98608,0x53137174,0x536D3A71,0x53C6E021,0x542061A7,0x5479BE26,
0x54D2F4C1,0x552C049D,0x5584ECDE,0x55DDACA8,0x56364321,0x568EAF6D,0x56E6F0B3,0x573F0619,0x5796EEC6,0x57EEA9E0,
0x5846368F,0x589D93FC,0x58F4C14E,0x594BBDAE,0x59A28846,0x59F92041,0x5A4F84C7,0x5AA5B504,0x5AFBB023,0x5B517550,
0x5BA703B8,0x5BFC5A87,0x5C5178EB,0x5CA65E12,0x5CFB092A,0x5D4F7962,0x5DA3ADEB,0x5DF7A5F3,0x5E4B60AD,0x5E9EDD49,
0x5EF21AFA,0x5F4518F2,0x5F97D664,0x5FEA5284,0x603C8C87,0x608E83A2,0x60E0370B,0x6131A5F7,0x6182CF9E,0x61D3B338,
0x62244FFE,0x6274A527,0x62C4B1EF,0x6314758F,0x6363EF43,0x63B31E46,0x640201D6,0x6450992F,0x649EE391,0x64ECE038,
0x653A8E66,0x6587ED5A,0x65D4FC56,0x6621BA9B,0x666E276C,0x66BA420C,0x670609C1,0x67517DCE,0x679C9D79,0x67E7680A,
0x6831DCC7,0x687BFAF9,0x68C5C1EA,0x690F30E2,0x6958472D,0x69A10417,0x69E966EB,0x6A316EF8,0x6A791B8C,0x6AC06BF5,
0x6B075F85,0x6B4DF58B,0x6B942D5A,0x6BDA0644,0x6C1F7F9D,0x6C6498BA,0x6CA950F0,0x6CEDA796,0x6D319C02,0x6D752D8E,
0x6DB85B92,0x6DFB256A,0x6E3D8A6F,0x6E7F89FE,0x6EC12375,0x6F025631,0x6F432192,0x6F8384F8,0x6FC37FC3,0x70031157,
0x70423915,0x7080F663,0x70BF48A6,0x70FD2F43,0x713AA9A2,0x7177B72C,0x71B45749,0x71F08965,0x722C4CEA,0x7267A145,
0x72A285E4,0x72DCFA35,0x7316FDA9,0x73508FAF,0x7389AFBB,0x73C25D3E,0x73FA97AE,0x74325E7F,0x7469B128,0x74A08F21,
0x74D6F7E1,0x750CEAE3,0x754267A2,0x75776D99,0x75ABFC46,0x75E01327,0x7613B1BC,0x7646D785,0x76798404,0x76ABB6BC,
0x76DD6F31,0x770EACE9,0x773F6F6A,0x776FB63B,0x779F80E6,0x77CECEF4,0x77FD9FF1,0x782BF36A,0x7859C8EB,0x78872005,
0x78B3F847,0x78E05142,0x790C2A89,0x793783B0,0x79625C4C,0x798CB3F3,0x79B68A3D,0x79DFDEC2,0x7A08B11D,0x7A3100E9,
0x7A58CDC1,0x7A801745,0x7AA6DD13,0x7ACD1ECC,0x7AF2DC10,0x7B181484,0x7B3CC7CB,0x7B60F58A,0x7B849D69,0x7BA7BF0F,
0x7BCA5A25,0x7BEC6E57,0x7C0DFB50,0x7C2F00BE,0x7C4F7E4E,0x7C6F73B1,0x7C8EE098,0x7CADC4B6,0x7CCC1FBE,0x7CE9F164,
0x7D073961,0x7D23F76B,0x7D402B3B,0x7D5BD48D,0x7D76F31B,0x7D9186A2,0x7DAB8EE2,0x7DC50B9A,0x7DDDFC8B,0x7DF66178,
0x7E0E3A23,0x7E258654,0x7E3C45CF,0x7E52785D,0x7E681DC7,0x7E7D35D8,0x7E91C05C,0x7EA5BD20,0x7EB92BF2,0x7ECC0CA3,
0x7EDE5F04,0x7EF022E8,0x7F015823,0x7F11FE8B,0x7F2215F6,0x7F319E3D,0x7F409739,0x7F4F00C7,0x7F5CDAC1,0x7F6A2506,
0x7F76DF75,0x7F8309EF,0x7F8EA455,0x7F99AE8B,0x7FA42876,0x7FAE11FC,0x7FB76B04,0x7FC03378,0x7FC86B42,0x7FD0124D,
0x7FD72886,0x7FDDADDD,0x7FE3A240,0x7FE905A2,0x7FEDD7F4,0x7FF2192C,0x7FF5C93F,0x7FF8E823,0x7FFB75D0,0x7FFD7242,
0x7FFEDD71,0x7FFFB75C,0x7FFFFFFF,0x7FFFB75C,0x7FFEDD71,0x7FFD7242,0x7FFB75D0,0x7FF8E823,0x7FF5C93F,0x7FF2192C,
0x7FEDD7F4,0x7FE905A2,0x7FE3A240,0x7FDDADDD,0x7FD72886,0x7FD0124D,0x7FC86B42,0x7FC03378,0x7FB76B04,0x7FAE11FC,
0x7FA42876,0x7F99AE8B,0x7F8EA455,0x7F8309EF,0x7F76DF75,0x7F6A2506,0x7F5CDAC1,0x7F4F00C7,0x7F409739,0x7F319E3D,
0x7F2215F6,0x7F11FE8B,0x7F015823,0x7EF022E8,0x7EDE5F04,0x7ECC0CA3,0x7EB92BF2,0x7EA5BD20,0x7E91C05C,0x7E7D35D8,
0x7E681DC7,0x7E52785D,0x7E3C45CF,0x7E258654,0x7E0E3A23,0x7DF66178,0x7DDDFC8B,0x7DC50B9A,0x7DAB8EE2,0x7D9186A2,
0x7D76F31B,0x7D5BD48D,0x7D402B3B,0x7D23F76B,0x7D073961,0x7CE9F164,0x7CCC1FBE,0x7CADC4B6,0x7C8EE098,0x7C6F73B1,
0x7C4F7E4E,0x7C2F00BE,0x7C0DFB50,0x7BEC6E57,0x7BCA5A25,0x7BA7BF0F,0x7B849D69,0x7B60F58A,0x7B3CC7CB,0x7B181484,
0x7AF2DC10,0x7ACD1ECC,0x7AA6DD13,0x7A801745,0x7A58CDC1,0x7A3100E9,0x7A08B11D,0x79DFDEC2,0x79B68A3D,0x798CB3F3,
0x79625C4C,0x793783B0,0x790C2A89,0x78E05142,0x78B3F847,0x78872005,0x7859C8EB,0x782BF36A,0x77FD9FF1,0x77CECEF4,
0x779F80E6,0x776FB63B,0x773F6F6A,0x770EACE9,0x76DD6F31,0x76ABB6BC,0x76798404,0x7646D785,0x7613B1BC,0x75E01327,
0x75ABFC46,0x75776D99,0x754267A2,0x750CEAE3,0x74D6F7E1,0x74A08F21,0x7469B128,0x74325E7F,0x73FA97AE,0x73C25D3E,
0x7389AFBB,0x73508FAF,0x7316FDA9,0x72DCFA35,0x72A285E4,0x7267A145,0x722C4CEA,0x71F08965,0x71B45749,0x7177B72C,
0x713AA9A2,0x70FD2F43,0x70BF48A6,0x7080F663,0x70423915,0x70031157,0x6FC37FC3,0x6F8384F8,0x6F432192,0x6F025631,
0x6EC12375,0x6E7F89FE,0x6E3D8A6F,0x6DFB256A,0x6DB85B92,0x6D752D8E,0x6D319C02,0x6CEDA796,0x6CA950F0,0x6C6498BA,
0x6C1F7F9D,0x6BDA0644,0x6B942D5A,0x6B4DF58B,0x6B075F85,0x6AC06BF5,0x6A791B8C,0x6A316EF8,0x69E966EB,0x69A10417,
0x6958472D,0x690F30E2,0x68C5C1EA,0x687BFAF9,0x6831DCC7,0x67E7680A,0x679C9D79,0x67517DCE,0x670609C1,0x66BA420C,
0x666E276C,0x6621BA9B,0x65D4FC56,0x6587ED5A,0x653A8E66,0x64ECE038,0x649EE391,0x6450992F,0x640201D6,0x63B31E46,
0x6363EF43,0x6314758F,0x62C4B1EF,0x6274A527,0x62244FFE,0x61D3B338,0x6182CF9E,0x6131A5F7,0x60E0370B,0x608E83A2,
0x603C8C87,0x5FEA5284,0x5F97D664,0x5F4518F2,0x5EF21AFA,0x5E9EDD49,0x5E4B60AD,0x5DF7A5F3,0x5DA3ADEB,0x5D4F7962,
0x5CFB092A,0x5CA65E12,0x5C5178EB,0x5BFC5A87,0x5BA703B8,0x5B517550,0x5AFBB023,0x5AA5B504,0x5A4F84C7,0x59F92041,
0x59A28846,0x594BBDAE,0x58F4C14E,0x589D93FC,0x5846368F,0x57EEA9E0,0x5796EEC6,0x573F0619,0x56E6F0B3,0x568EAF6D,
0x56364321,0x55DDACA8,0x5584ECDE,0x552C049D,0x54D2F4C1,0x5479BE26,0x542061A7,0x53C6E021,0x536D3A71,0x53137174,
0x52B98608,0x525F790B,0x52054B5A,0x51AAFDD4,0x51509159,0x50F606C7,0x509B5EFD,0x50409ADC,0x4FE5BB42,0x4F8AC112,
0x4F2FAD2A,0x4ED4806C,0x4E793BB8,0x4E1DDFF0,0x4DC26DF5,0x4D66E6AA,0x4D0B4AEF,0x4CAF9BA6,0x4C53D9B3,0x4BF805F7,
0x4B9C2154,0x4B402CAF,0x4AE428E9,0x4A8816E5,0x4A2BF788,0x49CFCBB3,0x4973944B,0x49175233,0x48BB064E,0x485EB181,
0x480254AF,0x47A5F0BC,0x4749868C,0x46ED1704,0x4690A306,0x46342B78,0x45D7B13D,0x457B3539,0x451EB852,0x44C23B6A,
0x4465BF67,0x4409452C,0x43ACCD9E,0x435059A0,0x42F3EA18,0x42977FE8,0x423B1BF5,0x41DEBF23,0x41826A56,0x41261E71,
0x40C9DC59,0x406DA4F1,0x4011791C,0x3FB559BF,0x3F5947BB,0x3EFD43F5,0x3EA14F50,0x3E456AAD,0x3DE996F1,0x3D8DD4FE,
0x3D3225B5,0x3CD689FA,0x3C7B02AE,0x3C1F90B4,0x3BC434EC,0x3B68F038,0x3B0DC37A,0x3AB2AF92,0x3A57B561,0x39FCD5C8,
0x39A211A7,0x394769DD,0x38ECDF4B,0x389272CF,0x3838254A,0x37DDF799,0x3783EA9C,0x3729FF30,0x36D03633,0x36769083,
0x361D0EFD,0x35C3B27E,0x356A7BE3,0x35116C07,0x34B883C6,0x345FC3FC,0x34072D83,0x33AEC137,0x33567FF1,0x32FE6A8B,
0x32A681DE,0x324EC6C4,0x31F73A15,0x319FDCA8,0x3148AF56,0x30F1B2F6,0x309AE85D,0x30445063,0x2FEDEBDD,0x2F97BBA0,
0x2F41C081,0x2EEBFB54,0x2E966CEC,0x2E41161D,0x2DEBF7B9,0x2D971292,0x2D42677A,0x2CEDF742,0x2C99C2B9,0x2C45CAB1,
0x2BF20FF7,0x2B9E935B,0x2B4B55AA,0x2AF857B2,0x2AA59A40,0x2A531E1F,0x2A00E41C,0x29AEED02,0x295D3999,0x290BCAAD,
0x28BAA106,0x2869BD6C,0x281920A6,0x27C8CB7D,0x2778BEB5,0x2728FB15,0x26D98161,0x268A525E,0x263B6ECE,0x25ECD774,
0x259E8D13,0x2550906C,0x2502E23E,0x24B5834A,0x2468744E,0x241BB609,0x23CF4938,0x23832E97,0x233766E3,0x22EBF2D6,
0x22A0D32B,0x2256089A,0x220B93DD,0x21C175AB,0x2177AEBA,0x212E3FC2,0x20E52977,0x209C6C8D,0x205409B9,0x200C01AC,
0x1FC45518,0x1F7D04AF,0x1F36111F,0x1EEF7B19,0x1EA9434A,0x1E636A60,0x1E1DF107,0x1DD8D7EA,0x1D941FB4,0x1D4FC90E,
0x1D0BD4A2,0x1CC84316,0x1C851511,0x1C424B3A,0x1BFFE635,0x1BBDE6A6,0x1B7C4D2F,0x1B3B1A73,0x1AFA4F12,0x1AB9EBAC,
0x1A79F0E1,0x1A3A5F4D,0x19FB378F,0x19BC7A41,0x197E27FE,0x19404161,0x1902C702,0x18C5B978,0x1889195B,0x184CE73F,
0x181123BA,0x17D5CF5F,0x179AEAC0,0x1760766F,0x172672FB,0x16ECE0F5,0x16B3C0E9,0x167B1366,0x1642D8F6,0x160B1225,
0x15D3BF7C,0x159CE183,0x156678C3,0x153085C1,0x14FB0902,0x14C6030B,0x1491745E,0x145D5D7C,0x1429BEE8,0x13F6991F,
0x13C3ECA0,0x1391B9E8,0x13600172,0x132EC3BB,0x12FE013A,0x12CDBA69,0x129DEFBE,0x126EA1B0,0x123FD0B3,0x12117D3A,
0x11E3A7B8,0x11B6509F,0x1189785D,0x115D1F62,0x1131461B,0x1105ECF4,0x10DB1458,0x10B0BCB1,0x1086E667,0x105D91E1,
0x1034BF87,0x100C6FBB,0x0FE4A2E2,0x0FBD595F,0x0F969391,0x0F7051D8,0x0F4A9493,0x0F255C20,0x0F00A8D9,0x0EDC7B1A,
0x0EB8D33B,0x0E95B195,0x0E73167E,0x0E51024D,0x0E2F7553,0x0E0E6FE6,0x0DEDF256,0x0DCDFCF2,0x0DAE900B,0x0D8FABEE,
0x0D7150E6,0x0D537F3F,0x0D363743,0x0D197939,0x0CFD4569,0x0CE19C17,0x0CC67D89,0x0CABEA02,0x0C91E1C2,0x0C78650A,
0x0C5F7419,0x0C470F2C,0x0C2F3681,0x0C17EA50,0x0C012AD5,0x0BEAF847,0x0BD552DD,0x0BC03ACC,0x0BABB048,0x0B97B384,
0x0B8444B2,0x0B716401,0x0B5F11A0,0x0B4D4DBC,0x0B3C1881,0x0B2B7219,0x0B1B5AAE,0x0B0BD267,0x0AFCD96A,0x0AEE6FDD,
0x0AE095E3,0x0AD34B9E,0x0AC6912F,0x0ABA66B5,0x0AAECC4F,0x0AA3C219,0x0A99482E,0x0A8F5EA8,0x0A86059F,0x0A7D3D2C,
0x0A750562,0x0A6D5E57,0x0A66481E,0x0A5FC2C7,0x0A59CE64,0x0A546B02,0x0A4F98AF,0x0A4B5778,0x0A47A765,0x0A448881,
0x0A41FAD4,0x0A3FFE62,0x0A3E9333,0x0A3DB948,};
const q15_t mfcc_window_coefs_config1_q15[NB_MFCC_WIN_COEFS_CONFIG1_Q15]={
0x0A3D,0x0A3E,0x0A3F,0x0A40,0x0A42,0x0A45,0x0A48,0x0A4B,0x0A50,0x0A54,
0x0A5A,0x0A60,0x0A66,0x0A6D,0x0A75,0x0A7D,0x0A86,0x0A8F,0x0A99,0x0AA4,
0x0AAF,0x0ABA,0x0AC7,0x0AD3,0x0AE1,0x0AEE,0x0AFD,0x0B0C,0x0B1B,0x0B2B,
0x0B3C,0x0B4D,0x0B5F,0x0B71,0x0B84,0x0B98,0x0BAC,0x0BC0,0x0BD5,0x0BEB,
0x0C01,0x0C18,0x0C2F,0x0C47,0x0C5F,0x0C78,0x0C92,0x0CAC,0x0CC6,0x0CE2,
0x0CFD,0x0D19,0x0D36,0x0D53,0x0D71,0x0D90,0x0DAF,0x0DCE,0x0DEE,0x0E0E,
0x0E2F,0x0E51,0x0E73,0x0E96,0x0EB9,0x0EDC,0x0F01,0x0F25,0x0F4B,0x0F70,
0x0F97,0x0FBD,0x0FE5,0x100C,0x1035,0x105E,0x1087,0x10B1,0x10DB,0x1106,
0x1131,0x115D,0x1189,0x11B6,0x11E4,0x1211,0x1240,0x126F,0x129E,0x12CE,
0x12FE,0x132F,0x1360,0x1392,0x13C4,0x13F7,0x142A,0x145D,0x1491,0x14C6,
0x14FB,0x1531,0x1566,0x159D,0x15D4,0x160B,0x1643,0x167B,0x16B4,0x16ED,
0x1726,0x1760,0x179B,0x17D6,0x1811,0x184D,0x1889,0x18C6,0x1903,0x1940,
0x197E,0x19BC,0x19FB,0x1A3A,0x1A7A,0x1ABA,0x1AFA,0x1B3B,0x1B7C,0x1BBE,
0x1C00,0x1C42,0x1C85,0x1CC8,0x1D0C,0x1D50,0x1D94,0x1DD9,0x1E1E,0x1E63,
0x1EA9,0x1EEF,0x1F36,0x1F7D,0x1FC4,0x200C,0x2054,0x209C,0x20E5,0x212E,
0x2178,0x21C1,0x220C,0x2256,0x22A1,0x22EC,0x2337,0x2383,0x23CF,0x241C,
0x2468,0x24B6,0x2503,0x2551,0x259F,0x25ED,0x263B,0x268A,0x26DA,0x2729,
0x2779,0x27C9,0x2819,0x286A,0x28BB,0x290C,0x295D,0x29AF,0x2A01,0x2A53,
0x2AA6,0x2AF8,0x2B4B,0x2B9F,0x2BF2,0x2C46,0x2C9A,0x2CEE,0x2D42,0x2D97,
0x2DEC,0x2E41,0x2E96,0x2EEC,0x2F42,0x2F98,0x2FEE,0x3044,0x309B,0x30F2,
0x3149,0x31A0,0x31F7,0x324F,0x32A7,0x32FE,0x3356,0x33AF,0x3407,0x3460,
0x34B9,0x3511,0x356A,0x35C4,0x361D,0x3677,0x36D0,0x372A,0x3784,0x37DE,
0x3838,0x3892,0x38ED,0x3947,0x39A2,0x39FD,0x3A58,0x3AB3,0x3B0E,0x3B69,
0x3BC4,0x3C20,0x3C7B,0x3CD7,0x3D32,0x3D8E,0x3DEA,0x3E45,0x3EA1,0x3EFD,
0x3F59,0x3FB5,0x4011,0x406E,0x40CA,0x4126,0x4182,0x41DF,0x423B,0x4297,
0x42F4,0x4350,0x43AD,0x4409,0x4466,0x44C2,0x451F,0x457B,0x45D8,0x4634,
0x4691,0x46ED,0x474A,0x47A6,0x4802,0x485F,0x48BB,0x4917,0x4974,0x49D0,
0x4A2C,0x4A88,0x4AE4,0x4B40,0x4B9C,0x4BF8,0x4C54,0x4CB0,0x4D0B,0x4D67,
0x4DC2,0x4E1E,0x4E79,0x4ED5,0x4F30,0x4F8B,0x4FE6,0x5041,0x509B,0x50F6,
0x5151,0x51AB,0x5205,0x525F,0x52BA,0x5313,0x536D,0x53C7,0x5420,0x547A,
0x54D3,0x552C,0x5585,0x55DE,0x5636,0x568F,0x56E7,0x573F,0x5797,0x57EF,
0x5846,0x589E,0x58F5,0x594C,0x59A3,0x59F9,0x5A50,0x5AA6,0x5AFC,0x5B51,
0x5BA7,0x5BFC,0x5C51,0x5CA6,0x5CFB,0x5D4F,0x5DA4,0x5DF8,0x5E4B,0x5E9F,
0x5EF2,0x5F45,0x5F98,0x5FEA,0x603D,0x608F,0x60E0,0x6132,0x6183,0x61D4,
0x6224,0x6275,0x62C5,0x6314,0x6364,0x63B3,0x6402,0x6451,0x649F,0x64ED,
0x653B,0x6588,0x65D5,0x6622,0x666E,0x66BA,0x6706,0x6751,0x679D,0x67E7,
0x6832,0x687C,0x68C6,0x690F,0x6958,0x69A1,0x69E9,0x6A31,0x6A79,0x6AC0,
0x6B07,0x6B4E,0x6B94,0x6BDA,0x6C1F,0x6C65,0x6CA9,0x6CEE,0x6D32,0x6D75,
0x6DB8,0x6DFB,0x6E3E,0x6E80,0x6EC1,0x6F02,0x6F43,0x6F84,0x6FC3,0x7003,
0x7042,0x7081,0x70BF,0x70FD,0x713B,0x7178,0x71B4,0x71F1,0x722C,0x7268,
0x72A3,0x72DD,0x7317,0x7351,0x738A,0x73C2,0x73FB,0x7432,0x746A,0x74A1,
0x74D7,0x750D,0x7542,0x7577,0x75AC,0x75E0,0x7614,0x7647,0x767A,0x76AC,
0x76DD,0x770F,0x773F,0x7770,0x77A0,0x77CF,0x77FE,0x782C,0x785A,0x7887,
0x78B4,0x78E0,0x790C,0x7938,0x7962,0x798D,0x79B7,0x79E0,0x7A09,0x7A31,
0x7A59,0x7A80,0x7AA7,0x7ACD,0x7AF3,0x7B18,0x7B3D,0x7B61,0x7B85,0x7BA8,
0x7BCA,0x7BEC,0x7C0E,0x7C2F,0x7C4F,0x7C6F,0x7C8F,0x7CAE,0x7CCC,0x7CEA,
0x7D07,0x7D24,0x7D40,0x7D5C,0x7D77,0x7D92,0x7DAC,0x7DC5,0x7DDE,0x7DF6,
0x7E0E,0x7E26,0x7E3C,0x7E52,0x7E68,0x7E7D,0x7E92,0x7EA6,0x7EB9,0x7ECC,
0x7EDE,0x7EF0,0x7F01,0x7F12,0x7F22,0x7F32,0x7F41,0x7F4F,0x7F5D,0x7F6A,
0x7F77,0x7F83,0x7F8F,0x7F9A,0x7FA4,0x7FAE,0x7FB7,0x7FC0,0x7FC8,0x7FD0,
0x7FD7,0x7FDE,0x7FE4,0x7FE9,0x7FEE,0x7FF2,0x7FF6,0x7FF9,0x7FFB,0x7FFD,
0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFF,0x7FFD,0x7FFB,0x7FF9,0x7FF6,0x7FF2,
0x7FEE,0x7FE9,0x7FE4,0x7FDE,0x7FD7,0x7FD0,0x7FC8,0x7FC0,0x7FB7,0x7FAE,
0x7FA4,0x7F9A,0x7F8F,0x7F83,0x7F77,0x7F6A,0x7F5D,0x7F4F,0x7F41,0x7F32,
0x7F22,0x7F12,0x7F01,0x7EF0,0x7EDE,0x7ECC,0x7EB9,0x7EA6,0x7E92,0x7E7D,
0x7E68,0x7E52,0x7E3C,0x7E26,0x7E0E,0x7DF6,0x7DDE,0x7DC5,0x7DAC,0x7D92,
0x7D77,0x7D5C,0x7D40,0x7D24,0x7D07,0x7CEA,0x7CCC,0x7CAE,0x7C8F,0x7C6F,
0x7C4F,0x7C2F,0x7C0E,0x7BEC,0x7BCA,0x7BA8,0x7B85,0x7B61,0x7B3D,0x7B18,
0x7AF3,0x7ACD,0x7AA7,0x7A80,0x7A59,0x7A31,0x7A09,0x79E0,0x79B7,0x798D,
0x7962,0x7938,0x790C,0x78E0,0x78B4,0x7887,0x785A,0x782C,0x77FE,0x77CF,
0x77A0,0x7770,0x773F,0x770F,0x76DD,0x76AC,0x767A,0x7647,0x7614,0x75E0,
0x75AC,0x7577,0x7542,0x750D,0x74D7,0x74A1,0x746A,0x7432,0x73FB,0x73C2,
0x738A,0x7351,0x7317,0x72DD,0x72A3,0x7268,0x722C,0x71F1,0x71B4,0x7178,
0x713B,0x70FD,0x70BF,0x7081,0x7042,0x7003,0x6FC3,0x6F84,0x6F43,0x6F02,
0x6EC1,0x6E80,0x6E3E,0x6DFB,0x6DB8,0x6D75,0x6D32,0x6CEE,0x6CA9,0x6C65,
0x6C1F,0x6BDA,0x6B94,0x6B4E,0x6B07,0x6AC0,0x6A79,0x6A31,0x69E9,0x69A1,
0x6958,0x690F,0x68C6,0x687C,0x6832,0x67E7,0x679D,0x6751,0x6706,0x66BA,
0x666E,0x6622,0x65D5,0x6588,0x653B,0x64ED,0x649F,0x6451,0x6402,0x63B3,
0x6364,0x6314,0x62C5,0x6275,0x6224,0x61D4,0x6183,0x6132,0x60E0,0x608F,
0x603D,0x5FEA,0x5F98,0x5F45,0x5EF2,0x5E9F,0x5E4B,0x5DF8,0x5DA4,0x5D4F,
0x5CFB,0x5CA6,0x5C51,0x5BFC,0x5BA7,0x5B51,0x5AFC,0x5AA6,0x5A50,0x59F9,
0x59A3,0x594C,0x58F5,0x589E,0x5846,0x57EF,0x5797,0x573F,0x56E7,0x568F,
0x5636,0x55DE,0x5585,0x552C,0x54D3,0x547A,0x5420,0x53C7,0x536D,0x5313,
0x52BA,0x525F,0x5205,0x51AB,0x5151,0x50F6,0x509B,0x5041,0x4FE6,0x4F8B,
0x4F30,0x4ED5,0x4E79,0x4E1E,0x4DC2,0x4D67,0x4D0B,0x4CB0,0x4C54,0x4BF8,
0x4B9C,0x4B40,0x4AE4,0x4A88,0x4A2C,0x49D0,0x4974,0x4917,0x48BB,0x485F,
0x4802,0x47A6,0x474A,0x46ED,0x4691,0x4634,0x45D8,0x457B,0x451F,0x44C2,
0x4466,0x4409,0x43AD,0x4350,0x42F4,0x4297,0x423B,0x41DF,0x4182,0x4126,
0x40CA,0x406E,0x4011,0x3FB5,0x3F59,0x3EFD,0x3EA1,0x3E45,0x3DEA,0x3D8E,
0x3D32,0x3CD7,0x3C7B,0x3C20,0x3BC4,0x3B69,0x3B0E,0x3AB3,0x3A58,0x39FD,
0x39A2,0x3947,0x38ED,0x3892,0x3838,0x37DE,0x3784,0x372A,0x36D0,0x3677,
0x361D,0x35C4,0x356A,0x3511,0x34B9,0x3460,0x3407,0x33AF,0x3356,0x32FE,
0x32A7,0x324F,0x31F7,0x31A0,0x3149,0x30F2,0x309B,0x3044,0x2FEE,0x2F98,
0x2F42,0x2EEC,0x2E96,0x2E41,0x2DEC,0x2D97,0x2D42,0x2CEE,0x2C9A,0x2C46,
0x2BF2,0x2B9F,0x2B4B,0x2AF8,0x2AA6,0x2A53,0x2A01,0x29AF,0x295D,0x290C,
0x28BB,0x286A,0x2819,0x27C9,0x2779,0x2729,0x26DA,0x268A,0x263B,0x25ED,
0x259F,0x2551,0x2503,0x24B6,0x2468,0x241C,0x23CF,0x2383,0x2337,0x22EC,
0x22A1,0x2256,0x220C,0x21C1,0x2178,0x212E,0x20E5,0x209C,0x2054,0x200C,
0x1FC4,0x1F7D,0x1F36,0x1EEF,0x1EA9,0x1E63,0x1E1E,0x1DD9,0x1D94,0x1D50,
0x1D0C,0x1CC8,0x1C85,0x1C42,0x1C00,0x1BBE,0x1B7C,0x1B3B,0x1AFA,0x1ABA,
0x1A7A,0x1A3A,0x19FB,0x19BC,0x197E,0x1940,0x1903,0x18C6,0x1889,0x184D,
0x1811,0x17D6,0x179B,0x1760,0x1726,0x16ED,0x16B4,0x167B,0x1643,0x160B,
0x15D4,0x159D,0x1566,0x1531,0x14FB,0x14C6,0x1491,0x145D,0x142A,0x13F7,
0x13C4,0x1392,0x1360,0x132F,0x12FE,0x12CE,0x129E,0x126F,0x1240,0x1211,
0x11E4,0x11B6,0x1189,0x115D,0x1131,0x1106,0x10DB,0x10B1,0x1087,0x105E,
0x1035,0x100C,0x0FE5,0x0FBD,0x0F97,0x0F70,0x0F4B,0x0F25,0x0F01,0x0EDC,
0x0EB9,0x0E96,0x0E73,0x0E51,0x0E2F,0x0E0E,0x0DEE,0x0DCE,0x0DAF,0x0D90,
0x0D71,0x0D53,0x0D36,0x0D19,0x0CFD,0x0CE2,0x0CC6,0x0CAC,0x0C92,0x0C78,
0x0C5F,0x0C47,0x0C2F,0x0C18,0x0C01,0x0BEB,0x0BD5,0x0BC0,0x0BAC,0x0B98,
0x0B84,0x0B71,0x0B5F,0x0B4D,0x0B3C,0x0B2B,0x0B1B,0x0B0C,0x0AFD,0x0AEE,
0x0AE1,0x0AD3,0x0AC7,0x0ABA,0x0AAF,0x0AA4,0x0A99,0x0A8F,0x0A86,0x0A7D,
0x0A75,0x0A6D,0x0A66,0x0A60,0x0A5A,0x0A54,0x0A50,0x0A4B,0x0A48,0x0A45,
0x0A42,0x0A40,0x0A3F,0x0A3E,};
const float32_t mfcc_window_coefs_config2_f32[NB_MFCC_WIN_COEFS_CONFIG2_F32]={
0.080000f,0.080035f,0.080139f,0.080312f,0.080554f,0.080866f,0.081246f,0.081696f,0.082215f,0.082803f,
0.083459f,0.084185f,0.084979f,0.085841f,0.086772f,0.087771f,0.088839f,0.089974f,0.091177f,0.092448f,
0.093786f,0.095191f,0.096663f,0.098202f,0.099807f,0.101479f,0.103217f,0.105021f,0.106890f,0.108824f,
0.110823f,0.112887f,0.115015f,0.117208f,0.119464f,0.121783f,0.124165f,0.126610f,0.129117f,0.131686f,
0.134316f,0.137008f,0.139760f,0.142572f,0.145445f,0.148377f,0.151367f,0.154417f,0.157524f,0.160689f,
0.163911f,0.167190f,0.170525f,0.173915f,0.177361f,0.180861f,0.184415f,0.188023f,0.191684f,0.195397f,
0.199162f,0.202979f,0.206846f,0.210764f,0.214731f,0.218747f,0.222811f,0.226924f,0.231083f,0.235289f,
0.239540f,0.243837f,0.248179f,0.252565f,0.256993f,0.261465f,0.265978f,0.270533f,0.275128f,0.279763f,
0.284438f,0.289151f,0.293901f,0.298689f,0.303513f,0.308372f,0.313267f,0.318195f,0.323157f,0.328152f,
0.333179f,0.338237f,0.343325f,0.348442f,0.353589f,0.358764f,0.363966f,0.369194f,0.374448f,0.379727f,
0.385031f,0.390357f,0.395706f,0.401077f,0.406469f,0.411881f,0.417312f,0.422762f,0.428229f,0.433713f,
0.439213f,0.444729f,0.450258f,0.455802f,0.461358f,0.466925f,0.472504f,0.478093f,0.483691f,0.489298f,
0.494912f,0.500533f,0.506160f,0.511792f,0.517429f,0.523069f,0.528711f,0.534355f,0.540000f,0.545645f,
0.551289f,0.556931f,0.562571f,0.568208f,0.573840f,0.579467f,0.585088f,0.590702f,0.596309f,0.601907f,
0.607496f,0.613075f,0.618642f,0.624198f,0.629742f,0.635271f,0.640787f,0.646287f,0.651771f,0.657238f,
0.662688f,0.668119f,0.673531f,0.678923f,0.684294f,0.689643f,0.694969f,0.700273f,0.705552f,0.710806f,
0.716034f,0.721236f,0.726411f,0.731558f,0.736675f,0.741763f,0.746821f,0.751848f,0.756842f,0.761805f,
0.766733f,0.771628f,0.776487f,0.781311f,0.786099f,0.790850f,0.795562f,0.800237f,0.804872f,0.809467f,
0.814022f,0.818535f,0.823007f,0.827435f,0.831821f,0.836163f,0.840460f,0.844711f,0.848917f,0.853076f,
0.857189f,0.861253f,0.865269f,0.869236f,0.873154f,0.877021f,0.880838f,0.884603f,0.888316f,0.891977f,
0.895585f,0.899139f,0.902639f,0.906085f,0.909475f,0.912810f,0.916089f,0.919311f,0.922476f,0.925583f,
0.928633f,0.931623f,0.934555f,0.937428f,0.940240f,0.942992f,0.945684f,0.948314f,0.950883f,0.953390f,
0.955835f,0.958217f,0.960536f,0.962792f,0.964985f,0.967113f,0.969177f,0.971176f,0.973110f,0.974979f,
0.976783f,0.978521f,0.980193f,0.981798f,0.983337f,0.984809f,0.986214f,0.987552f,0.988823f,0.990026f,
0.991161f,0.992229f,0.993228f,0.994159f,0.995021f,0.995815f,0.996541f,0.997197f,0.997785f,0.998304f,
0.998754f,0.999134f,0.999446f,0.999688f,0.999861f,0.999965f,1.000000f,0.999965f,0.999861f,0.999688f,
0.999446f,0.999134f,0.998754f,0.998304f,0.997785f,0.997197f,0.996541f,0.995815f,0.995021f,0.994159f,
0.993228f,0.992229f,0.991161f,0.990026f,0.988823f,0.987552f,0.986214f,0.984809f,0.983337f,0.981798f,
0.980193f,0.978521f,0.976783f,0.974979f,0.973110f,0.971176f,0.969177f,0.967113f,0.964985f,0.962792f,
0.960536f,0.958217f,0.955835f,0.953390f,0.950883f,0.948314f,0.945684f,0.942992f,0.940240f,0.937428f,
0.934555f,0.931623f,0.928633f,0.925583f,0.922476f,0.919311f,0.916089f,0.912810f,0.909475f,0.906085f,
0.902639f,0.899139f,0.895585f,0.891977f,0.888316f,0.884603f,0.880838f,0.877021f,0.873154f,0.869236f,
0.865269f,0.861253f,0.857189f,0.853076f,0.848917f,0.844711f,0.840460f,0.836163f,0.831821f,0.827435f,
0.823007f,0.818535f,0.814022f,0.809467f,0.804872f,0.800237f,0.795562f,0.790850f,0.786099f,0.781311f,
0.776487f,0.771628f,0.766733f,0.761805f,0.756842f,0.751848f,0.746821f,0.741763f,0.736675f,0.731558f,
0.726411f,0.721236f,0.716034f,0.710806f,0.705552f,0.700273f,0.694969f,0.689643f,0.684294f,0.678923f,
0.673531f,0.668119f,0.662688f,0.657238f,0.651771f,0.646287f,0.640787f,0.635271f,0.629742f,0.624198f,
0.618642f,0.613075f,0.607496f,0.601907f,0.596309f,0.590702f,0.585088f,0.579467f,0.573840f,0.568208f,
0.562571f,0.556931f,0.551289f,0.545645f,0.540000f,0.534355f,0.528711f,0.523069f,0.517429f,0.511792f,
0.506160f,0.500533f,0.494912f,0.489298f,0.483691f,0.478093f,0.472504f,0.466925f,0.461358f,0.455802f,
0.450258f,0.444729f,0.439213f,0.433713f,0.428229f,0.422762f,0.417312f,0.411881f,0.406469f,0.401077f,
0.395706f,0.390357f,0.385031f,0.379727f,0.374448f,0.369194f,0.363966f,0.358764f,0.353589f,0.348442f,
0.343325f,0.338237f,0.333179f,0.328152f,0.323157f,0.318195f,0.313267f,0.308372f,0.303513f,0.298689f,
0.293901f,0.289151f,0.284438f,0.279763f,0.275128f,0.270533f,0.265978f,0.261465f,0.256993f,0.252565f,
0.248179f,0.243837f,0.239540f,0.235289f,0.231083f,0.226924f,0.222811f,0.218747f,0.214731f,0.210764f,
0.206846f,0.202979f,0.199162f,0.195397f,0.191684f,0.188023f,0.184415f,0.180861f,0.177361f,0.173915f,
0.170525f,0.167190f,0.163911f,0.160689f,0.157524f,0.154417f,0.151367f,0.148377f,0.145445f,0.142572f,
0.139760f,0.137008f,0.134316f,0.131686f,0.129117f,0.126610f,0.124165f,0.121783f,0.119464f,0.117208f,
0.115015f,0.112887f,0.110823f,0.108824f,0.106890f,0.105021f,0.103217f,0.101479f,0.099807f,0.098202f,
0.096663f,0.095191f,0.093786f,0.092448f,0.091177f,0.089974f,0.088839f,0.087771f,0.086772f,0.085841f,
0.084979f,0.084185f,0.083459f,0.082803f,0.082215f,0.081696f,0.081246f,0.080866f,0.080554f,0.080312f,
0.080139f,0.080035f,};
const q31_t mfcc_window_coefs_config2_q31[NB_MFCC_WIN_COEFS_CONFIG2_Q31]={
0x0A3D70A4,0x0A3E9333,0x0A41FAD4,0x0A47A765,0x0A4F98AF,0x0A59CE64,0x0A66481E,0x0A750562,0x0A86059F,0x0A99482E,
0x0AAECC4F,0x0AC6912F,0x0AE095E3,0x0AFCD96A,0x0B1B5AAE,0x0B3C1881,0x0B5F11A0,0x0B8444B2,0x0BABB048,0x0BD552DD,
0x0C012AD5,0x0C2F3681,0x0C5F7419,0x0C91E1C2,0x0CC67D89,0x0CFD4569,0x0D363743,0x0D7150E6,0x0DAE900B,0x0DEDF256,
0x0E2F7553,0x0E73167E,0x0EB8D33B,0x0F00A8D9,0x0F4A9493,0x0F969391,0x0FE4A2E2,0x1034BF87,0x1086E667,0x10DB1458,
0x1131461B,0x1189785D,0x11E3A7B8,0x123FD0B3,0x129DEFBE,0x12FE013A,0x13600172,0x13C3ECA0,0x1429BEE8,0x1491745E,
0x14FB0902,0x156678C3,0x15D3BF7C,0x1642D8F6,0x16B3C0E9,0x172672FB,0x179AEAC0,0x181123BA,0x1889195B,0x1902C702,
0x197E27FE,0x19FB378F,0x1A79F0E1,0x1AFA4F12,0x1B7C4D2F,0x1BFFE635,0x1C851511,0x1D0BD4A2,0x1D941FB4,0x1E1DF107,
0x1EA9434A,0x1F36111F,0x1FC45518,0x205409B9,0x20E52977,0x2177AEBA,0x220B93DD,0x22A0D32B,0x233766E3,0x23CF4938,
0x2468744E,0x2502E23E,0x259E8D13,0x263B6ECE,0x26D98161,0x2778BEB5,0x281920A6,0x28BAA106,0x295D3999,0x2A00E41C,
0x2AA59A40,0x2B4B55AA,0x2BF20FF7,0x2C99C2B9,0x2D42677A,0x2DEBF7B9,0x2E966CEC,0x2F41C081,0x2FEDEBDD,0x309AE85D,
0x3148AF56,0x31F73A15,0x32A681DE,0x33567FF1,0x34072D83,0x34B883C6,0x356A7BE3,0x361D0EFD,0x36D03633,0x3783EA9C,
0x3838254A,0x38ECDF4B,0x39A211A7,0x3A57B561,0x3B0DC37A,0x3BC434EC,0x3C7B02AE,0x3D3225B5,0x3DE996F1,0x3EA14F50,
0x3F5947BB,0x4011791C,0x40C9DC59,0x41826A56,0x423B1BF5,0x42F3EA18,0x43ACCD9E,0x4465BF67,0x451EB852,0x45D7B13D,
0x4690A306,0x4749868C,0x480254AF,0x48BB064E,0x4973944B,0x4A2BF788,0x4AE428E9,0x4B9C2154,0x4C53D9B3,0x4D0B4AEF,
0x4DC26DF5,0x4E793BB8,0x4F2FAD2A,0x4FE5BB42,0x509B5EFD,0x51509159,0x52054B5A,0x52B98608,0x536D3A71,0x542061A7,
0x54D2F4C1,0x5584ECDE,0x56364321,0x56E6F0B3,0x5796EEC6,0x5846368F,0x58F4C14E,0x59A28846,0x5A4F84C7,0x5AFBB023,
0x5BA703B8,0x5C5178EB,0x5CFB092A,0x5DA3ADEB,0x5E4B60AD,0x5EF21AFA,0x5F97D664,0x603C8C87,0x60E0370B,0x6182CF9E,
0x62244FFE,0x62C4B1EF,0x6363EF43,0x640201D6,0x649EE391,0x653A8E66,0x65D4FC56,0x666E276C,0x670609C1,0x679C9D79,
0x6831DCC7,0x68C5C1EA,0x6958472D,0x69E966EB,0x6A791B8C,0x6B075F85,0x6B942D5A,0x6C1F7F9D,0x6CA950F0,0x6D319C02,
0x6DB85B92,0x6E3D8A6F,0x6EC12375,0x6F432192,0x6FC37FC3,0x70423915,0x70BF48A6,0x713AA9A2,0x71B45749,0x722C4CEA,
0x72A285E4,0x7316FDA9,0x7389AFBB,0x73FA97AE,0x7469B128,0x74D6F7E1,0x754267A2,0x75ABFC46,0x7613B1BC,0x76798404,
0x76DD6F31,0x773F6F6A,0x779F80E6,0x77FD9FF1,0x7859C8EB,0x78B3F847,0x790C2A89,0x79625C4C,0x79B68A3D,0x7A08B11D,
0x7A58CDC1,0x7AA6DD13,0x7AF2DC10,0x7B3CC7CB,0x7B849D69,0x7BCA5A25,0x7C0DFB50,0x7C4F7E4E,0x7C8EE098,0x7CCC1FBE,
0x7D073961,0x7D402B3B,0x7D76F31B,0x7DAB8EE2,0x7DDDFC8B,0x7E0E3A23,0x7E3C45CF,0x7E681DC7,0x7E91C05C,0x7EB92BF2,
0x7EDE5F04,0x7F015823,0x7F2215F6,0x7F409739,0x7F5CDAC1,0x7F76DF75,0x7F8EA455,0x7FA42876,0x7FB76B04,0x7FC86B42,
0x7FD72886,0x7FE3A240,0x7FEDD7F4,0x7FF5C93F,0x7FFB75D0,0x7FFEDD71,0x7FFFFFFF,0x7FFEDD71,0x7FFB75D0,0x7FF5C93F,
0x7FEDD7F4,0x7FE3A240,0x7FD72886,0x7FC86B42,0x7FB76B04,0x7FA42876,0x7F8EA455,0x7F76DF75,0x7F5CDAC1,0x7F409739,
0x7F2215F6,0x7F015823,0x7EDE5F04,0x7EB92BF2,0x7E91C05C,0x7E681DC7,0x7E3C45CF,0x7E0E3A23,0x7DDDFC8B,0x7DAB8EE2,
0x7D76F31B,0x7D402B3B,0x7D073961,0x7CCC1FBE,0x7C8EE098,0x7C4F7E4E,0x7C0DFB50,0x7BCA5A25,0x7B849D69,0x7B3CC7CB,
0x7AF2DC10,0x7AA6DD13,0x7A58CDC1,0x7A08B11D,0x79B68A3D,0x79625C4C,0x790C2A89,0x78B3F847,0x7859C8EB,0x77FD9FF1,
0x779F80E6,0x773F6F6A,0x76DD6F31,0x76798404,0x7613B1BC,0x75ABFC46,0x754267A2,0x74D6F7E1,0x7469B128,0x73FA97AE,
0x7389AFBB,0x7316FDA9,0x72A285E4,0x722C4CEA,0x71B45749,0x713AA9A2,0x70BF48A6,0x70423915,0x6FC37FC3,0x6F432192,
0x6EC12375,0x6E3D8A6F,0x6DB85B92,0x6D319C02,0x6CA950F0,0x6C1F7F9D,0x6B942D5A,0x6B075F85,0x6A791B8C,0x69E966EB,
0x6958472D,0x68C5C1EA,0x6831DCC7,0x679C9D79,0x670609C1,0x666E276C,0x65D4FC56,0x653A8E66,0x649EE391,0x640201D6,
0x6363EF43,0x62C4B1EF,0x62244FFE,0x6182CF9E,0x60E0370B,0x603C8C87,0x5F97D664,0x5EF21AFA,0x5E4B60AD,0x5DA3ADEB,
0x5CFB092A,0x5C5178EB,0x5BA703B8,0x5AFBB023,0x5A4F84C7,0x59A28846,0x58F4C14E,0x5846368F,0x5796EEC6,0x56E6F0B3,
0x56364321,0x5584ECDE,0x54D2F4C1,0x542061A7,0x536D3A71,0x52B98608,0x52054B5A,0x51509159,0x509B5EFD,0x4FE5BB42,
0x4F2FAD2A,0x4E793BB8,0x4DC26DF5,0x4D0B4AEF,0x4C53D9B3,0x4B9C2154,0x4AE428E9,0x4A2BF788,0x4973944B,0x48BB064E,
0x480254AF,0x4749868C,0x4690A306,0x45D7B13D,0x451EB852,0x4465BF67,0x43ACCD9E,0x42F3EA18,0x423B1BF5,0x41826A56,
0x40C9DC59,0x4011791C,0x3F5947BB,0x3EA14F50,0x3DE996F1,0x3D3225B5,0x3C7B02AE,0x3BC434EC,0x3B0DC37A,0x3A57B561,
0x39A211A7,0x38ECDF4B,0x3838254A,0x3783EA9C,0x36D03633,0x361D0EFD,0x356A7BE3,0x34B883C6,0x34072D83,0x33567FF1,
0x32A681DE,0x31F73A15,0x3148AF56,0x309AE85D,0x2FEDEBDD,0x2F41C081,0x2E966CEC,0x2DEBF7B9,0x2D42677A,0x2C99C2B9,
0x2BF20FF7,0x2B4B55AA,0x2AA59A40,0x2A00E41C,0x295D3999,0x28BAA106,0x281920A6,0x2778BEB5,0x26D98161,0x263B6ECE,
0x259E8D13,0x2502E23E,0x2468744E,0x23CF4938,0x233766E3,0x22A0D32B,0x220B93DD,0x2177AEBA,0x20E52977,0x205409B9,
0x1FC45518,0x1F36111F,0x1EA9434A,0x1E1DF107,0x1D941FB4,0x1D0BD4A2,0x1C851511,0x1BFFE635,0x1B7C4D2F,0x1AFA4F12,
0x1A79F0E1,0x19FB378F,0x197E27FE,0x1902C702,0x1889195B,0x181123BA,0x179AEAC0,0x172672FB,0x16B3C0E9,0x1642D8F6,
0x15D3BF7C,0x156678C3,0x14FB0902,0x1491745E,0x1429BEE8,0x13C3ECA0,0x13600172,0x12FE013A,0x129DEFBE,0x123FD0B3,
0x11E3A7B8,0x1189785D,0x1131461B,0x10DB1458,0x1086E667,0x1034BF87,0x0FE4A2E2,0x0F969391,0x0F4A9493,0x0F00A8D9,
0x0EB8D33B,0x0E73167E,0x0E2F7553,0x0DEDF256,0x0DAE900B,0x0D7150E6,0x0D363743,0x0CFD4569,0x0CC67D89,0x0C91E1C2,
0x0C5F7419,0x0C2F3681,0x0C012AD5,0x0BD552DD,0x0BABB048,0x0B8444B2,0x0B5F11A0,0x0B3C1881,0x0B1B5AAE,0x0AFCD96A,
0x0AE095E3,0x0AC6912F,0x0AAECC4F,0x0A99482E,0x0A86059F,0x0A750562,0x0A66481E,0x0A59CE64,0x0A4F98AF,0x0A47A765,
0x0A41FAD4,0x0A3E9333,};
const q15_t mfcc_window_coefs_config2_q15[NB_MFCC_WIN_COEFS_CONFIG2_Q15]={
0x0A3D,0x0A3F,0x0A42,0x0A48,0x0A50,0x0A5A,0x0A66,0x0A75,0x0A86,0x0A99,
0x0AAF,0x0AC7,0x0AE1,0x0AFD,0x0B1B,0x0B3C,0x0B5F,0x0B84,0x0BAC,0x0BD5,
0x0C01,0x0C2F,0x0C5F,0x0C92,0x0CC6,0x0CFD,0x0D36,0x0D71,0x0DAF,0x0DEE,
0x0E2F,0x0E73,0x0EB9,0x0F01,0x0F4B,0x0F97,0x0FE5,0x1035,0x1087,0x10DB,
0x1131,0x1189,0x11E4,0x1240,0x129E,0x12FE,0x1360,0x13C4,0x142A,0x1491,
0x14FB,0x1566,0x15D4,0x1643,0x16B4,0x1726,0x179B,0x1811,0x1889,0x1903,
0x197E,0x19FB,0x1A7A,0x1AFA,0x1B7C,0x1C00,0x1C85,0x1D0C,0x1D94,0x1E1E,
0x1EA9,0x1F36,0x1FC4,0x2054,0x20E5,0x2178,0x220C,0x22A1,0x2337,0x23CF,
0x2468,0x2503,0x259F,0x263B,0x26DA,0x2779,0x2819,0x28BB,0x295D,0x2A01,
0x2AA6,0x2B4B,0x2BF2,0x2C9A,0x2D42,0x2DEC,0x2E96,0x2F42,0x2FEE,0x309B,
0x3149,0x31F7,0x32A7,0x3356,0x3407,0x34B9,0x356A,0x361D,0x36D0,0x3784,
0x3838,0x38ED,0x39A2,0x3A58,0x3B0E,0x3BC4,0x3C7B,0x3D32,0x3DEA,0x3EA1,
0x3F59,0x4011,0x40CA,0x4182,0x423B,0x42F4,0x43AD,0x4466,0x451F,0x45D8,
0x4691,0x474A,0x4802,0x48BB,0x4974,0x4A2C,0x4AE4,0x4B9C,0x4C54,0x4D0B,
0x4DC2,0x4E79,0x4F30,0x4FE6,0x509B,0x5151,0x5205,0x52BA,0x536D,0x5420,
0x54D3,0x5585,0x5636,0x56E7,0x5797,0x5846,0x58F5,0x59A3,0x5A50,0x5AFC,
0x5BA7,0x5C51,0x5CFB,0x5DA4,0x5E4B,0x5EF2,0x5F98,0x603D,0x60E0,0x6183,
0x6224,0x62C5,0x6364,0x6402,0x649F,0x653B,0x65D5,0x666E,0x6706,0x679D,
0x6832,0x68C6,0x6958,0x69E9,0x6A79,0x6B07,0x6B94,0x6C1F,0x6CA9,0x6D32,
0x6DB8,0x6E3E,0x6EC1,0x6F43,0x6FC3,0x7042,0x70BF,0x713B,0x71B4,0x722C,
0x72A3,0x7317,0x738A,0x73FB,0x746A,0x74D7,0x7542,0x75AC,0x7614,0x767A,
0x76DD,0x773F,0x77A0,0x77FE,0x785A,0x78B4,0x790C,0x7962,0x79B7,0x7A09,
0x7A59,0x7AA7,0x7AF3,0x7B3D,0x7B85,0x7BCA,0x7C0E,0x7C4F,0x7C8F,0x7CCC,
0x7D07,0x7D40,0x7D77,0x7DAC,0x7DDE,0x7E0E,0x7E3C,0x7E68,0x7E92,0x7EB9,
0x7EDE,0x7F01,0x7F22,0x7F41,0x7F5D,0x7F77,0x7F8F,0x7FA4,0x7FB7,0x7FC8,
0x7FD7,0x7FE4,0x7FEE,0x7FF6,0x7FFB,0x7FFF,0x7FFF,0x7FFF,0x7FFB,0x7FF6,
0x7FEE,0x7FE4,0x7FD7,0x7FC8,0x7FB7,0x7FA4,0x7F8F,0x7F77,0x7F5D,0x7F41,
0x7F22,0x7F01,0x7EDE,0x7EB9,0x7E92,0x7E68,0x7E3C,0x7E0E,0x7DDE,0x7DAC,
0x7D77,0x7D40,0x7D07,0x7CCC,0x7C8F,0x7C4F,0x7C0E,0x7BCA,0x7B85,0x7B3D,
0x7AF3,0x7AA7,0x7A59,0x7A09,0x79B7,0x7962,0x790C,0x78B4,0x785A,0x77FE,
0x77A0,0x773F,0x76DD,0x767A,0x7614,0x75AC,0x7542,0x74D7,0x746A,0x73FB,
0x738A,0x7317,0x72A3,0x722C,0x71B4,0x713B,0x70BF,0x7042,0x6FC3,0x6F43,
0x6EC1,0x6E3E,0x6DB8,0x6D32,0x6CA9,0x6C1F,0x6B94,0x6B07,0x6A79,0x69E9,
0x6958,0x68C6,0x6832,0x679D,0x6706,0x666E,0x65D5,0x653B,0x649F,0x6402,
0x6364,0x62C5,0x6224,0x6183,0x60E0,0x603D,0x5F98,0x5EF2,0x5E4B,0x5DA4,
0x5CFB,0x5C51,0x5BA7,0x5AFC,0x5A50,0x59A3,0x58F5,0x5846,0x5797,0x56E7,
0x5636,0x5585,0x54D3,0x5420,0x536D,0x52BA,0x5205,0x5151,0x509B,0x4FE6,
0x4F30,0x4E79,0x4DC2,0x4D0B,0x4C54,0x4B9C,0x4AE4,0x4A2C,0x4974,0x48BB,
0x4802,0x474A,0x4691,0x45D8,0x451F,0x4466,0x43AD,0x42F4,0x423B,0x4182,
0x40CA,0x4011,0x3F59,0x3EA1,0x3DEA,0x3D32,0x3C7B,0x3BC4,0x3B0E,0x3A58,
0x39A2,0x38ED,0x3838,0x3784,0x36D0,0x361D,0x356A,0x34B9,0x3407,0x3356,
0x32A7,0x31F7,0x3149,0x309B,0x2FEE,0x2F42,0x2E96,0x2DEC,0x2D42,0x2C9A,
0x2BF2,0x2B4B,0x2AA6,0x2A01,0x295D,0x28BB,0x2819,0x2779,0x26DA,0x263B,
0x259F,0x2503,0x2468,0x23CF,0x2337,0x22A1,0x220C,0x2178,0x20E5,0x2054,
0x1FC4,0x1F36,0x1EA9,0x1E1E,0x1D94,0x1D0C,0x1C85,0x1C00,0x1B7C,0x1AFA,
0x1A7A,0x19FB,0x197E,0x1903,0x1889,0x1811,0x179B,0x1726,0x16B4,0x1643,
0x15D4,0x1566,0x14FB,0x1491,0x142A,0x13C4,0x1360,0x12FE,0x129E,0x1240,
0x11E4,0x1189,0x1131,0x10DB,0x1087,0x1035,0x0FE5,0x0F97,0x0F4B,0x0F01,
0x0EB9,0x0E73,0x0E2F,0x0DEE,0x0DAF,0x0D71,0x0D36,0x0CFD,0x0CC6,0x0C92,
0x0C5F,0x0C2F,0x0C01,0x0BD5,0x0BAC,0x0B84,0x0B5F,0x0B3C,0x0B1B,0x0AFD,
0x0AE1,0x0AC7,0x0AAF,0x0A99,0x0A86,0x0A75,0x0A66,0x0A5A,0x0A50,0x0A48,
0x0A42,0x0A3F,};
const float32_t mfcc_window_coefs_config3_f32[NB_MFCC_WIN_COEFS_CONFIG3_F32]={
0.080000f,0.080139f,0.080554f,0.081246f,0.082215f,0.083459f,0.084979f,0.086772f,0.088839f,0.091177f,
0.093786f,0.096663f,0.099807f,0.103217f,0.106890f,0.110823f,0.115015f,0.119464f,0.124165f,0.129117f,
0.134316f,0.139760f,0.145445f,0.151367f,0.157524f,0.163911f,0.170525f,0.177361f,0.184415f,0.191684f,
0.199162f,0.206846f,0.214731f,0.222811f,0.231083f,0.239540f,0.248179f,0.256993f,0.265978f,0.275128f,
0.284438f,0.293901f,0.303513f,0.313267f,0.323157f,0.333179f,0.343325f,0.353589f,0.363966f,0.374448f,
0.385031f,0.395706f,0.406469f,0.417312f,0.428229f,0.439213f,0.450258f,0.461358f,0.472504f,0.483691f,
0.494912f,0.506160f,0.517429f,0.528711f,0.540000f,0.551289f,0.562571f,0.573840f,0.585088f,0.596309f,
0.607496f,0.618642f,0.629742f,0.640787f,0.651771f,0.662688f,0.673531f,0.684294f,0.694969f,0.705552f,
0.716034f,0.726411f,0.736675f,0.746821f,0.756842f,0.766733f,0.776487f,0.786099f,0.795562f,0.804872f,
0.814022f,0.823007f,0.831821f,0.840460f,0.848917f,0.857189f,0.865269f,0.873154f,0.880838f,0.888316f,
0.895585f,0.902639f,0.909475f,0.916089f,0.922476f,0.928633f,0.934555f,0.940240f,0.945684f,0.950883f,
0.955835f,0.960536f,0.964985f,0.969177f,0.973110f,0.976783f,0.980193f,0.983337f,0.986214f,0.988823f,
0.991161f,0.993228f,0.995021f,0.996541f,0.997785f,0.998754f,0.999446f,0.999861f,1.000000f,0.999861f,
0.999446f,0.998754f,0.997785f,0.996541f,0.995021f,0.993228f,0.991161f,0.988823f,0.986214f,0.983337f,
0.980193f,0.976783f,0.973110f,0.969177f,0.964985f,0.960536f,0.955835f,0.950883f,0.945684f,0.940240f,
0.934555f,0.928633f,0.922476f,0.916089f,0.909475f,0.902639f,0.895585f,0.888316f,0.880838f,0.873154f,
0.865269f,0.857189f,0.848917f,0.840460f,0.831821f,0.823007f,0.814022f,0.804872f,0.795562f,0.786099f,
0.776487f,0.766733f,0.756842f,0.746821f,0.736675f,0.726411f,0.716034f,0.705552f,0.694969f,0.684294f,
0.673531f,0.662688f,0.651771f,0.640787f,0.629742f,0.618642f,0.607496f,0.596309f,0.585088f,0.573840f,
0.562571f,0.551289f,0.540000f,0.528711f,0.517429f,0.506160f,0.494912f,0.483691f,0.472504f,0.461358f,
0.450258f,0.439213f,0.428229f,0.417312f,0.406469f,0.395706f,0.385031f,0.374448f,0.363966f,0.353589f,
0.343325f,0.333179f,0.323157f,0.313267f,0.303513f,0.293901f,0.284438f,0.275128f,0.265978f,0.256993f,
0.248179f,0.239540f,0.231083f,0.222811f,0.214731f,0.206846f,0.199162f,0.191684f,0.184415f,0.177361f,
0.170525f,0.163911f,0.157524f,0.151367f,0.145445f,0.139760f,0.134316f,0.129117f,0.124165f,0.119464f,
0.115015f,0.110823f,0.106890f,0.103217f,0.099807f,0.096663f,0.093786f,0.091177f,0.088839f,0.086772f,
0.084979f,0.083459f,0.082215f,0.081246f,0.080554f,0.080139f,};
const q31_t mfcc_window_coefs_config3_q31[NB_MFCC_WIN_COEFS_CONFIG3_Q31]={
0x0A3D70A4,0x0A41FAD4,0x0A4F98AF,0x0A66481E,0x0A86059F,0x0AAECC4F,0x0AE095E3,0x0B1B5AAE,0x0B5F11A0,0x0BABB048,
0x0C012AD5,0x0C5F7419,0x0CC67D89,0x0D363743,0x0DAE900B,0x0E2F7553,0x0EB8D33B,0x0F4A9493,0x0FE4A2E2,0x1086E667,
0x1131461B,0x11E3A7B8,0x129DEFBE,0x13600172,0x1429BEE8,0x14FB0902,0x15D3BF7C,0x16B3C0E9,0x179AEAC0,0x1889195B,
0x197E27FE,0x1A79F0E1,0x1B7C4D2F,0x1C851511,0x1D941FB4,0x1EA9434A,0x1FC45518,0x20E52977,0x220B93DD,0x233766E3,
0x2468744E,0x259E8D13,0x26D98161,0x281920A6,0x295D3999,0x2AA59A40,0x2BF20FF7,0x2D42677A,0x2E966CEC,0x2FEDEBDD,
0x3148AF56,0x32A681DE,0x34072D83,0x356A7BE3,0x36D03633,0x3838254A,0x39A211A7,0x3B0DC37A,0x3C7B02AE,0x3DE996F1,
0x3F5947BB,0x40C9DC59,0x423B1BF5,0x43ACCD9E,0x451EB852,0x4690A306,0x480254AF,0x4973944B,0x4AE428E9,0x4C53D9B3,
0x4DC26DF5,0x4F2FAD2A,0x509B5EFD,0x52054B5A,0x536D3A71,0x54D2F4C1,0x56364321,0x5796EEC6,0x58F4C14E,0x5A4F84C7,
0x5BA703B8,0x5CFB092A,0x5E4B60AD,0x5F97D664,0x60E0370B,0x62244FFE,0x6363EF43,0x649EE391,0x65D4FC56,0x670609C1,
0x6831DCC7,0x6958472D,0x6A791B8C,0x6B942D5A,0x6CA950F0,0x6DB85B92,0x6EC12375,0x6FC37FC3,0x70BF48A6,0x71B45749,
0x72A285E4,0x7389AFBB,0x7469B128,0x754267A2,0x7613B1BC,0x76DD6F31,0x779F80E6,0x7859C8EB,0x790C2A89,0x79B68A3D,
0x7A58CDC1,0x7AF2DC10,0x7B849D69,0x7C0DFB50,0x7C8EE098,0x7D073961,0x7D76F31B,0x7DDDFC8B,0x7E3C45CF,0x7E91C05C,
0x7EDE5F04,0x7F2215F6,0x7F5CDAC1,0x7F8EA455,0x7FB76B04,0x7FD72886,0x7FEDD7F4,0x7FFB75D0,0x7FFFFFFF,0x7FFB75D0,
0x7FEDD7F4,0x7FD72886,0x7FB76B04,0x7F8EA455,0x7F5CDAC1,0x7F2215F6,0x7EDE5F04,0x7E91C05C,0x7E3C45CF,0x7DDDFC8B,
0x7D76F31B,0x7D073961,0x7C8EE098,0x7C0DFB50,0x7B849D69,0x7AF2DC10,0x7A58CDC1,0x79B68A3D,0x790C2A89,0x7859C8EB,
0x779F80E6,0x76DD6F31,0x7613B1BC,0x754267A2,0x7469B128,0x7389AFBB,0x72A285E4,0x71B45749,0x70BF48A6,0x6FC37FC3,
0x6EC12375,0x6DB85B92,0x6CA950F0,0x6B942D5A,0x6A791B8C,0x6958472D,0x6831DCC7,0x670609C1,0x65D4FC56,0x649EE391,
0x6363EF43,0x62244FFE,0x60E0370B,0x5F97D664,0x5E4B60AD,0x5CFB092A,0x5BA703B8,0x5A4F84C7,0x58F4C14E,0x5796EEC6,
0x56364321,0x54D2F4C1,0x536D3A71,0x52054B5A,0x509B5EFD,0x4F2FAD2A,0x4DC26DF5,0x4C53D9B3,0x4AE428E9,0x4973944B,
0x480254AF,0x4690A306,0x451EB852,0x43ACCD9E,0x423B1BF5,0x40C9DC59,0x3F5947BB,0x3DE996F1,0x3C7B02AE,0x3B0DC37A,
0x39A211A7,0x3838254A,0x36D03633,0x356A7BE3,0x34072D83,0x32A681DE,0x3148AF56,0x2FEDEBDD,0x2E966CEC,0x2D42677A,
0x2BF20FF7,0x2AA59A40,0x295D3999,0x281920A6,0x26D98161,0x259E8D13,0x2468744E,0x233766E3,0x220B93DD,0x20E52977,
0x1FC45518,0x1EA9434A,0x1D941FB4,0x1C851511,0x1B7C4D2F,0x1A79F0E1,0x197E27FE,0x1889195B,0x179AEAC0,0x16B3C0E9,
0x15D3BF7C,0x14FB0902,0x1429BEE8,0x13600172,0x129DEFBE,0x11E3A7B8,0x1131461B,0x1086E667,0x0FE4A2E2,0x0F4A9493,
0x0EB8D33B,0x0E2F7553,0x0DAE900B,0x0D363743,0x0CC67D89,0x0C5F7419,0x0C012AD5,0x0BABB048,0x0B5F11A0,0x0B1B5AAE,
0x0AE095E3,0x0AAECC4F,0x0A86059F,0x0A66481E,0x0A4F98AF,0x0A41FAD4,};
const q15_t mfcc_window_coefs_config3_q15[NB_MFCC_WIN_COEFS_CONFIG3_Q15]={
0x0A3D,0x0A42,0x0A50,0x0A66,0x0A86,0x0AAF,0x0AE1,0x0B1B,0x0B5F,0x0BAC,
0x0C01,0x0C5F,0x0CC6,0x0D36,0x0DAF,0x0E2F,0x0EB9,0x0F4B,0x0FE5,0x1087,
0x1131,0x11E4,0x129E,0x1360,0x142A,0x14FB,0x15D4,0x16B4,0x179B,0x1889,
0x197E,0x1A7A,0x1B7C,0x1C85,0x1D94,0x1EA9,0x1FC4,0x20E5,0x220C,0x2337,
0x2468,0x259F,0x26DA,0x2819,0x295D,0x2AA6,0x2BF2,0x2D42,0x2E96,0x2FEE,
0x3149,0x32A7,0x3407,0x356A,0x36D0,0x3838,0x39A2,0x3B0E,0x3C7B,0x3DEA,
0x3F59,0x40CA,0x423B,0x43AD,0x451F,0x4691,0x4802,0x4974,0x4AE4,0x4C54,
0x4DC2,0x4F30,0x509B,0x5205,0x536D,0x54D3,0x5636,0x5797,0x58F5,0x5A50,
0x5BA7,0x5CFB,0x5E4B,0x5F98,0x60E0,0x6224,0x6364,0x649F,0x65D5,0x6706,
0x6832,0x6958,0x6A79,0x6B94,0x6CA9,0x6DB8,0x6EC1,0x6FC3,0x70BF,0x71B4,
0x72A3,0x738A,0x746A,0x7542,0x7614,0x76DD,0x77A0,0x785A,0x790C,0x79B7,
0x7A59,0x7AF3,0x7B85,0x7C0E,0x7C8F,0x7D07,0x7D77,0x7DDE,0x7E3C,0x7E92,
0x7EDE,0x7F22,0x7F5D,0x7F8F,0x7FB7,0x7FD7,0x7FEE,0x7FFB,0x7FFF,0x7FFB,
0x7FEE,0x7FD7,0x7FB7,0x7F8F,0x7F5D,0x7F22,0x7EDE,0x7E92,0x7E3C,0x7DDE,
0x7D77,0x7D07,0x7C8F,0x7C0E,0x7B85,0x7AF3,0x7A59,0x79B7,0x790C,0x785A,
0x77A0,0x76DD,0x7614,0x7542,0x746A,0x738A,0x72A3,0x71B4,0x70BF,0x6FC3,
0x6EC1,0x6DB8,0x6CA9,0x6B94,0x6A79,0x6958,0x6832,0x6706,0x65D5,0x649F,
0x6364,0x6224,0x60E0,0x5F98,0x5E4B,0x5CFB,0x5BA7,0x5A50,0x58F5,0x5797,
0x5636,0x54D3,0x536D,0x5205,0x509B,0x4F30,0x4DC2,0x4C54,0x4AE4,0x4974,
0x4802,0x4691,0x451F,0x43AD,0x423B,0x40CA,0x3F59,0x3DEA,0x3C7B,0x3B0E,
0x39A2,0x3838,0x36D0,0x356A,0x3407,0x32A7,0x3149,0x2FEE,0x2E96,0x2D42,
0x2BF2,0x2AA6,0x295D,0x2819,0x26DA,0x259F,0x2468,0x2337,0x220C,0x20E5,
0x1FC4,0x1EA9,0x1D94,0x1C85,0x1B7C,0x1A7A,0x197E,0x1889,0x179B,0x16B4,
0x15D4,0x14FB,0x142A,0x1360,0x129E,0x11E4,0x1131,0x1087,0x0FE5,0x0F4B,
0x0EB9,0x0E2F,0x0DAF,0x0D36,0x0CC6,0x0C5F,0x0C01,0x0BAC,0x0B5F,0x0B1B,
0x0AE1,0x0AAF,0x0A86,0x0A66,0x0A50,0x0A42,};
const uint32_t mfcc_filter_pos_config1_f32[NB_MFCC_NB_FILTER_CONFIG1_F32]={
5,11,17,25,33,43,54,66,79,94,
111,131,152,176,203,234,268,306,349,397,
};
const uint32_t mfcc_filter_len_config1_f32[NB_MFCC_NB_FILTER_CONFIG1_F32]={
12,14,16,18,21,23,25,28,32,37,
41,45,51,58,65,72,81,91,103,115,
};
const uint32_t mfcc_filter_pos_config1_q31[NB_MFCC_NB_FILTER_CONFIG1_Q31]={
5,11,17,25,33,43,54,66,79,94,
111,131,152,176,203,234,268,306,349,397,
};
const uint32_t mfcc_filter_len_config1_q31[NB_MFCC_NB_FILTER_CONFIG1_Q31]={
12,14,16,18,21,23,25,28,32,37,
41,45,51,58,65,72,81,91,103,115,
};
const uint32_t mfcc_filter_pos_config1_q15[NB_MFCC_NB_FILTER_CONFIG1_Q15]={
5,11,17,25,33,43,54,66,79,94,
111,131,152,176,203,234,268,306,349,397,
};
const uint32_t mfcc_filter_len_config1_q15[NB_MFCC_NB_FILTER_CONFIG1_Q15]={
12,14,16,18,21,23,25,28,32,37,
41,45,51,58,65,72,81,91,103,115,
};
const uint32_t mfcc_filter_pos_config2_f32[NB_MFCC_NB_FILTER_CONFIG2_F32]={
3,6,9,13,17,22,27,33,40,47,
56,66,76,88,102,117,134,153,175,199,
};
const uint32_t mfcc_filter_len_config2_f32[NB_MFCC_NB_FILTER_CONFIG2_F32]={
6,7,8,9,10,11,13,14,16,19,
20,22,26,29,32,36,41,46,51,57,
};
const uint32_t mfcc_filter_pos_config2_q31[NB_MFCC_NB_FILTER_CONFIG2_Q31]={
3,6,9,13,17,22,27,33,40,47,
56,66,76,88,102,117,134,153,175,199,
};
const uint32_t mfcc_filter_len_config2_q31[NB_MFCC_NB_FILTER_CONFIG2_Q31]={
6,7,8,9,10,11,13,14,16,19,
20,22,26,29,32,36,41,46,51,57,
};
const uint32_t mfcc_filter_pos_config2_q15[NB_MFCC_NB_FILTER_CONFIG2_Q15]={
3,6,9,13,17,22,27,33,40,47,
56,66,76,88,102,117,134,153,175,199,
};
const uint32_t mfcc_filter_len_config2_q15[NB_MFCC_NB_FILTER_CONFIG2_Q15]={
6,7,8,9,10,11,13,14,16,19,
20,22,26,29,32,36,41,46,51,57,
};
const uint32_t mfcc_filter_pos_config3_f32[NB_MFCC_NB_FILTER_CONFIG3_F32]={
2,3,5,7,9,11,14,17,20,24,
28,33,38,44,51,59,67,77,88,100,
};
const uint32_t mfcc_filter_len_config3_f32[NB_MFCC_NB_FILTER_CONFIG3_F32]={
3,4,4,4,5,6,6,7,8,9,
10,11,13,15,16,18,21,23,25,28,
};
const uint32_t mfcc_filter_pos_config3_q31[NB_MFCC_NB_FILTER_CONFIG3_Q31]={
2,3,5,7,9,11,14,17,20,24,
28,33,38,44,51,59,67,77,88,100,
};
const uint32_t mfcc_filter_len_config3_q31[NB_MFCC_NB_FILTER_CONFIG3_Q31]={
3,4,4,4,5,6,6,7,8,9,
10,11,13,15,16,18,21,23,25,28,
};
const uint32_t mfcc_filter_pos_config3_q15[NB_MFCC_NB_FILTER_CONFIG3_Q15]={
2,3,5,7,9,11,14,17,20,24,
28,33,38,44,51,59,67,77,88,100,
};
const uint32_t mfcc_filter_len_config3_q15[NB_MFCC_NB_FILTER_CONFIG3_Q15]={
3,4,4,4,5,6,6,7,8,9,
10,11,13,15,16,18,21,23,25,28,
};
const float32_t mfcc_filter_coefs_config1_f32[NB_MFCC_FILTER_COEFS_CONFIG1_F32]={
0.158152f,0.329789f,0.498080f,0.663153f,0.825129f,0.984122f,0.859761f,0.706417f,0.555749f,0.407665f,
0.262079f,0.118907f,0.140239f,0.293583f,0.444251f,0.592335f,0.737921f,0.881093f,0.978071f,0.839496f,
0.703110f,0.568845f,0.436636f,0.306422f,0.178142f,0.051741f,0.021929f,0.160504f,0.296890f,0.431155f,
0.563364f,0.693578f,0.821858f,0.948259f,0.927164f,0.804358f,0.683276f,0.563868f,0.446089f,0.329895f,
0.215245f,0.102097f,0.072836f,0.195642f,0.316724f,0.436132f,0.553911f,0.670105f,0.784755f,0.897903f,
0.990413f,0.880155f,0.771288f,0.663777f,0.557588f,0.452689f,0.349050f,0.246640f,0.145430f,0.045394f,
0.009587f,0.119845f,0.228712f,0.336223f,0.442412f,0.547311f,0.650950f,0.753360f,0.854570f,0.954606f,
0.946503f,0.848733f,0.752057f,0.656452f,0.561894f,0.468360f,0.375829f,0.284280f,0.193690f,0.104042f,
0.015315f,0.053497f,0.151267f,0.247943f,0.343548f,0.438106f,0.531640f,0.624171f,0.715720f,0.806310f,
0.895958f,0.984685f,0.927491f,0.840551f,0.754478f,0.669255f,0.584864f,0.501291f,0.418519f,0.336533f,
0.255318f,0.174861f,0.095146f,0.016160f,0.072509f,0.159449f,0.245522f,0.330745f,0.415136f,0.498709f,
0.581481f,0.663467f,0.744682f,0.825139f,0.904854f,0.983840f,0.937891f,0.860325f,0.783449f,0.707252f,
0.631722f,0.556847f,0.482615f,0.409017f,0.336040f,0.263676f,0.191913f,0.120741f,0.050152f,0.062109f,
0.139675f,0.216551f,0.292748f,0.368278f,0.443153f,0.517385f,0.590983f,0.663960f,0.736324f,0.808087f,
0.879259f,0.949848f,0.980135f,0.910681f,0.841781f,0.773427f,0.705610f,0.638322f,0.571554f,0.505298f,
0.439548f,0.374294f,0.309529f,0.245247f,0.181440f,0.118101f,0.055223f,0.019865f,0.089319f,0.158219f,
0.226573f,0.294390f,0.361678f,0.428446f,0.494702f,0.560452f,0.625706f,0.690471f,0.754753f,0.818560f,
0.881899f,0.944777f,0.992800f,0.930826f,0.869293f,0.808195f,0.747527f,0.687282f,0.627454f,0.568039f,
0.509029f,0.450420f,0.392207f,0.334383f,0.276944f,0.219885f,0.163200f,0.106885f,0.050935f,0.007200f,
0.069174f,0.130707f,0.191805f,0.252473f,0.312718f,0.372546f,0.431961f,0.490971f,0.549580f,0.607793f,
0.665617f,0.723056f,0.780115f,0.836800f,0.893115f,0.949065f,0.995345f,0.940111f,0.885228f,0.830692f,
0.776498f,0.722642f,0.669120f,0.615928f,0.563062f,0.510517f,0.458290f,0.406378f,0.354775f,0.303479f,
0.252487f,0.201793f,0.151396f,0.101291f,0.051475f,0.001945f,0.004655f,0.059889f,0.114772f,0.169308f,
0.223502f,0.277358f,0.330880f,0.384072f,0.436938f,0.489483f,0.541710f,0.593622f,0.645225f,0.696521f,
0.747513f,0.798207f,0.848604f,0.898709f,0.948525f,0.998055f,0.952698f,0.903729f,0.855038f,0.806619f,
0.758470f,0.710588f,0.662971f,0.615614f,0.568516f,0.521674f,0.475084f,0.428744f,0.382652f,0.336804f,
0.291199f,0.245834f,0.200705f,0.155811f,0.111150f,0.066718f,0.022514f,0.047302f,0.096271f,0.144962f,
0.193381f,0.241530f,0.289412f,0.337029f,0.384386f,0.431484f,0.478326f,0.524916f,0.571256f,0.617348f,
0.663196f,0.708801f,0.754166f,0.799295f,0.844189f,0.888850f,0.933282f,0.977486f,0.978535f,0.934779f,
0.891243f,0.847926f,0.804826f,0.761939f,0.719265f,0.676800f,0.634543f,0.592492f,0.550645f,0.508999f,
0.467554f,0.426307f,0.385255f,0.344399f,0.303734f,0.263260f,0.222975f,0.182877f,0.142965f,0.103236f,
0.063689f,0.024323f,0.021465f,0.065221f,0.108757f,0.152074f,0.195174f,0.238061f,0.280735f,0.323200f,
0.365457f,0.407508f,0.449355f,0.491001f,0.532446f,0.573693f,0.614745f,0.655601f,0.696266f,0.736740f,
0.777025f,0.817123f,0.857035f,0.896764f,0.936311f,0.975677f,0.985135f,0.946124f,0.907289f,0.868628f,
0.830139f,0.791821f,0.753672f,0.715691f,0.677876f,0.640227f,0.602740f,0.565416f,0.528253f,0.491249f,
0.454402f,0.417713f,0.381178f,0.344798f,0.308570f,0.272494f,0.236568f,0.200790f,0.165161f,0.129678f,
0.094340f,0.059146f,0.024095f,0.014865f,0.053876f,0.092711f,0.131372f,0.169861f,0.208179f,0.246328f,
0.284309f,0.322124f,0.359773f,0.397260f,0.434584f,0.471747f,0.508751f,0.545597f,0.582287f,0.618822f,
0.655202f,0.691430f,0.727506f,0.763432f,0.799210f,0.834839f,0.870322f,0.905660f,0.940854f,0.975905f,
0.989185f,0.954417f,0.919787f,0.885297f,0.850943f,0.816725f,0.782643f,0.748695f,0.714879f,0.681196f,
0.647643f,0.614221f,0.580927f,0.547761f,0.514722f,0.481809f,0.449021f,0.416357f,0.383817f,0.351398f,
0.319101f,0.286924f,0.254866f,0.222928f,0.191107f,0.159402f,0.127814f,0.096341f,0.064982f,0.033737f,
0.002604f,0.010815f,0.045583f,0.080213f,0.114703f,0.149057f,0.183275f,0.217357f,0.251305f,0.285121f,
0.318804f,0.352357f,0.385779f,0.419073f,0.452239f,0.485278f,0.518191f,0.550979f,0.583643f,0.616183f,
0.648602f,0.680899f,0.713076f,0.745134f,0.777072f,0.808893f,0.840598f,0.872186f,0.903659f,0.935018f,
0.966263f,0.997396f,0.971584f,0.940674f,0.909875f,0.879185f,0.848604f,0.818130f,0.787764f,0.757505f,
0.727351f,0.697302f,0.667357f,0.637516f,0.607777f,0.578141f,0.548606f,0.519172f,0.489838f,0.460603f,
0.431467f,0.402428f,0.373487f,0.344643f,0.315895f,0.287242f,0.258684f,0.230221f,0.201850f,0.173573f,
0.145388f,0.117295f,0.089293f,0.061381f,0.033559f,0.005827f,0.028416f,0.059326f,0.090125f,0.120815f,
0.151396f,0.181870f,0.212236f,0.242495f,0.272649f,0.302698f,0.332643f,0.362484f,0.392223f,0.421859f,
0.451394f,0.480828f,0.510162f,0.539397f,0.568533f,0.597572f,0.626513f,0.655357f,0.684105f,0.712758f,
0.741315f,0.769779f,0.798150f,0.826427f,0.854612f,0.882705f,0.910707f,0.938619f,0.966441f,0.994173f,
0.978184f,0.950628f,0.923161f,0.895780f,0.868486f,0.841279f,0.814156f,0.787119f,0.760166f,0.733296f,
0.706511f,0.679808f,0.653187f,0.626648f,0.600191f,0.573814f,0.547518f,0.521302f,0.495165f,0.469106f,
0.443127f,0.417225f,0.391401f,0.365653f,0.339983f,0.314388f,0.288869f,0.263425f,0.238056f,0.212762f,
0.187541f,0.162394f,0.137319f,0.112318f,0.087388f,0.062531f,0.037744f,0.013029f,0.021816f,0.049372f,
0.076839f,0.104220f,0.131514f,0.158721f,0.185844f,0.212881f,0.239834f,0.266704f,0.293489f,0.320192f,
0.346813f,0.373352f,0.399809f,0.426186f,0.452482f,0.478698f,0.504835f,0.530894f,0.556873f,0.582775f,
0.608599f,0.634347f,0.660017f,0.685612f,0.711131f,0.736575f,0.761944f,0.787238f,0.812459f,0.837606f,
0.862681f,0.887682f,0.912612f,0.937469f,0.962256f,0.986971f,0.988384f,0.963810f,0.939305f,0.914869f,
0.890503f,0.866205f,0.841975f,0.817813f,0.793719f,0.769691f,0.745730f,0.721836f,0.698008f,0.674245f,
0.650547f,0.626914f,0.603346f,0.579842f,0.556401f,0.533025f,0.509711f,0.486460f,0.463272f,0.440145f,
0.417081f,0.394078f,0.371136f,0.348254f,0.325434f,0.302673f,0.279973f,0.257332f,0.234750f,0.212227f,
0.189762f,0.167356f,0.145008f,0.122718f,0.100485f,0.078309f,0.056190f,0.034127f,0.012121f,0.011616f,
0.036190f,0.060695f,0.085131f,0.109497f,0.133795f,0.158025f,0.182187f,0.206281f,0.230309f,0.254270f,
0.278164f,0.301992f,0.325755f,0.349453f,0.373086f,0.396654f,0.420158f,0.443599f,0.466975f,0.490289f,
0.513540f,0.536728f,0.559855f,0.582919f,0.605922f,0.628864f,0.651745f,0.674566f,0.697327f,0.720027f,
0.742669f,0.765250f,0.787773f,0.810238f,0.832644f,0.854992f,0.877282f,0.899515f,0.921691f,0.943810f,
0.965873f,0.987879f,0.990171f,0.968276f,0.946437f,0.924653f,0.902923f,0.881249f,0.859628f,0.838062f,
0.816549f,0.795090f,0.773684f,0.752330f,0.731030f,0.709782f,0.688586f,0.667442f,0.646350f,0.625309f,
0.604320f,0.583381f,0.562493f,0.541655f,0.520867f,0.500130f,0.479442f,0.458803f,0.438214f,0.417674f,
0.397182f,0.376740f,0.356345f,0.335998f,0.315700f,0.295448f,0.275245f,0.255088f,0.234978f,0.214916f,
0.194899f,0.174929f,0.155005f,0.135127f,0.115295f,0.095508f,0.075766f,0.056069f,0.036417f,0.016810f,
0.009829f,0.031724f,0.053563f,0.075347f,0.097077f,0.118751f,0.140372f,0.161938f,0.183451f,0.204910f,
0.226316f,0.247670f,0.268970f,0.290218f,0.311414f,0.332558f,0.353650f,0.374691f,0.395680f,0.416619f,
0.437507f,0.458345f,0.479133f,0.499870f,0.520558f,0.541197f,0.561786f,0.582326f,0.602817f,0.623260f,
0.643655f,0.664002f,0.684300f,0.704552f,0.724755f,0.744912f,0.765022f,0.785084f,0.805101f,0.825071f,
0.844995f,0.864873f,0.884705f,0.904492f,0.924234f,0.943931f,0.963583f,0.983190f,0.997247f,0.977729f,
0.958254f,0.938824f,0.919437f,0.900093f,0.880792f,0.861535f,0.842321f,0.823149f,0.804020f,0.784933f,
0.765888f,0.746885f,0.727923f,0.709004f,0.690125f,0.671288f,0.652492f,0.633737f,0.615022f,0.596348f,
0.577714f,0.559120f,0.540567f,0.522053f,0.503578f,0.485144f,0.466748f,0.448391f,0.430074f,0.411795f,
0.393555f,0.375353f,0.357190f,0.339065f,0.320977f,0.302928f,0.284916f,0.266942f,0.249005f,0.231105f,
0.213242f,0.195416f,0.177627f,0.159875f,0.142159f,0.124479f,0.106835f,0.089227f,0.071656f,0.054119f,
0.036619f,0.019154f,0.001724f,0.002753f,0.022271f,0.041746f,0.061176f,0.080564f,0.099907f,0.119208f,
0.138465f,0.157679f,0.176851f,0.195980f,0.215067f,0.234112f,0.253115f,0.272077f,0.290996f,0.309875f,
0.328712f,0.347508f,0.366263f,0.384978f,0.403652f,0.422286f,0.440880f,0.459433f,0.477947f,0.496422f,
0.514856f,0.533252f,0.551609f,0.569926f,0.588205f,0.606445f,0.624647f,0.642810f,0.660935f,0.679023f,
0.697072f,0.715084f,0.733058f,0.750995f,0.768895f,0.786758f,0.804583f,0.822373f,0.840125f,0.857841f,
0.875521f,0.893165f,0.910773f,0.928344f,0.945881f,0.963381f,0.980846f,0.998276f,0.984329f,0.966969f,
0.949644f,0.932354f,0.915098f,0.897877f,0.880689f,0.863537f,0.846418f,0.829333f,0.812281f,0.795264f,
0.778279f,0.761329f,0.744411f,0.727526f,0.710675f,0.693856f,0.677070f,0.660317f,0.643596f,0.626907f,
0.610251f,0.593626f,0.577034f,0.560473f,0.543944f,0.527447f,0.510981f,0.494546f,0.478143f,0.461771f,
0.445430f,0.429119f,0.412840f,0.396591f,0.380372f,0.364184f,0.348027f,0.331899f,0.315802f,0.299734f,
0.283697f,0.267689f,0.251710f,0.235762f,0.219842f,0.203952f,0.188091f,0.172260f,0.156457f,0.140683f,
0.124938f,0.109221f,0.093533f,0.077874f,0.062243f,0.046640f,0.031065f,0.015519f,};
const q31_t mfcc_filter_coefs_config1_q31[NB_MFCC_FILTER_COEFS_CONFIG1_Q31]={
0x143E55E2,0x2A36894E,0x3FC118BE,0x54E235A5,0x699DD508,0x7DF7B3F1,0x6E0CA481,0x5A6BDB6A,0x4722C4C8,0x342E5E60,
0x218BCCEF,0x0F385996,0x11F35B7F,0x25942496,0x38DD3B38,0x4BD1A1A0,0x5E743311,0x70C7A66A,0x7D316F79,0x6B74998D,
0x59FF809A,0x48CFE95C,0x37E3B2CF,0x2738D49A,0x16CD5D93,0x069F726B,0x02CE9087,0x148B6673,0x26007F66,0x373016A4,
0x481C4D31,0x58C72B66,0x6932A26D,0x79608D95,0x76AD4C63,0x66F53828,0x577594B5,0x482CD255,0x391971AF,0x2A3A02E4,
0x1B8D24BD,0x0D1183E8,0x0952B39D,0x190AC7D8,0x288A6B4B,0x37D32DAB,0x46E68E51,0x55C5FD1C,0x6472DB43,0x72EE7C18,
0x7EC5DA3E,0x70A8EE16,0x62B991A5,0x54F6A269,0x475F0895,0x39F1B691,0x2CADA87B,0x1F91E3B0,0x129D765F,0x05CF771C,
0x013A25C2,0x0F5711EA,0x1D466E5B,0x2B095D97,0x38A0F76B,0x460E496F,0x53525785,0x606E1C50,0x6D6289A1,0x7A3088E4,
0x79270483,0x6CA344D9,0x604365B2,0x54069BA0,0x47EC21E5,0x3BF33A28,0x301B2C2E,0x24634599,0x18CAD9A9,0x0D5140FF,
0x01F5D966,0x06D8FB7D,0x135CBB27,0x1FBC9A4E,0x2BF96460,0x3813DE1B,0x440CC5D8,0x4FE4D3D2,0x5B9CBA67,0x67352657,
0x72AEBF01,0x7E0A269A,0x76B8059A,0x6B972D1C,0x6092BBF7,0x55AA229C,0x4ADCD5B0,0x402A4DE5,0x359207D0,0x2B1383C6,
0x20AE45B5,0x1661D504,0x0C2DBC71,0x021189F3,0x0947FA66,0x1468D2E4,0x1F6D4409,0x2A55DD64,0x35232A50,0x3FD5B21B,
0x4A6DF830,0x54EC7C3A,0x5F51BA4B,0x699E2AFC,0x73D2438F,0x7DEE760D,0x780CCE98,0x6E1F1E6F,0x64481067,0x5A873E38,
0x50DC444A,0x4746C19A,0x3DC657AA,0x345AAA61,0x2B036001,0x21C0210A,0x1890982D,0x0F747236,0x066B5DFD,0x07F33168,
0x11E0E191,0x1BB7EF99,0x2578C1C8,0x2F23BBB6,0x38B93E66,0x4239A856,0x4BA5559F,0x54FC9FFF,0x5E3FDEF6,0x676F67D3,
0x708B8DCA,0x7994A203,0x7D750C51,0x74912FEC,0x6BBF7D62,0x62FFAB10,0x5A517110,0x51B4892C,0x4928AECC,0x40AD9EEF,
0x3843181B,0x2FE8DA51,0x279EA704,0x1F64410C,0x17396C9E,0x0F1DEF3C,0x07118FB4,0x028AF3AF,0x0B6ED014,0x1440829E,
0x1D0054F0,0x25AE8EF0,0x2E4B76D4,0x36D75134,0x3F526111,0x47BCE7E5,0x501725AF,0x586158FC,0x609BBEF4,0x68C69362,
0x70E210C4,0x78EE704C,0x7F14160F,0x77254B89,0x6F44FA8D,0x6772EEA7,0x5FAEF480,0x57F8D9D2,0x50506D65,0x48B57F02,
0x4127DF72,0x39A76073,0x3233D4B3,0x2ACD0FC8,0x2372E62C,0x1C252D35,0x14E3BB13,0x0DAE66C3,0x06850811,0x00EBE9F1,
0x08DAB477,0x10BB0573,0x188D1159,0x20510B80,0x2807262E,0x2FAF929B,0x374A80FE,0x3ED8208E,0x46589F8D,0x4DCC2B4D,
0x5532F038,0x5C8D19D4,0x63DAD2CB,0x6B1C44ED,0x7251993D,0x797AF7EF,0x7F67778F,0x78558E92,0x714F272A,0x6A541C20,
0x636448F0,0x5C7F89C5,0x55A5BB76,0x4ED6BB7D,0x481267FB,0x41589FAB,0x3AA941E6,0x34042E99,0x2D694646,0x26D869FD,
0x20517B5E,0x19D45C8E,0x1360F039,0x0CF7198E,0x0696BC3D,0x003FBC71,0x00988871,0x07AA716E,0x0EB0D8D6,0x15ABE3E0,
0x1C9BB710,0x2380763B,0x2A5A448A,0x31294483,0x37ED9805,0x3EA76055,0x4556BE1A,0x4BFBD167,0x5296B9BA,0x59279603,
0x5FAE84A2,0x662BA372,0x6C9F0FC7,0x7308E672,0x796943C3,0x7FC0438F,0x79F1FED0,0x73AD6875,0x6D71DEF3,0x673F484C,
0x61158AF2,0x5AF48DC5,0x54DC380F,0x4ECC7180,0x48C52230,0x42C6329B,0x3CCF8B9E,0x36E11674,0x30FABCB6,0x2B1C685A,
0x254603AE,0x1F777956,0x19B0B450,0x13F19FEA,0x0E3A27C5,0x088A37D5,0x02E1BC59,0x060E0130,0x0C52978B,0x128E210D,
0x18C0B7B4,0x1EEA750E,0x250B723B,0x2B23C7F1,0x31338E80,0x373ADDD0,0x3D39CD65,0x43307462,0x491EE98C,0x4F05434A,
0x54E397A6,0x5AB9FC52,0x608886AA,0x664F4BB0,0x6C0E6016,0x71C5D83B,0x7775C82B,0x7D1E43A7,0x7D40A1E1,0x77A6D546,
0x721443AB,0x6C88DA7F,0x67048774,0x61873885,0x5C10DBF0,0x56A16036,0x5138B41B,0x4BD6C6A1,0x467B870B,0x4126E4DB,
0x3BD8CFCE,0x369137DD,0x31500D3C,0x2C154058,0x26E0C1D7,0x21B28296,0x1C8A73A8,0x17688655,0x124CAC19,0x0D36D6A5,
0x0826F7DB,0x031D01CE,0x02BF5E1F,0x08592ABA,0x0DEBBC55,0x13772581,0x18FB788C,0x1E78C77B,0x23EF2410,0x295E9FCA,
0x2EC74BE5,0x3429395F,0x398478F5,0x3ED91B25,0x44273032,0x496EC823,0x4EAFF2C4,0x53EABFA8,0x591F3E29,0x5E4D7D6A,
0x63758C58,0x689779AB,0x6DB353E7,0x72C9295B,0x77D90825,0x7CE2FE32,0x7E18E6C3,0x791A992E,0x74220BB1,0x6F2F311D,
0x6A41FC6F,0x655A60D3,0x6078519D,0x5B9BC24E,0x56C4A691,0x51F2F239,0x4D269943,0x485F8FD3,0x439DCA35,0x3EE13CDB,
0x3A29DC5C,0x35779D76,0x30CA750B,0x2C225820,0x277F3BDF,0x22E11594,0x1E47DAAC,0x19B380B7,0x1523FD66,0x1099468B,
0x0C135217,0x0792161B,0x031588C7,0x01E7193D,0x06E566D2,0x0BDDF44F,0x10D0CEE3,0x15BE0391,0x1AA59F2D,0x1F87AE63,
0x24643DB2,0x293B596F,0x2E0D0DC7,0x32D966BD,0x37A0702D,0x3C6235CB,0x411EC325,0x45D623A4,0x4A88628A,0x4F358AF5,
0x53DDA7E0,0x5880C421,0x5D1EEA6C,0x61B82554,0x664C7F49,0x6ADC029A,0x6F66B975,0x73ECADE9,0x786DE9E5,0x7CEA7739,
0x7E9DA069,0x7A2A536D,0x75BB985D,0x715165E1,0x6CEBB2BB,0x688A75CB,0x642DA60D,0x5FD53A96,0x5B812A98,0x57316D5F,
0x52E5FA50,0x4E9EC8EB,0x4A5BD0C8,0x461D0998,0x41E26B24,0x3DABED50,0x39798812,0x354B337E,0x3120E7B9,0x2CFA9D03,
0x28D84BAF,0x24B9EC29,0x209F76F1,0x1C88E49B,0x18762DD3,0x14674B57,0x105C35FC,0x0C54E6A8,0x08515657,0x04517E17,
0x0055570C,0x01625F97,0x05D5AC93,0x0A4467A3,0x0EAE9A1F,0x13144D45,0x17758A35,0x1BD259F3,0x202AC56A,0x247ED568,
0x28CE92A1,0x2D1A05B0,0x31613715,0x35A42F38,0x39E2F668,0x3E1D94DC,0x425412B0,0x468677EE,0x4AB4CC82,0x4EDF1847,
0x530562FD,0x5727B451,0x5B4613D7,0x5F60890F,0x63771B65,0x6789D22D,0x6B98B4A9,0x6FA3CA04,0x73AB1958,0x77AEA9A9,
0x7BAE81E9,0x7FAAA8F4,0x7C5CDA6A,0x78680179,0x7476C592,0x70892023,0x6C9F0AA9,0x68B87EB5,0x64D575E7,0x60F5E9F2,
0x5D19D499,0x59412FB1,0x556BF51D,0x519A1ED2,0x4DCBA6D5,0x4A00873A,0x4638BA25,0x427439C9,0x3EB30069,0x3AF50857,
0x373A4BF1,0x3382C5A8,0x2FCE6FF7,0x2C1D4569,0x286F4099,0x24C45C2C,0x211C92D7,0x1D77DF5C,0x19D63C8A,0x1637A53D,
0x129C145E,0x0F0384E2,0x0B6DF1CD,0x07DB562C,0x044BAD1A,0x00BEF1BE,0x03A32596,0x0797FE87,0x0B893A6E,0x0F76DFDD,
0x1360F557,0x1747814B,0x1B2A8A19,0x1F0A160E,0x22E62B67,0x26BED04F,0x2A940AE3,0x2E65E12E,0x3234592B,0x35FF78C6,
0x39C745DB,0x3D8BC637,0x414CFF97,0x450AF7A9,0x48C5B40F,0x4C7D3A58,0x50319009,0x53E2BA97,0x5790BF67,0x5B3BA3D4,
0x5EE36D29,0x628820A4,0x6629C376,0x69C85AC3,0x6D63EBA2,0x70FC7B1E,0x74920E33,0x7824A9D4,0x7BB452E6,0x7F410E42,
0x7D351F4C,0x79AE3102,0x762A222A,0x72A8EE1A,0x6F2A9033,0x6BAF03E1,0x6836449C,0x64C04DE5,0x614D1B4A,0x5DDCA863,
0x5A6EF0D0,0x5703F040,0x539BA269,0x5036030B,0x4CD30DF1,0x4972BEF0,0x461511E7,0x42BA02BE,0x3F618D66,0x3C0BADDA,
0x38B8601F,0x3567A041,0x32196A59,0x2ECDBA84,0x2B848CED,0x283DDDC3,0x24F9A940,0x21B7EBA7,0x1E78A143,0x1B3BC666,
0x1801576C,0x14C950B9,0x1193AEB7,0x0E606DDB,0x0B2F8AA0,0x08010189,0x04D4CF21,0x01AAEFFB,0x02CAE0B4,0x0651CEFE,
0x09D5DDD6,0x0D5711E6,0x10D56FCD,0x1450FC1F,0x17C9BB64,0x1B3FB21B,0x1EB2E4B6,0x2223579D,0x25910F30,0x28FC0FC0,
0x2C645D97,0x2FC9FCF5,0x332CF20F,0x368D4110,0x39EAEE19,0x3D45FD42,0x409E729A,0x43F45226,0x47479FE1,0x4A985FBF,
0x4DE695A7,0x5132457C,0x547B7313,0x57C2223D,0x5B0656C0,0x5E481459,0x61875EBD,0x64C4399A,0x67FEA894,0x6B36AF47,
0x6E6C5149,0x719F9225,0x74D07560,0x77FEFE77,0x7B2B30DF,0x7E551005,0x7E8360B0,0x7B5E1DE1,0x783B2438,0x751A7064,
0x71FBFF1D,0x6EDFCD21,0x6BC5D736,0x68AE1A27,0x659892C7,0x62853DF1,0x5F741885,0x5C651F6B,0x59584F90,0x564DA5E8,
0x53451F6F,0x503EB925,0x4D3A7011,0x4A384142,0x473829CB,0x443A26C5,0x413E3551,0x3E445295,0x3B4C7BBB,0x3856ADF6,
0x3562E67C,0x3271228B,0x2F815F65,0x2C939A53,0x29A7D0A1,0x26BDFFA3,0x23D624B2,0x20F03D2B,0x1E0C4672,0x1B2A3DEF,
0x184A210F,0x156BED45,0x128FA00A,0x0FB536D9,0x0CDCAF34,0x0A0606A3,0x07313AB0,0x045E48ED,0x018D2EEE,0x017C9F50,
0x04A1E21F,0x07C4DBC8,0x0AE58F9C,0x0E0400E3,0x112032DF,0x143A28CA,0x1751E5D9,0x1A676D39,0x1D7AC20F,0x208BE77B,
0x239AE095,0x26A7B070,0x29B25A18,0x2CBAE091,0x2FC146DB,0x32C58FEF,0x35C7BEBE,0x38C7D635,0x3BC5D93B,0x3EC1CAAF,
0x41BBAD6B,0x44B38445,0x47A9520A,0x4A9D1984,0x4D8EDD75,0x507EA09B,0x536C65AD,0x56582F5F,0x5942005D,0x5C29DB4E,
0x5F0FC2D5,0x61F3B98E,0x64D5C211,0x67B5DEF1,0x6A9412BB,0x6D705FF6,0x704AC927,0x732350CC,0x75F9F95D,0x78CEC550,
0x7BA1B713,0x7E72D112,0x7EBDEA4C,0x7BF078A8,0x7924D7A3,0x765B04E5,0x7392FE1B,0x70CCC0F6,0x6E084B2A,0x6B459A72,
0x6884AC8B,0x65C57F37,0x6308103D,0x604C5D68,0x5D926486,0x5ADA236B,0x582397EE,0x556EBFEA,0x52BB993F,0x500A21CF,
0x4D5A5782,0x4AAC3843,0x47FFC201,0x4554F2AE,0x42ABC841,0x400440B6,0x3D5E5A08,0x3ABA123B,0x38176754,0x3576575C,
0x32D6E05F,0x3039006E,0x2D9CB59C,0x2B01FE00,0x2868D7B5,0x25D140D9,0x233B378E,0x20A6B9F7,0x1E13C63E,0x1B825A8D,
0x18F27513,0x16641403,0x13D73590,0x114BD7F3,0x0EC1F968,0x0C39982D,0x09B2B284,0x072D46B1,0x04A952FB,0x0226D5AE,
0x014215B4,0x040F8758,0x06DB285D,0x09A4FB1B,0x0C6D01E5,0x0F333F0A,0x11F7B4D6,0x14BA658E,0x177B5375,0x1A3A80C9,
0x1CF7EFC3,0x1FB3A298,0x226D9B7A,0x2525DC95,0x27DC6812,0x2A914016,0x2D4466C1,0x2FF5DE31,0x32A5A87E,0x3553C7BD,
0x38003DFF,0x3AAB0D52,0x3D5437BF,0x3FFBBF4A,0x42A1A5F8,0x4545EDC5,0x47E898AC,0x4A89A8A4,0x4D291FA1,0x4FC6FF92,
0x52634A64,0x54FE0200,0x5797284B,0x5A2EBF27,0x5CC4C872,0x5F594609,0x61EC39C2,0x647DA573,0x670D8AED,0x699BEBFD,
0x6C28CA70,0x6EB4280D,0x713E0698,0x73C667D3,0x764D4D7C,0x78D2B94F,0x7B56AD05,0x7DD92A52,0x7FA5CD17,0x7D263787,
0x7AA81351,0x782B5ECB,0x75B0184F,0x73363E39,0x70BDCEE7,0x6E46C8BC,0x6BD12A1B,0x695CF16D,0x66EA1D1A,0x6478AB90,
0x62089B3E,0x5F99EA95,0x5D2C980B,0x5AC0A216,0x58560730,0x55ECC5D6,0x5384DC85,0x511E49C1,0x4EB90C0B,0x4C5521EB,
0x49F289EA,0x47914291,0x45314A70,0x42D2A016,0x40754215,0x3E192F02,0x3BBE6574,0x3964E404,0x370CA94D,0x34B5B3EE,
0x32600286,0x300B93B8,0x2DB86629,0x2B66787E,0x2915C961,0x26C6577D,0x2478217F,0x222B2616,0x1FDF63F4,0x1D94D9CC,
0x1B4B8653,0x19036841,0x16BC7E4F,0x1476C73A,0x123241BF,0x0FEEEC9D,0x0DACC696,0x0B6BCE6D,0x092C02E8,0x06ED62CE,
0x04AFECE8,0x0273A002,0x00387AE8,0x005A32E9,0x02D9C879,0x0557ECAF,0x07D4A135,0x0A4FE7B1,0x0CC9C1C7,0x0F423119,
0x11B93744,0x142ED5E5,0x16A30E93,0x1915E2E6,0x1B875470,0x1DF764C2,0x2066156B,0x22D367F5,0x253F5DEA,0x27A9F8D0,
0x2A133A2A,0x2C7B237B,0x2EE1B63F,0x3146F3F5,0x33AADE15,0x360D7616,0x386EBD6F,0x3ACEB590,0x3D2D5FEA,0x3F8ABDEB,
0x41E6D0FE,0x44419A8C,0x469B1BFC,0x48F356B3,0x4B4A4C12,0x4D9FFD7A,0x4FF46C48,0x524799D7,0x54998782,0x56EA369F,
0x5939A883,0x5B87DE81,0x5DD4D9EA,0x60209C0C,0x626B2634,0x64B479AD,0x66FC97BF,0x694381B1,0x6B8938C6,0x6DCDBE41,
0x70111363,0x7253396A,0x74943193,0x76D3FD18,0x79129D32,0x7B501318,0x7D8C5FFE,0x7FC78518,0x7DFE7C69,0x7BC5A357,
0x798DEE82,0x77575CC1,0x7521ECE8,0x72ED9DD1,0x70BA6E53,0x6E885D4C,0x6C576998,0x6A279215,0x67F8D5A6,0x65CB332B,
0x639EA989,0x617337A5,0x5F48DC67,0x5D1F96B8,0x5AF76583,0x58D047B3,0x56AA3C37,0x548541FD,0x526157F8,0x503E7D19,
0x4E1CB054,0x4BFBF0A0,0x49DC3CF4,0x47BD9448,0x459FF596,0x43835FDB,0x4167D213,0x3F4D4B3E,0x3D33CA5B,0x3B1B4E6D,
0x3903D675,0x36ED617A,0x34D7EE80,0x32C37C90,0x30B00AB1,0x2E9D97EE,0x2C8C2353,0x2A7BABED,0x286C30C9,0x265DB0F8,
0x24502B8A,0x22439F92,0x20380C22,0x1E2D7052,0x1C23CB35,0x1A1B1BE4,0x18136178,0x160C9B0B,0x1406C7B8,0x1201E69B,
0x0FFDF6D3,0x0DFAF77E,0x0BF8E7BD,0x09F7C6B2,0x07F7937E,0x05F84D47,0x03F9F330,0x01FC8461,};
const q15_t mfcc_filter_coefs_config1_q15[NB_MFCC_FILTER_COEFS_CONFIG1_Q15]={
0x143E,0x2A37,0x3FC1,0x54E2,0x699E,0x7DF8,0x6E0D,0x5A6C,0x4723,0x342E,
0x218C,0x0F38,0x11F3,0x2594,0x38DD,0x4BD2,0x5E74,0x70C8,0x7D31,0x6B75,
0x5A00,0x48D0,0x37E4,0x2739,0x16CD,0x069F,0x02CF,0x148B,0x2600,0x3730,
0x481C,0x58C7,0x6933,0x7961,0x76AD,0x66F5,0x5776,0x482D,0x3919,0x2A3A,
0x1B8D,0x0D12,0x0953,0x190B,0x288A,0x37D3,0x46E7,0x55C6,0x6473,0x72EE,
0x7EC6,0x70A9,0x62BA,0x54F7,0x475F,0x39F2,0x2CAE,0x1F92,0x129D,0x05CF,
0x013A,0x0F57,0x1D46,0x2B09,0x38A1,0x460E,0x5352,0x606E,0x6D63,0x7A31,
0x7927,0x6CA3,0x6043,0x5407,0x47EC,0x3BF3,0x301B,0x2463,0x18CB,0x0D51,
0x01F6,0x06D9,0x135D,0x1FBD,0x2BF9,0x3814,0x440D,0x4FE5,0x5B9D,0x6735,
0x72AF,0x7E0A,0x76B8,0x6B97,0x6093,0x55AA,0x4ADD,0x402A,0x3592,0x2B14,
0x20AE,0x1662,0x0C2E,0x0212,0x0948,0x1469,0x1F6D,0x2A56,0x3523,0x3FD6,
0x4A6E,0x54EC,0x5F52,0x699E,0x73D2,0x7DEE,0x780D,0x6E1F,0x6448,0x5A87,
0x50DC,0x4747,0x3DC6,0x345B,0x2B03,0x21C0,0x1891,0x0F74,0x066B,0x07F3,
0x11E1,0x1BB8,0x2579,0x2F24,0x38B9,0x423A,0x4BA5,0x54FD,0x5E40,0x676F,
0x708C,0x7995,0x7D75,0x7491,0x6BBF,0x6300,0x5A51,0x51B5,0x4929,0x40AE,
0x3843,0x2FE9,0x279F,0x1F64,0x1739,0x0F1E,0x0712,0x028B,0x0B6F,0x1441,
0x1D00,0x25AF,0x2E4B,0x36D7,0x3F52,0x47BD,0x5017,0x5861,0x609C,0x68C7,
0x70E2,0x78EE,0x7F14,0x7725,0x6F45,0x6773,0x5FAF,0x57F9,0x5050,0x48B5,
0x4128,0x39A7,0x3234,0x2ACD,0x2373,0x1C25,0x14E4,0x0DAE,0x0685,0x00EC,
0x08DB,0x10BB,0x188D,0x2051,0x2807,0x2FB0,0x374B,0x3ED8,0x4659,0x4DCC,
0x5533,0x5C8D,0x63DB,0x6B1C,0x7252,0x797B,0x7F67,0x7856,0x714F,0x6A54,
0x6364,0x5C80,0x55A6,0x4ED7,0x4812,0x4159,0x3AA9,0x3404,0x2D69,0x26D8,
0x2051,0x19D4,0x1361,0x0CF7,0x0697,0x0040,0x0099,0x07AA,0x0EB1,0x15AC,
0x1C9C,0x2380,0x2A5A,0x3129,0x37EE,0x3EA7,0x4557,0x4BFC,0x5297,0x5928,
0x5FAF,0x662C,0x6C9F,0x7309,0x7969,0x7FC0,0x79F2,0x73AD,0x6D72,0x673F,
0x6116,0x5AF5,0x54DC,0x4ECC,0x48C5,0x42C6,0x3CD0,0x36E1,0x30FB,0x2B1C,
0x2546,0x1F77,0x19B1,0x13F2,0x0E3A,0x088A,0x02E2,0x060E,0x0C53,0x128E,
0x18C1,0x1EEA,0x250B,0x2B24,0x3134,0x373B,0x3D3A,0x4330,0x491F,0x4F05,
0x54E4,0x5ABA,0x6089,0x664F,0x6C0E,0x71C6,0x7776,0x7D1E,0x7D41,0x77A7,
0x7214,0x6C89,0x6705,0x6187,0x5C11,0x56A1,0x5139,0x4BD7,0x467C,0x4127,
0x3BD9,0x3691,0x3150,0x2C15,0x26E1,0x21B3,0x1C8A,0x1769,0x124D,0x0D37,
0x0827,0x031D,0x02BF,0x0859,0x0DEC,0x1377,0x18FB,0x1E79,0x23EF,0x295F,
0x2EC7,0x3429,0x3984,0x3ED9,0x4427,0x496F,0x4EB0,0x53EB,0x591F,0x5E4D,
0x6376,0x6897,0x6DB3,0x72C9,0x77D9,0x7CE3,0x7E19,0x791B,0x7422,0x6F2F,
0x6A42,0x655A,0x6078,0x5B9C,0x56C5,0x51F3,0x4D27,0x4860,0x439E,0x3EE1,
0x3A2A,0x3578,0x30CA,0x2C22,0x277F,0x22E1,0x1E48,0x19B4,0x1524,0x1099,
0x0C13,0x0792,0x0316,0x01E7,0x06E5,0x0BDE,0x10D1,0x15BE,0x1AA6,0x1F88,
0x2464,0x293B,0x2E0D,0x32D9,0x37A0,0x3C62,0x411F,0x45D6,0x4A88,0x4F36,
0x53DE,0x5881,0x5D1F,0x61B8,0x664C,0x6ADC,0x6F67,0x73ED,0x786E,0x7CEA,
0x7E9E,0x7A2A,0x75BC,0x7151,0x6CEC,0x688A,0x642E,0x5FD5,0x5B81,0x5731,
0x52E6,0x4E9F,0x4A5C,0x461D,0x41E2,0x3DAC,0x397A,0x354B,0x3121,0x2CFB,
0x28D8,0x24BA,0x209F,0x1C89,0x1876,0x1467,0x105C,0x0C55,0x0851,0x0451,
0x0055,0x0162,0x05D6,0x0A44,0x0EAF,0x1314,0x1776,0x1BD2,0x202B,0x247F,
0x28CF,0x2D1A,0x3161,0x35A4,0x39E3,0x3E1E,0x4254,0x4686,0x4AB5,0x4EDF,
0x5305,0x5728,0x5B46,0x5F61,0x6377,0x678A,0x6B99,0x6FA4,0x73AB,0x77AF,
0x7BAF,0x7FAB,0x7C5D,0x7868,0x7477,0x7089,0x6C9F,0x68B8,0x64D5,0x60F6,
0x5D1A,0x5941,0x556C,0x519A,0x4DCC,0x4A01,0x4639,0x4274,0x3EB3,0x3AF5,
0x373A,0x3383,0x2FCE,0x2C1D,0x286F,0x24C4,0x211D,0x1D78,0x19D6,0x1638,
0x129C,0x0F04,0x0B6E,0x07DB,0x044C,0x00BF,0x03A3,0x0798,0x0B89,0x0F77,
0x1361,0x1748,0x1B2B,0x1F0A,0x22E6,0x26BF,0x2A94,0x2E66,0x3234,0x35FF,
0x39C7,0x3D8C,0x414D,0x450B,0x48C6,0x4C7D,0x5032,0x53E3,0x5791,0x5B3C,
0x5EE3,0x6288,0x662A,0x69C8,0x6D64,0x70FC,0x7492,0x7825,0x7BB4,0x7F41,
0x7D35,0x79AE,0x762A,0x72A9,0x6F2B,0x6BAF,0x6836,0x64C0,0x614D,0x5DDD,
0x5A6F,0x5704,0x539C,0x5036,0x4CD3,0x4973,0x4615,0x42BA,0x3F62,0x3C0C,
0x38B8,0x3568,0x3219,0x2ECE,0x2B85,0x283E,0x24FA,0x21B8,0x1E79,0x1B3C,
0x1801,0x14C9,0x1194,0x0E60,0x0B30,0x0801,0x04D5,0x01AB,0x02CB,0x0652,
0x09D6,0x0D57,0x10D5,0x1451,0x17CA,0x1B40,0x1EB3,0x2223,0x2591,0x28FC,
0x2C64,0x2FCA,0x332D,0x368D,0x39EB,0x3D46,0x409E,0x43F4,0x4748,0x4A98,
0x4DE7,0x5132,0x547B,0x57C2,0x5B06,0x5E48,0x6187,0x64C4,0x67FF,0x6B37,
0x6E6C,0x71A0,0x74D0,0x77FF,0x7B2B,0x7E55,0x7E83,0x7B5E,0x783B,0x751A,
0x71FC,0x6EE0,0x6BC6,0x68AE,0x6599,0x6285,0x5F74,0x5C65,0x5958,0x564E,
0x5345,0x503F,0x4D3A,0x4A38,0x4738,0x443A,0x413E,0x3E44,0x3B4C,0x3857,
0x3563,0x3271,0x2F81,0x2C94,0x29A8,0x26BE,0x23D6,0x20F0,0x1E0C,0x1B2A,
0x184A,0x156C,0x1290,0x0FB5,0x0CDD,0x0A06,0x0731,0x045E,0x018D,0x017D,
0x04A2,0x07C5,0x0AE6,0x0E04,0x1120,0x143A,0x1752,0x1A67,0x1D7B,0x208C,
0x239B,0x26A8,0x29B2,0x2CBB,0x2FC1,0x32C6,0x35C8,0x38C8,0x3BC6,0x3EC2,
0x41BC,0x44B4,0x47A9,0x4A9D,0x4D8F,0x507F,0x536C,0x5658,0x5942,0x5C2A,
0x5F10,0x61F4,0x64D6,0x67B6,0x6A94,0x6D70,0x704B,0x7323,0x75FA,0x78CF,
0x7BA2,0x7E73,0x7EBE,0x7BF0,0x7925,0x765B,0x7393,0x70CD,0x6E08,0x6B46,
0x6885,0x65C5,0x6308,0x604C,0x5D92,0x5ADA,0x5824,0x556F,0x52BC,0x500A,
0x4D5A,0x4AAC,0x4800,0x4555,0x42AC,0x4004,0x3D5E,0x3ABA,0x3817,0x3576,
0x32D7,0x3039,0x2D9D,0x2B02,0x2869,0x25D1,0x233B,0x20A7,0x1E14,0x1B82,
0x18F2,0x1664,0x13D7,0x114C,0x0EC2,0x0C3A,0x09B3,0x072D,0x04A9,0x0227,
0x0142,0x0410,0x06DB,0x09A5,0x0C6D,0x0F33,0x11F8,0x14BA,0x177B,0x1A3B,
0x1CF8,0x1FB4,0x226E,0x2526,0x27DC,0x2A91,0x2D44,0x2FF6,0x32A6,0x3554,
0x3800,0x3AAB,0x3D54,0x3FFC,0x42A2,0x4546,0x47E9,0x4A8A,0x4D29,0x4FC7,
0x5263,0x54FE,0x5797,0x5A2F,0x5CC5,0x5F59,0x61EC,0x647E,0x670E,0x699C,
0x6C29,0x6EB4,0x713E,0x73C6,0x764D,0x78D3,0x7B57,0x7DD9,0x7FA6,0x7D26,
0x7AA8,0x782B,0x75B0,0x7336,0x70BE,0x6E47,0x6BD1,0x695D,0x66EA,0x6479,
0x6209,0x5F9A,0x5D2D,0x5AC1,0x5856,0x55ED,0x5385,0x511E,0x4EB9,0x4C55,
0x49F3,0x4791,0x4531,0x42D3,0x4075,0x3E19,0x3BBE,0x3965,0x370D,0x34B6,
0x3260,0x300C,0x2DB8,0x2B66,0x2916,0x26C6,0x2478,0x222B,0x1FDF,0x1D95,
0x1B4C,0x1903,0x16BC,0x1477,0x1232,0x0FEF,0x0DAD,0x0B6C,0x092C,0x06ED,
0x04B0,0x0274,0x0038,0x005A,0x02DA,0x0558,0x07D5,0x0A50,0x0CCA,0x0F42,
0x11B9,0x142F,0x16A3,0x1916,0x1B87,0x1DF7,0x2066,0x22D3,0x253F,0x27AA,
0x2A13,0x2C7B,0x2EE2,0x3147,0x33AB,0x360D,0x386F,0x3ACF,0x3D2D,0x3F8B,
0x41E7,0x4442,0x469B,0x48F3,0x4B4A,0x4DA0,0x4FF4,0x5248,0x549A,0x56EA,
0x593A,0x5B88,0x5DD5,0x6021,0x626B,0x64B4,0x66FD,0x6944,0x6B89,0x6DCE,
0x7011,0x7253,0x7494,0x76D4,0x7913,0x7B50,0x7D8C,0x7FC8,0x7DFE,0x7BC6,
0x798E,0x7757,0x7522,0x72EE,0x70BA,0x6E88,0x6C57,0x6A28,0x67F9,0x65CB,
0x639F,0x6173,0x5F49,0x5D20,0x5AF7,0x58D0,0x56AA,0x5485,0x5261,0x503E,
0x4E1D,0x4BFC,0x49DC,0x47BE,0x45A0,0x4383,0x4168,0x3F4D,0x3D34,0x3B1B,
0x3904,0x36ED,0x34D8,0x32C3,0x30B0,0x2E9E,0x2C8C,0x2A7C,0x286C,0x265E,
0x2450,0x2244,0x2038,0x1E2D,0x1C24,0x1A1B,0x1813,0x160D,0x1407,0x1202,
0x0FFE,0x0DFB,0x0BF9,0x09F8,0x07F8,0x05F8,0x03FA,0x01FD,};
const float32_t mfcc_filter_coefs_config2_f32[NB_MFCC_FILTER_COEFS_CONFIG2_F32]={
0.329789f,0.663153f,0.984122f,0.706417f,0.407665f,0.118907f,0.293583f,0.592335f,0.881093f,0.839496f,
0.568845f,0.306422f,0.051741f,0.160504f,0.431155f,0.693578f,0.948259f,0.804358f,0.563868f,0.329895f,
0.102097f,0.195642f,0.436132f,0.670105f,0.897903f,0.880155f,0.663777f,0.452689f,0.246640f,0.045394f,
0.119845f,0.336223f,0.547311f,0.753360f,0.954606f,0.848733f,0.656452f,0.468360f,0.284280f,0.104042f,
0.151267f,0.343548f,0.531640f,0.715720f,0.895958f,0.927491f,0.754478f,0.584864f,0.418519f,0.255318f,
0.095146f,0.072509f,0.245522f,0.415136f,0.581481f,0.744682f,0.904854f,0.937891f,0.783449f,0.631722f,
0.482615f,0.336040f,0.191913f,0.050152f,0.062109f,0.216551f,0.368278f,0.517385f,0.663960f,0.808087f,
0.949848f,0.910681f,0.773427f,0.638322f,0.505298f,0.374294f,0.245247f,0.118101f,0.089319f,0.226573f,
0.361678f,0.494702f,0.625706f,0.754753f,0.881899f,0.992800f,0.869293f,0.747527f,0.627454f,0.509029f,
0.392207f,0.276944f,0.163200f,0.050935f,0.007200f,0.130707f,0.252473f,0.372546f,0.490971f,0.607793f,
0.723056f,0.836800f,0.949065f,0.940111f,0.830692f,0.722642f,0.615928f,0.510517f,0.406378f,0.303479f,
0.201793f,0.101291f,0.001945f,0.059889f,0.169308f,0.277358f,0.384072f,0.489483f,0.593622f,0.696521f,
0.798207f,0.898709f,0.998055f,0.903729f,0.806619f,0.710588f,0.615614f,0.521674f,0.428744f,0.336804f,
0.245834f,0.155811f,0.066718f,0.096271f,0.193381f,0.289412f,0.384386f,0.478326f,0.571256f,0.663196f,
0.754166f,0.844189f,0.933282f,0.978535f,0.891243f,0.804826f,0.719265f,0.634543f,0.550645f,0.467554f,
0.385255f,0.303734f,0.222975f,0.142965f,0.063689f,0.021465f,0.108757f,0.195174f,0.280735f,0.365457f,
0.449355f,0.532446f,0.614745f,0.696266f,0.777025f,0.857035f,0.936311f,0.985135f,0.907289f,0.830139f,
0.753672f,0.677876f,0.602740f,0.528253f,0.454402f,0.381178f,0.308570f,0.236568f,0.165161f,0.094340f,
0.024095f,0.014865f,0.092711f,0.169861f,0.246328f,0.322124f,0.397260f,0.471747f,0.545597f,0.618822f,
0.691430f,0.763432f,0.834839f,0.905660f,0.975905f,0.954417f,0.885297f,0.816725f,0.748695f,0.681196f,
0.614221f,0.547761f,0.481809f,0.416357f,0.351398f,0.286924f,0.222928f,0.159402f,0.096341f,0.033737f,
0.045583f,0.114703f,0.183275f,0.251305f,0.318804f,0.385779f,0.452239f,0.518191f,0.583643f,0.648602f,
0.713076f,0.777072f,0.840598f,0.903659f,0.966263f,0.971584f,0.909875f,0.848604f,0.787764f,0.727351f,
0.667357f,0.607777f,0.548606f,0.489838f,0.431467f,0.373487f,0.315895f,0.258684f,0.201850f,0.145388f,
0.089293f,0.033559f,0.028416f,0.090125f,0.151396f,0.212236f,0.272649f,0.332643f,0.392223f,0.451394f,
0.510162f,0.568533f,0.626513f,0.684105f,0.741315f,0.798150f,0.854612f,0.910707f,0.966441f,0.978184f,
0.923161f,0.868486f,0.814156f,0.760166f,0.706511f,0.653187f,0.600191f,0.547518f,0.495165f,0.443127f,
0.391401f,0.339983f,0.288869f,0.238056f,0.187541f,0.137319f,0.087388f,0.037744f,0.021816f,0.076839f,
0.131514f,0.185844f,0.239834f,0.293489f,0.346813f,0.399809f,0.452482f,0.504835f,0.556873f,0.608599f,
0.660017f,0.711131f,0.761944f,0.812459f,0.862681f,0.912612f,0.962256f,0.988384f,0.939305f,0.890503f,
0.841975f,0.793719f,0.745730f,0.698008f,0.650547f,0.603346f,0.556401f,0.509711f,0.463272f,0.417081f,
0.371136f,0.325434f,0.279973f,0.234750f,0.189762f,0.145008f,0.100485f,0.056190f,0.012121f,0.011616f,
0.060695f,0.109497f,0.158025f,0.206281f,0.254270f,0.301992f,0.349453f,0.396654f,0.443599f,0.490289f,
0.536728f,0.582919f,0.628864f,0.674566f,0.720027f,0.765250f,0.810238f,0.854992f,0.899515f,0.943810f,
0.987879f,0.968276f,0.924653f,0.881249f,0.838062f,0.795090f,0.752330f,0.709782f,0.667442f,0.625309f,
0.583381f,0.541655f,0.500130f,0.458803f,0.417674f,0.376740f,0.335998f,0.295448f,0.255088f,0.214916f,
0.174929f,0.135127f,0.095508f,0.056069f,0.016810f,0.031724f,0.075347f,0.118751f,0.161938f,0.204910f,
0.247670f,0.290218f,0.332558f,0.374691f,0.416619f,0.458345f,0.499870f,0.541197f,0.582326f,0.623260f,
0.664002f,0.704552f,0.744912f,0.785084f,0.825071f,0.864873f,0.904492f,0.943931f,0.983190f,0.977729f,
0.938824f,0.900093f,0.861535f,0.823149f,0.784933f,0.746885f,0.709004f,0.671288f,0.633737f,0.596348f,
0.559120f,0.522053f,0.485144f,0.448391f,0.411795f,0.375353f,0.339065f,0.302928f,0.266942f,0.231105f,
0.195416f,0.159875f,0.124479f,0.089227f,0.054119f,0.019154f,0.022271f,0.061176f,0.099907f,0.138465f,
0.176851f,0.215067f,0.253115f,0.290996f,0.328712f,0.366263f,0.403652f,0.440880f,0.477947f,0.514856f,
0.551609f,0.588205f,0.624647f,0.660935f,0.697072f,0.733058f,0.768895f,0.804583f,0.840125f,0.875521f,
0.910773f,0.945881f,0.980846f,0.984329f,0.949644f,0.915098f,0.880689f,0.846418f,0.812281f,0.778279f,
0.744411f,0.710675f,0.677070f,0.643596f,0.610251f,0.577034f,0.543944f,0.510981f,0.478143f,0.445430f,
0.412840f,0.380372f,0.348027f,0.315802f,0.283697f,0.251710f,0.219842f,0.188091f,0.156457f,0.124938f,
0.093533f,0.062243f,0.031065f,};
const q31_t mfcc_filter_coefs_config2_q31[NB_MFCC_FILTER_COEFS_CONFIG2_Q31]={
0x2A36894E,0x54E235A5,0x7DF7B3F1,0x5A6BDB6A,0x342E5E60,0x0F385996,0x25942496,0x4BD1A1A0,0x70C7A66A,0x6B74998D,
0x48CFE95C,0x2738D49A,0x069F726B,0x148B6673,0x373016A4,0x58C72B66,0x79608D95,0x66F53828,0x482CD255,0x2A3A02E4,
0x0D1183E8,0x190AC7D8,0x37D32DAB,0x55C5FD1C,0x72EE7C18,0x70A8EE16,0x54F6A269,0x39F1B691,0x1F91E3B0,0x05CF771C,
0x0F5711EA,0x2B095D97,0x460E496F,0x606E1C50,0x7A3088E4,0x6CA344D9,0x54069BA0,0x3BF33A28,0x24634599,0x0D5140FF,
0x135CBB27,0x2BF96460,0x440CC5D8,0x5B9CBA67,0x72AEBF01,0x76B8059A,0x6092BBF7,0x4ADCD5B0,0x359207D0,0x20AE45B5,
0x0C2DBC71,0x0947FA66,0x1F6D4409,0x35232A50,0x4A6DF830,0x5F51BA4B,0x73D2438F,0x780CCE98,0x64481067,0x50DC444A,
0x3DC657AA,0x2B036001,0x1890982D,0x066B5DFD,0x07F33168,0x1BB7EF99,0x2F23BBB6,0x4239A856,0x54FC9FFF,0x676F67D3,
0x7994A203,0x74912FEC,0x62FFAB10,0x51B4892C,0x40AD9EEF,0x2FE8DA51,0x1F64410C,0x0F1DEF3C,0x0B6ED014,0x1D0054F0,
0x2E4B76D4,0x3F526111,0x501725AF,0x609BBEF4,0x70E210C4,0x7F14160F,0x6F44FA8D,0x5FAEF480,0x50506D65,0x4127DF72,
0x3233D4B3,0x2372E62C,0x14E3BB13,0x06850811,0x00EBE9F1,0x10BB0573,0x20510B80,0x2FAF929B,0x3ED8208E,0x4DCC2B4D,
0x5C8D19D4,0x6B1C44ED,0x797AF7EF,0x78558E92,0x6A541C20,0x5C7F89C5,0x4ED6BB7D,0x41589FAB,0x34042E99,0x26D869FD,
0x19D45C8E,0x0CF7198E,0x003FBC71,0x07AA716E,0x15ABE3E0,0x2380763B,0x31294483,0x3EA76055,0x4BFBD167,0x59279603,
0x662BA372,0x7308E672,0x7FC0438F,0x73AD6875,0x673F484C,0x5AF48DC5,0x4ECC7180,0x42C6329B,0x36E11674,0x2B1C685A,
0x1F777956,0x13F19FEA,0x088A37D5,0x0C52978B,0x18C0B7B4,0x250B723B,0x31338E80,0x3D39CD65,0x491EE98C,0x54E397A6,
0x608886AA,0x6C0E6016,0x7775C82B,0x7D40A1E1,0x721443AB,0x67048774,0x5C10DBF0,0x5138B41B,0x467B870B,0x3BD8CFCE,
0x31500D3C,0x26E0C1D7,0x1C8A73A8,0x124CAC19,0x0826F7DB,0x02BF5E1F,0x0DEBBC55,0x18FB788C,0x23EF2410,0x2EC74BE5,
0x398478F5,0x44273032,0x4EAFF2C4,0x591F3E29,0x63758C58,0x6DB353E7,0x77D90825,0x7E18E6C3,0x74220BB1,0x6A41FC6F,
0x6078519D,0x56C4A691,0x4D269943,0x439DCA35,0x3A29DC5C,0x30CA750B,0x277F3BDF,0x1E47DAAC,0x1523FD66,0x0C135217,
0x031588C7,0x01E7193D,0x0BDDF44F,0x15BE0391,0x1F87AE63,0x293B596F,0x32D966BD,0x3C6235CB,0x45D623A4,0x4F358AF5,
0x5880C421,0x61B82554,0x6ADC029A,0x73ECADE9,0x7CEA7739,0x7A2A536D,0x715165E1,0x688A75CB,0x5FD53A96,0x57316D5F,
0x4E9EC8EB,0x461D0998,0x3DABED50,0x354B337E,0x2CFA9D03,0x24B9EC29,0x1C88E49B,0x14674B57,0x0C54E6A8,0x04517E17,
0x05D5AC93,0x0EAE9A1F,0x17758A35,0x202AC56A,0x28CE92A1,0x31613715,0x39E2F668,0x425412B0,0x4AB4CC82,0x530562FD,
0x5B4613D7,0x63771B65,0x6B98B4A9,0x73AB1958,0x7BAE81E9,0x7C5CDA6A,0x7476C592,0x6C9F0AA9,0x64D575E7,0x5D19D499,
0x556BF51D,0x4DCBA6D5,0x4638BA25,0x3EB30069,0x373A4BF1,0x2FCE6FF7,0x286F4099,0x211C92D7,0x19D63C8A,0x129C145E,
0x0B6DF1CD,0x044BAD1A,0x03A32596,0x0B893A6E,0x1360F557,0x1B2A8A19,0x22E62B67,0x2A940AE3,0x3234592B,0x39C745DB,
0x414CFF97,0x48C5B40F,0x50319009,0x5790BF67,0x5EE36D29,0x6629C376,0x6D63EBA2,0x74920E33,0x7BB452E6,0x7D351F4C,
0x762A222A,0x6F2A9033,0x6836449C,0x614D1B4A,0x5A6EF0D0,0x539BA269,0x4CD30DF1,0x461511E7,0x3F618D66,0x38B8601F,
0x32196A59,0x2B848CED,0x24F9A940,0x1E78A143,0x1801576C,0x1193AEB7,0x0B2F8AA0,0x04D4CF21,0x02CAE0B4,0x09D5DDD6,
0x10D56FCD,0x17C9BB64,0x1EB2E4B6,0x25910F30,0x2C645D97,0x332CF20F,0x39EAEE19,0x409E729A,0x47479FE1,0x4DE695A7,
0x547B7313,0x5B0656C0,0x61875EBD,0x67FEA894,0x6E6C5149,0x74D07560,0x7B2B30DF,0x7E8360B0,0x783B2438,0x71FBFF1D,
0x6BC5D736,0x659892C7,0x5F741885,0x59584F90,0x53451F6F,0x4D3A7011,0x473829CB,0x413E3551,0x3B4C7BBB,0x3562E67C,
0x2F815F65,0x29A7D0A1,0x23D624B2,0x1E0C4672,0x184A210F,0x128FA00A,0x0CDCAF34,0x07313AB0,0x018D2EEE,0x017C9F50,
0x07C4DBC8,0x0E0400E3,0x143A28CA,0x1A676D39,0x208BE77B,0x26A7B070,0x2CBAE091,0x32C58FEF,0x38C7D635,0x3EC1CAAF,
0x44B38445,0x4A9D1984,0x507EA09B,0x56582F5F,0x5C29DB4E,0x61F3B98E,0x67B5DEF1,0x6D705FF6,0x732350CC,0x78CEC550,
0x7E72D112,0x7BF078A8,0x765B04E5,0x70CCC0F6,0x6B459A72,0x65C57F37,0x604C5D68,0x5ADA236B,0x556EBFEA,0x500A21CF,
0x4AAC3843,0x4554F2AE,0x400440B6,0x3ABA123B,0x3576575C,0x3039006E,0x2B01FE00,0x25D140D9,0x20A6B9F7,0x1B825A8D,
0x16641403,0x114BD7F3,0x0C39982D,0x072D46B1,0x0226D5AE,0x040F8758,0x09A4FB1B,0x0F333F0A,0x14BA658E,0x1A3A80C9,
0x1FB3A298,0x2525DC95,0x2A914016,0x2FF5DE31,0x3553C7BD,0x3AAB0D52,0x3FFBBF4A,0x4545EDC5,0x4A89A8A4,0x4FC6FF92,
0x54FE0200,0x5A2EBF27,0x5F594609,0x647DA573,0x699BEBFD,0x6EB4280D,0x73C667D3,0x78D2B94F,0x7DD92A52,0x7D263787,
0x782B5ECB,0x73363E39,0x6E46C8BC,0x695CF16D,0x6478AB90,0x5F99EA95,0x5AC0A216,0x55ECC5D6,0x511E49C1,0x4C5521EB,
0x47914291,0x42D2A016,0x3E192F02,0x3964E404,0x34B5B3EE,0x300B93B8,0x2B66787E,0x26C6577D,0x222B2616,0x1D94D9CC,
0x19036841,0x1476C73A,0x0FEEEC9D,0x0B6BCE6D,0x06ED62CE,0x0273A002,0x02D9C879,0x07D4A135,0x0CC9C1C7,0x11B93744,
0x16A30E93,0x1B875470,0x2066156B,0x253F5DEA,0x2A133A2A,0x2EE1B63F,0x33AADE15,0x386EBD6F,0x3D2D5FEA,0x41E6D0FE,
0x469B1BFC,0x4B4A4C12,0x4FF46C48,0x54998782,0x5939A883,0x5DD4D9EA,0x626B2634,0x66FC97BF,0x6B8938C6,0x70111363,
0x74943193,0x79129D32,0x7D8C5FFE,0x7DFE7C69,0x798DEE82,0x7521ECE8,0x70BA6E53,0x6C576998,0x67F8D5A6,0x639EA989,
0x5F48DC67,0x5AF76583,0x56AA3C37,0x526157F8,0x4E1CB054,0x49DC3CF4,0x459FF596,0x4167D213,0x3D33CA5B,0x3903D675,
0x34D7EE80,0x30B00AB1,0x2C8C2353,0x286C30C9,0x24502B8A,0x20380C22,0x1C23CB35,0x18136178,0x1406C7B8,0x0FFDF6D3,
0x0BF8E7BD,0x07F7937E,0x03F9F330,};
const q15_t mfcc_filter_coefs_config2_q15[NB_MFCC_FILTER_COEFS_CONFIG2_Q15]={
0x2A37,0x54E2,0x7DF8,0x5A6C,0x342E,0x0F38,0x2594,0x4BD2,0x70C8,0x6B75,
0x48D0,0x2739,0x069F,0x148B,0x3730,0x58C7,0x7961,0x66F5,0x482D,0x2A3A,
0x0D12,0x190B,0x37D3,0x55C6,0x72EE,0x70A9,0x54F7,0x39F2,0x1F92,0x05CF,
0x0F57,0x2B09,0x460E,0x606E,0x7A31,0x6CA3,0x5407,0x3BF3,0x2463,0x0D51,
0x135D,0x2BF9,0x440D,0x5B9D,0x72AF,0x76B8,0x6093,0x4ADD,0x3592,0x20AE,
0x0C2E,0x0948,0x1F6D,0x3523,0x4A6E,0x5F52,0x73D2,0x780D,0x6448,0x50DC,
0x3DC6,0x2B03,0x1891,0x066B,0x07F3,0x1BB8,0x2F24,0x423A,0x54FD,0x676F,
0x7995,0x7491,0x6300,0x51B5,0x40AE,0x2FE9,0x1F64,0x0F1E,0x0B6F,0x1D00,
0x2E4B,0x3F52,0x5017,0x609C,0x70E2,0x7F14,0x6F45,0x5FAF,0x5050,0x4128,
0x3234,0x2373,0x14E4,0x0685,0x00EC,0x10BB,0x2051,0x2FB0,0x3ED8,0x4DCC,
0x5C8D,0x6B1C,0x797B,0x7856,0x6A54,0x5C80,0x4ED7,0x4159,0x3404,0x26D8,
0x19D4,0x0CF7,0x0040,0x07AA,0x15AC,0x2380,0x3129,0x3EA7,0x4BFC,0x5928,
0x662C,0x7309,0x7FC0,0x73AD,0x673F,0x5AF5,0x4ECC,0x42C6,0x36E1,0x2B1C,
0x1F77,0x13F2,0x088A,0x0C53,0x18C1,0x250B,0x3134,0x3D3A,0x491F,0x54E4,
0x6089,0x6C0E,0x7776,0x7D41,0x7214,0x6705,0x5C11,0x5139,0x467C,0x3BD9,
0x3150,0x26E1,0x1C8A,0x124D,0x0827,0x02BF,0x0DEC,0x18FB,0x23EF,0x2EC7,
0x3984,0x4427,0x4EB0,0x591F,0x6376,0x6DB3,0x77D9,0x7E19,0x7422,0x6A42,
0x6078,0x56C5,0x4D27,0x439E,0x3A2A,0x30CA,0x277F,0x1E48,0x1524,0x0C13,
0x0316,0x01E7,0x0BDE,0x15BE,0x1F88,0x293B,0x32D9,0x3C62,0x45D6,0x4F36,
0x5881,0x61B8,0x6ADC,0x73ED,0x7CEA,0x7A2A,0x7151,0x688A,0x5FD5,0x5731,
0x4E9F,0x461D,0x3DAC,0x354B,0x2CFB,0x24BA,0x1C89,0x1467,0x0C55,0x0451,
0x05D6,0x0EAF,0x1776,0x202B,0x28CF,0x3161,0x39E3,0x4254,0x4AB5,0x5305,
0x5B46,0x6377,0x6B99,0x73AB,0x7BAF,0x7C5D,0x7477,0x6C9F,0x64D5,0x5D1A,
0x556C,0x4DCC,0x4639,0x3EB3,0x373A,0x2FCE,0x286F,0x211D,0x19D6,0x129C,
0x0B6E,0x044C,0x03A3,0x0B89,0x1361,0x1B2B,0x22E6,0x2A94,0x3234,0x39C7,
0x414D,0x48C6,0x5032,0x5791,0x5EE3,0x662A,0x6D64,0x7492,0x7BB4,0x7D35,
0x762A,0x6F2B,0x6836,0x614D,0x5A6F,0x539C,0x4CD3,0x4615,0x3F62,0x38B8,
0x3219,0x2B85,0x24FA,0x1E79,0x1801,0x1194,0x0B30,0x04D5,0x02CB,0x09D6,
0x10D5,0x17CA,0x1EB3,0x2591,0x2C64,0x332D,0x39EB,0x409E,0x4748,0x4DE7,
0x547B,0x5B06,0x6187,0x67FF,0x6E6C,0x74D0,0x7B2B,0x7E83,0x783B,0x71FC,
0x6BC6,0x6599,0x5F74,0x5958,0x5345,0x4D3A,0x4738,0x413E,0x3B4C,0x3563,
0x2F81,0x29A8,0x23D6,0x1E0C,0x184A,0x1290,0x0CDD,0x0731,0x018D,0x017D,
0x07C5,0x0E04,0x143A,0x1A67,0x208C,0x26A8,0x2CBB,0x32C6,0x38C8,0x3EC2,
0x44B4,0x4A9D,0x507F,0x5658,0x5C2A,0x61F4,0x67B6,0x6D70,0x7323,0x78CF,
0x7E73,0x7BF0,0x765B,0x70CD,0x6B46,0x65C5,0x604C,0x5ADA,0x556F,0x500A,
0x4AAC,0x4555,0x4004,0x3ABA,0x3576,0x3039,0x2B02,0x25D1,0x20A7,0x1B82,
0x1664,0x114C,0x0C3A,0x072D,0x0227,0x0410,0x09A5,0x0F33,0x14BA,0x1A3B,
0x1FB4,0x2526,0x2A91,0x2FF6,0x3554,0x3AAB,0x3FFC,0x4546,0x4A8A,0x4FC7,
0x54FE,0x5A2F,0x5F59,0x647E,0x699C,0x6EB4,0x73C6,0x78D3,0x7DD9,0x7D26,
0x782B,0x7336,0x6E47,0x695D,0x6479,0x5F9A,0x5AC1,0x55ED,0x511E,0x4C55,
0x4791,0x42D3,0x3E19,0x3965,0x34B6,0x300C,0x2B66,0x26C6,0x222B,0x1D95,
0x1903,0x1477,0x0FEF,0x0B6C,0x06ED,0x0274,0x02DA,0x07D5,0x0CCA,0x11B9,
0x16A3,0x1B87,0x2066,0x253F,0x2A13,0x2EE2,0x33AB,0x386F,0x3D2D,0x41E7,
0x469B,0x4B4A,0x4FF4,0x549A,0x593A,0x5DD5,0x626B,0x66FD,0x6B89,0x7011,
0x7494,0x7913,0x7D8C,0x7DFE,0x798E,0x7522,0x70BA,0x6C57,0x67F9,0x639F,
0x5F49,0x5AF7,0x56AA,0x5261,0x4E1D,0x49DC,0x45A0,0x4168,0x3D34,0x3904,
0x34D8,0x30B0,0x2C8C,0x286C,0x2450,0x2038,0x1C24,0x1813,0x1407,0x0FFE,
0x0BF9,0x07F8,0x03FA,};
const float32_t mfcc_filter_coefs_config3_f32[NB_MFCC_FILTER_COEFS_CONFIG3_F32]={
0.663153f,0.706417f,0.118907f,0.293583f,0.881093f,0.568845f,0.051741f,0.431155f,0.948259f,0.563868f,
0.102097f,0.436132f,0.897903f,0.663777f,0.246640f,0.336223f,0.753360f,0.848733f,0.468360f,0.104042f,
0.151267f,0.531640f,0.895958f,0.754478f,0.418519f,0.095146f,0.245522f,0.581481f,0.904854f,0.783449f,
0.482615f,0.191913f,0.216551f,0.517385f,0.808087f,0.910681f,0.638322f,0.374294f,0.118101f,0.089319f,
0.361678f,0.625706f,0.881899f,0.869293f,0.627454f,0.392207f,0.163200f,0.130707f,0.372546f,0.607793f,
0.836800f,0.940111f,0.722642f,0.510517f,0.303479f,0.101291f,0.059889f,0.277358f,0.489483f,0.696521f,
0.898709f,0.903729f,0.710588f,0.521674f,0.336804f,0.155811f,0.096271f,0.289412f,0.478326f,0.663196f,
0.844189f,0.978535f,0.804826f,0.634543f,0.467554f,0.303734f,0.142965f,0.021465f,0.195174f,0.365457f,
0.532446f,0.696266f,0.857035f,0.985135f,0.830139f,0.677876f,0.528253f,0.381178f,0.236568f,0.094340f,
0.014865f,0.169861f,0.322124f,0.471747f,0.618822f,0.763432f,0.905660f,0.954417f,0.816725f,0.681196f,
0.547761f,0.416357f,0.286924f,0.159402f,0.033737f,0.045583f,0.183275f,0.318804f,0.452239f,0.583643f,
0.713076f,0.840598f,0.966263f,0.909875f,0.787764f,0.667357f,0.548606f,0.431467f,0.315895f,0.201850f,
0.089293f,0.090125f,0.212236f,0.332643f,0.451394f,0.568533f,0.684105f,0.798150f,0.910707f,0.978184f,
0.868486f,0.760166f,0.653187f,0.547518f,0.443127f,0.339983f,0.238056f,0.137319f,0.037744f,0.021816f,
0.131514f,0.239834f,0.346813f,0.452482f,0.556873f,0.660017f,0.761944f,0.862681f,0.962256f,0.939305f,
0.841975f,0.745730f,0.650547f,0.556401f,0.463272f,0.371136f,0.279973f,0.189762f,0.100485f,0.012121f,
0.060695f,0.158025f,0.254270f,0.349453f,0.443599f,0.536728f,0.628864f,0.720027f,0.810238f,0.899515f,
0.987879f,0.924653f,0.838062f,0.752330f,0.667442f,0.583381f,0.500130f,0.417674f,0.335998f,0.255088f,
0.174929f,0.095508f,0.016810f,0.075347f,0.161938f,0.247670f,0.332558f,0.416619f,0.499870f,0.582326f,
0.664002f,0.744912f,0.825071f,0.904492f,0.983190f,0.938824f,0.861535f,0.784933f,0.709004f,0.633737f,
0.559120f,0.485144f,0.411795f,0.339065f,0.266942f,0.195416f,0.124479f,0.054119f,0.061176f,0.138465f,
0.215067f,0.290996f,0.366263f,0.440880f,0.514856f,0.588205f,0.660935f,0.733058f,0.804583f,0.875521f,
0.945881f,0.984329f,0.915098f,0.846418f,0.778279f,0.710675f,0.643596f,0.577034f,0.510981f,0.445430f,
0.380372f,0.315802f,0.251710f,0.188091f,0.124938f,0.062243f,};
const q31_t mfcc_filter_coefs_config3_q31[NB_MFCC_FILTER_COEFS_CONFIG3_Q31]={
0x54E235A5,0x5A6BDB6A,0x0F385996,0x25942496,0x70C7A66A,0x48CFE95C,0x069F726B,0x373016A4,0x79608D95,0x482CD255,
0x0D1183E8,0x37D32DAB,0x72EE7C18,0x54F6A269,0x1F91E3B0,0x2B095D97,0x606E1C50,0x6CA344D9,0x3BF33A28,0x0D5140FF,
0x135CBB27,0x440CC5D8,0x72AEBF01,0x6092BBF7,0x359207D0,0x0C2DBC71,0x1F6D4409,0x4A6DF830,0x73D2438F,0x64481067,
0x3DC657AA,0x1890982D,0x1BB7EF99,0x4239A856,0x676F67D3,0x74912FEC,0x51B4892C,0x2FE8DA51,0x0F1DEF3C,0x0B6ED014,
0x2E4B76D4,0x501725AF,0x70E210C4,0x6F44FA8D,0x50506D65,0x3233D4B3,0x14E3BB13,0x10BB0573,0x2FAF929B,0x4DCC2B4D,
0x6B1C44ED,0x78558E92,0x5C7F89C5,0x41589FAB,0x26D869FD,0x0CF7198E,0x07AA716E,0x2380763B,0x3EA76055,0x59279603,
0x7308E672,0x73AD6875,0x5AF48DC5,0x42C6329B,0x2B1C685A,0x13F19FEA,0x0C52978B,0x250B723B,0x3D39CD65,0x54E397A6,
0x6C0E6016,0x7D40A1E1,0x67048774,0x5138B41B,0x3BD8CFCE,0x26E0C1D7,0x124CAC19,0x02BF5E1F,0x18FB788C,0x2EC74BE5,
0x44273032,0x591F3E29,0x6DB353E7,0x7E18E6C3,0x6A41FC6F,0x56C4A691,0x439DCA35,0x30CA750B,0x1E47DAAC,0x0C135217,
0x01E7193D,0x15BE0391,0x293B596F,0x3C6235CB,0x4F358AF5,0x61B82554,0x73ECADE9,0x7A2A536D,0x688A75CB,0x57316D5F,
0x461D0998,0x354B337E,0x24B9EC29,0x14674B57,0x04517E17,0x05D5AC93,0x17758A35,0x28CE92A1,0x39E2F668,0x4AB4CC82,
0x5B4613D7,0x6B98B4A9,0x7BAE81E9,0x7476C592,0x64D575E7,0x556BF51D,0x4638BA25,0x373A4BF1,0x286F4099,0x19D63C8A,
0x0B6DF1CD,0x0B893A6E,0x1B2A8A19,0x2A940AE3,0x39C745DB,0x48C5B40F,0x5790BF67,0x6629C376,0x74920E33,0x7D351F4C,
0x6F2A9033,0x614D1B4A,0x539BA269,0x461511E7,0x38B8601F,0x2B848CED,0x1E78A143,0x1193AEB7,0x04D4CF21,0x02CAE0B4,
0x10D56FCD,0x1EB2E4B6,0x2C645D97,0x39EAEE19,0x47479FE1,0x547B7313,0x61875EBD,0x6E6C5149,0x7B2B30DF,0x783B2438,
0x6BC5D736,0x5F741885,0x53451F6F,0x473829CB,0x3B4C7BBB,0x2F815F65,0x23D624B2,0x184A210F,0x0CDCAF34,0x018D2EEE,
0x07C4DBC8,0x143A28CA,0x208BE77B,0x2CBAE091,0x38C7D635,0x44B38445,0x507EA09B,0x5C29DB4E,0x67B5DEF1,0x732350CC,
0x7E72D112,0x765B04E5,0x6B459A72,0x604C5D68,0x556EBFEA,0x4AAC3843,0x400440B6,0x3576575C,0x2B01FE00,0x20A6B9F7,
0x16641403,0x0C39982D,0x0226D5AE,0x09A4FB1B,0x14BA658E,0x1FB3A298,0x2A914016,0x3553C7BD,0x3FFBBF4A,0x4A89A8A4,
0x54FE0200,0x5F594609,0x699BEBFD,0x73C667D3,0x7DD92A52,0x782B5ECB,0x6E46C8BC,0x6478AB90,0x5AC0A216,0x511E49C1,
0x47914291,0x3E192F02,0x34B5B3EE,0x2B66787E,0x222B2616,0x19036841,0x0FEEEC9D,0x06ED62CE,0x07D4A135,0x11B93744,
0x1B875470,0x253F5DEA,0x2EE1B63F,0x386EBD6F,0x41E6D0FE,0x4B4A4C12,0x54998782,0x5DD4D9EA,0x66FC97BF,0x70111363,
0x79129D32,0x7DFE7C69,0x7521ECE8,0x6C576998,0x639EA989,0x5AF76583,0x526157F8,0x49DC3CF4,0x4167D213,0x3903D675,
0x30B00AB1,0x286C30C9,0x20380C22,0x18136178,0x0FFDF6D3,0x07F7937E,};
const q15_t mfcc_filter_coefs_config3_q15[NB_MFCC_FILTER_COEFS_CONFIG3_Q15]={
0x54E2,0x5A6C,0x0F38,0x2594,0x70C8,0x48D0,0x069F,0x3730,0x7961,0x482D,
0x0D12,0x37D3,0x72EE,0x54F7,0x1F92,0x2B09,0x606E,0x6CA3,0x3BF3,0x0D51,
0x135D,0x440D,0x72AF,0x6093,0x3592,0x0C2E,0x1F6D,0x4A6E,0x73D2,0x6448,
0x3DC6,0x1891,0x1BB8,0x423A,0x676F,0x7491,0x51B5,0x2FE9,0x0F1E,0x0B6F,
0x2E4B,0x5017,0x70E2,0x6F45,0x5050,0x3234,0x14E4,0x10BB,0x2FB0,0x4DCC,
0x6B1C,0x7856,0x5C80,0x4159,0x26D8,0x0CF7,0x07AA,0x2380,0x3EA7,0x5928,
0x7309,0x73AD,0x5AF5,0x42C6,0x2B1C,0x13F2,0x0C53,0x250B,0x3D3A,0x54E4,
0x6C0E,0x7D41,0x6705,0x5139,0x3BD9,0x26E1,0x124D,0x02BF,0x18FB,0x2EC7,
0x4427,0x591F,0x6DB3,0x7E19,0x6A42,0x56C5,0x439E,0x30CA,0x1E48,0x0C13,
0x01E7,0x15BE,0x293B,0x3C62,0x4F36,0x61B8,0x73ED,0x7A2A,0x688A,0x5731,
0x461D,0x354B,0x24BA,0x1467,0x0451,0x05D6,0x1776,0x28CF,0x39E3,0x4AB5,
0x5B46,0x6B99,0x7BAF,0x7477,0x64D5,0x556C,0x4639,0x373A,0x286F,0x19D6,
0x0B6E,0x0B89,0x1B2B,0x2A94,0x39C7,0x48C6,0x5791,0x662A,0x7492,0x7D35,
0x6F2B,0x614D,0x539C,0x4615,0x38B8,0x2B85,0x1E79,0x1194,0x04D5,0x02CB,
0x10D5,0x1EB3,0x2C64,0x39EB,0x4748,0x547B,0x6187,0x6E6C,0x7B2B,0x783B,
0x6BC6,0x5F74,0x5345,0x4738,0x3B4C,0x2F81,0x23D6,0x184A,0x0CDD,0x018D,
0x07C5,0x143A,0x208C,0x2CBB,0x38C8,0x44B4,0x507F,0x5C2A,0x67B6,0x7323,
0x7E73,0x765B,0x6B46,0x604C,0x556F,0x4AAC,0x4004,0x3576,0x2B02,0x20A7,
0x1664,0x0C3A,0x0227,0x09A5,0x14BA,0x1FB4,0x2A91,0x3554,0x3FFC,0x4A8A,
0x54FE,0x5F59,0x699C,0x73C6,0x7DD9,0x782B,0x6E47,0x6479,0x5AC1,0x511E,
0x4791,0x3E19,0x34B6,0x2B66,0x222B,0x1903,0x0FEF,0x06ED,0x07D5,0x11B9,
0x1B87,0x253F,0x2EE2,0x386F,0x41E7,0x4B4A,0x549A,0x5DD5,0x66FD,0x7011,
0x7913,0x7DFE,0x7522,0x6C57,0x639F,0x5AF7,0x5261,0x49DC,0x4168,0x3904,
0x30B0,0x286C,0x2038,0x1813,0x0FFE,0x07F8,};
| 84.275039 | 110 | 0.845204 |
7ea9792874d7cb9d2d16fe289016e84de60773b0 | 2,973 | c | C | netbsd/sys/compat/osf1/osf1_signo.c | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 91 | 2015-01-05T15:18:31.000Z | 2022-03-11T16:43:28.000Z | netbsd/sys/compat/osf1/osf1_signo.c | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 1 | 2016-02-25T15:57:55.000Z | 2016-02-25T16:01:02.000Z | netbsd/sys/compat/osf1/osf1_signo.c | MarginC/kame | 2ef74fe29e4cca9b4a87a1d5041191a9e2e8be30 | [
"BSD-3-Clause"
] | 21 | 2015-02-07T08:23:07.000Z | 2021-12-14T06:01:49.000Z | /* $NetBSD: osf1_signo.c,v 1.1 2002/03/31 22:22:48 christos Exp $ */
/*
* Copyright (c) 1999 Christopher G. Demetriou. 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. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by Christopher G. Demetriou
* for the NetBSD Project.
* 4. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: osf1_signo.c,v 1.1 2002/03/31 22:22:48 christos Exp $");
#include <sys/types.h>
#include <sys/signal.h>
#include <compat/osf1/osf1.h>
#include <compat/osf1/osf1_cvt.h>
/*
* These tables are used to translate between NetBSD and OSF/1 signal
* numbers.
*
* XXX IT IS NOT UP TO DATE.
*/
const int native_to_osf1_signo[] = {
0,
OSF1_SIGHUP,
OSF1_SIGINT,
OSF1_SIGQUIT,
OSF1_SIGILL,
OSF1_SIGTRAP,
OSF1_SIGABRT,
OSF1_SIGEMT,
OSF1_SIGFPE,
OSF1_SIGKILL,
OSF1_SIGBUS,
OSF1_SIGSEGV,
OSF1_SIGSYS,
OSF1_SIGPIPE,
OSF1_SIGALRM,
OSF1_SIGTERM,
OSF1_SIGURG,
OSF1_SIGSTOP,
OSF1_SIGTSTP,
OSF1_SIGCONT,
OSF1_SIGCHLD,
OSF1_SIGTTIN,
OSF1_SIGTTOU,
OSF1_SIGIO,
OSF1_SIGXCPU,
OSF1_SIGXFSZ,
OSF1_SIGVTALRM,
OSF1_SIGPROF,
OSF1_SIGWINCH,
OSF1_SIGINFO,
OSF1_SIGUSR1,
OSF1_SIGUSR2,
};
const int osf1_to_native_signo[] = {
0,
SIGHUP,
SIGINT,
SIGQUIT,
SIGILL,
SIGTRAP,
SIGABRT,
SIGEMT,
SIGFPE,
SIGKILL,
SIGBUS,
SIGSEGV,
SIGSYS,
SIGPIPE,
SIGALRM,
SIGTERM,
SIGURG,
SIGSTOP,
SIGTSTP,
SIGCONT,
SIGCHLD,
SIGTTIN,
SIGTTOU,
SIGIO,
SIGXCPU,
SIGXFSZ,
SIGVTALRM,
SIGPROF,
SIGWINCH,
SIGINFO,
SIGUSR1,
SIGUSR2,
};
| 25.194915 | 84 | 0.748402 |
630ce832434a1f3d157082106dedf756c40d1650 | 4,034 | h | C | net/mmc/ipsecmon/actpol.h | npocmaka/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 17 | 2020-11-13T13:42:52.000Z | 2021-09-16T09:13:13.000Z | net/mmc/ipsecmon/actpol.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 2 | 2020-10-19T08:02:06.000Z | 2020-10-19T08:23:18.000Z | net/mmc/ipsecmon/actpol.h | sancho1952007/Windows-Server-2003 | 5c6fe3db626b63a384230a1aa6b92ac416b0765f | [
"Unlicense"
] | 14 | 2020-11-14T09:43:20.000Z | 2021-08-28T08:59:57.000Z | /**********************************************************************/
/** Microsoft Windows/NT **/
/** Copyright(c) Microsoft Corporation, 1997 - 2002 **/
/**********************************************************************/
/*
ActPol.h
FILE HISTORY:
*/
#ifndef _ACTPOL_H
#define _ACTPOL_H
#ifndef _IPSMHAND_H
#include "ipsmhand.h"
#endif
#ifndef _SPDDB_H
#include "spddb.h"
#endif
// BAIL_xx defines
#define BAIL_ON_WIN32_ERROR(dwError) \
if (dwError) {\
goto error; \
}
#define celems(_x) (sizeof(_x) / sizeof(_x[0]))
#define MAXSTRLEN (1024)
#define STRING_TEXT_SIZE 4096
typedef struct
{
int iPolicySource; // one of the three constants mentioned above
TCHAR pszPolicyName[MAXSTRLEN]; // policy name
TCHAR pszPolicyDesc[MAXSTRLEN]; // policy description
TCHAR pszPolicyPath[MAXSTRLEN]; // policy path (DN or RegKey)
TCHAR pszOU[MAXSTRLEN]; // OU or GPO
TCHAR pszGPOName[MAXSTRLEN]; // policy path (DN or RegKey)
time_t timestamp; // last updated time
} POLICY_INFO, *PPOLICY_INFO;
// policy source constants
#define PS_NO_POLICY 0
#define PS_DS_POLICY 1
#define PS_DS_POLICY_CACHED 2
#define PS_LOC_POLICY 3
/*---------------------------------------------------------------------------
Class: CActPolHandler
---------------------------------------------------------------------------*/
class CActPolHandler : public CIpsmHandler
{
public:
CActPolHandler(ITFSComponentData* pTFSComponentData);
virtual ~CActPolHandler();
// Interface
public:
// base handler functionality we override
OVERRIDE_NodeHandler_HasPropertyPages();
OVERRIDE_NodeHandler_CreatePropertyPages();
OVERRIDE_NodeHandler_OnAddMenuItems();
OVERRIDE_NodeHandler_OnCommand();
OVERRIDE_NodeHandler_GetString()
{ return (nCol == 0) ? GetDisplayName() : NULL; }
// Base handler notifications we handle
OVERRIDE_BaseHandlerNotify_OnExpand();
OVERRIDE_BaseHandlerNotify_OnDelete();
OVERRIDE_BaseHandlerNotify_OnPropertyChange();
// Result handler functionality we override
OVERRIDE_BaseResultHandlerNotify_OnResultSelect();
OVERRIDE_BaseResultHandlerNotify_OnResultUpdateView();
OVERRIDE_ResultHandler_OnGetResultViewType();
OVERRIDE_ResultHandler_GetVirtualString();
OVERRIDE_ResultHandler_GetVirtualImage();
OVERRIDE_ResultHandler_AddMenuItems();
OVERRIDE_ResultHandler_Command();
OVERRIDE_ResultHandler_HasPropertyPages();
OVERRIDE_ResultHandler_CreatePropertyPages();
STDMETHODIMP CacheHint(int nStartIndex, int nEndIndex);
/*STDMETHODIMP SortItems(int nColumn,
DWORD dwSortOptions,
LPARAM lUserParam);*/
// base handler overrides
virtual HRESULT LoadColumns(ITFSComponent *, MMC_COOKIE, LPARAM, LPARAM);
// CHandler overridden
virtual HRESULT OnRefresh(ITFSNode *, LPDATAOBJECT, DWORD, LPARAM, LPARAM);
// multi select support
virtual const GUID * GetVirtualGuid(int nIndex)
{
return &GUID_IpsmActivePolNodeType;
}
public:
// CMTIpsmHandler functionality
virtual HRESULT InitializeNode(ITFSNode * pNode);
virtual int GetImageIndex(BOOL bOpenImage);
ITFSQueryObject* OnCreateQuery(ITFSNode * pNode);
public:
// implementation specific
HRESULT InitData(ISpdInfo * pSpdInfo);
HRESULT UpdateStatus(ITFSNode * pNode);
// Implementation
private:
// Command handlers
HRESULT OnDelete(ITFSNode * pNode);
private:
SPISpdInfo m_spSpdInfo;
POLICY_INFO m_PolicyInfo;
CString m_strCompName;
HRESULT UpdateActivePolicyInfo();
HRESULT getPolicyInfo();
HRESULT getMorePolicyInfo();
PGROUP_POLICY_OBJECT getIPSecGPO();
HRESULT FormatTime(time_t t, CString & str);
void StringToGuid( TCHAR * szValue, GUID * pGuid );
};
#endif _IKESTATS_H
| 28.814286 | 81 | 0.641547 |
f2efbeaff1fe7e2d51fe9e8fa55a3698cd7ebd07 | 252 | h | C | Custom/Custom/Demo/scroOrTableOrWebView/ViewControllers/TableViewController.h | ShuailongWang/MyCustom | 53cd186aaeb69b500a56c90c2d38eaf007f95e21 | [
"MIT"
] | null | null | null | Custom/Custom/Demo/scroOrTableOrWebView/ViewControllers/TableViewController.h | ShuailongWang/MyCustom | 53cd186aaeb69b500a56c90c2d38eaf007f95e21 | [
"MIT"
] | null | null | null | Custom/Custom/Demo/scroOrTableOrWebView/ViewControllers/TableViewController.h | ShuailongWang/MyCustom | 53cd186aaeb69b500a56c90c2d38eaf007f95e21 | [
"MIT"
] | null | null | null | //
// TableViewController.h
// Custom
//
// Created by admin on 17/3/24.
// Copyright © 2017年 wsl. All rights reserved.
//
#import "CustomScrollingNavbarViewController.h"
@interface TableViewController : CustomScrollingNavbarViewController
@end
| 18 | 68 | 0.75 |
78a571a87248e46f0012fb0936e0e54b3ed1d74e | 2,311 | h | C | src/include/castack.h | jhxie/procnanny | bd96aa7810dbc806c2353875431c4238406145d7 | [
"BSD-3-Clause"
] | null | null | null | src/include/castack.h | jhxie/procnanny | bd96aa7810dbc806c2353875431c4238406145d7 | [
"BSD-3-Clause"
] | null | null | null | src/include/castack.h | jhxie/procnanny | bd96aa7810dbc806c2353875431c4238406145d7 | [
"BSD-3-Clause"
] | null | null | null | #ifndef CASTACK_H_
#define CASTACK_H_
#include <stddef.h>
#include <stdbool.h>
/*
* Public Interface of castack(calloc based stack)
*/
/*
*Initialize a calloc based stack.
*/
struct castack *castack_init (void) __attribute__ ((warn_unused_result));
/*
*The address returned by this function can be realloc()'d but can _never_
*be called free() upon -- that is taken care of by the castack_free() and
*castack_destroy().
*/
void *castack_push (struct castack *current_castack,
size_t nmemb,
size_t size)
__attribute__((warn_unused_result));
/*
*Traverse through the castack and reallocate the memory pointed to by mem.
*
*On failure(the memory block pointed by mem does not exist on the castack,
*or the realloc() call failed), exit the program with reasons presented.
*
*All the rest behaviors are the same as realloc(), with 2 exceptions:
*If the 1st parameter is NULL, or the new size is larger than the old size,
*the allocated memory will be initialized.
*
*Note this function takes O(n) to find the mem, but normally this is not
*a big problem since the memory block you are going to realloc() is near
*the top of the castack.
*/
void *castack_realloc (struct castack *current_castack,
void *mem,
size_t size)
__attribute__((warn_unused_result));
/*
*Pop the most recently allocated memory block and free it:
*may accidentally free memory that is not mean to be freed.
*/
void castack_pop (struct castack *current_castack);
/*
*Report whether the castack is empty.
*/
bool castack_empty (struct castack *current_castack);
/*
*Return number of memory blocks tracked by castack so far.
*/
size_t castack_report (struct castack *current_castack);
/*
*Traverse through the castack and free all memory blocks tracked by it.
*/
void castack_free (struct castack *current_castack);
/*
*In addition to all the memory blocks, destroy the castack itself as well;
*then set the current_castack to NULL.
*/
void castack_destroy (struct castack **current_castack);
#endif
| 31.657534 | 76 | 0.651666 |
4f238b439bff81891cbf4e3ca451d3d3ad7c3997 | 1,445 | h | C | Source/moja.flint/include/moja/flint/operationstocksimple.h | moja-global/flint | 2c65c5808d908247ce8ee4d9f87f11c7dd57794e | [
"BSL-1.0"
] | null | null | null | Source/moja.flint/include/moja/flint/operationstocksimple.h | moja-global/flint | 2c65c5808d908247ce8ee4d9f87f11c7dd57794e | [
"BSL-1.0"
] | 1 | 2020-07-12T11:30:00.000Z | 2020-07-18T14:50:16.000Z | Source/moja.flint/include/moja/flint/operationstocksimple.h | moja-global/flint | 2c65c5808d908247ce8ee4d9f87f11c7dd57794e | [
"BSL-1.0"
] | null | null | null | #ifndef MOJA_FLINT_OPERATIONSTOCKSIMPLE_H_
#define MOJA_FLINT_OPERATIONSTOCKSIMPLE_H_
#include "moja/flint/ioperation.h"
#include "moja/flint/operationtransfersimple.h"
namespace moja {
namespace flint {
class OperationManagerSimple;
class StockOperationSimple : public IOperation {
friend class OperationManagerSimple;
public:
// StockOperationSimple() = default;
StockOperationSimple(OperationManagerSimple* manager, double timeScale, const ModuleMetaData* metaData);
StockOperationSimple(OperationManagerSimple* manager, double timeScale, const ModuleMetaData* metaData,
DynamicVar& dataPackage);
virtual ~StockOperationSimple() = default;
StockOperationSimple* addTransfer(const IPool* source, const IPool* sink, double value) override;
void submitOperation() override;
std::shared_ptr<IOperationResult> computeOperation(ITiming& _timing) override;
OperationTransferType transferType() const override;
OperationTransferHandlingType transferHandlingType() const override {
return OperationTransferHandlingType::Disaggregated;
};
void set_metaData(const ModuleMetaData* metaData) { _metaData = metaData; }
protected:
OperationManagerSimple* _manager;
double _timeScale;
std::vector<OperationTransferSimple> _transfers;
};
} // namespace flint
} // namespace moja
#endif // MOJA_FLINT_OPERATIONSTOCKSIMPLE_H_ | 33.604651 | 108 | 0.759862 |
9e3e8a5021f8cfbd166b8c4ea50aefe54cf5abcb | 18,872 | c | C | pnpbridge/src/adapters/src/modbus_pnp/ModbusConnection/ModbusConnection.c | daisukeiot/iot-plug-and-play-bridge | 85958fb10c122914b03fe2c15859abc61c7ef5fc | [
"MIT"
] | 29 | 2020-09-30T19:20:07.000Z | 2022-02-24T16:28:02.000Z | pnpbridge/src/adapters/src/modbus_pnp/ModbusConnection/ModbusConnection.c | daisukeiot/iot-plug-and-play-bridge | 85958fb10c122914b03fe2c15859abc61c7ef5fc | [
"MIT"
] | 28 | 2020-09-30T21:05:11.000Z | 2021-11-10T19:06:29.000Z | pnpbridge/src/adapters/src/modbus_pnp/ModbusConnection/ModbusConnection.c | daisukeiot/iot-plug-and-play-bridge | 85958fb10c122914b03fe2c15859abc61c7ef5fc | [
"MIT"
] | 15 | 2020-10-18T12:46:30.000Z | 2021-12-26T02:17:15.000Z | // Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#include "ModbusConnection.h"
int ModbusPnp_GetHeaderSize(
MODBUS_CONNECTION_TYPE connectionType)
{
int headerSize = 0;
switch (connectionType)
{
case TCP:
headerSize = ModbusTcp_GetHeaderSize();
break;
case RTU:
headerSize = ModbusRtu_GetHeaderSize();
break;
default:
break;
}
return headerSize;
}
bool ValidateModbusResponse(
MODBUS_CONNECTION_TYPE connectionType,
uint8_t* response,
uint8_t* request)
{
if (NULL == response)
{
return false;
}
const int HEADER_SIZE = ModbusPnp_GetHeaderSize(connectionType);
if (response[HEADER_SIZE] == request[HEADER_SIZE])
{
return true;
}
else if (response[HEADER_SIZE] == request[HEADER_SIZE] + MODBUS_EXCEPTION_CODE)
{
LogError("Modbus exception code: 0x%x", response[HEADER_SIZE + 1]);
return false;
}
else
{
LogError("Error in parsing response. ");
return false;
}
}
int ProcessModbusResponse(
MODBUS_CONNECTION_TYPE connectionType,
CapabilityType capabilityType,
void* capability,
uint8_t* response,
size_t responseLength,
uint8_t* result)
{
int stepSize = 0;
int dataOffset = ModbusPnp_GetHeaderSize(connectionType);
int resultLength = -1;
// Get excpectd number of bits or registers in the payload
switch (response[dataOffset]) // Function code
{
case ReadCoils:
case ReadInputs:
stepSize = 1;
dataOffset += 2; // Header + Function Code (1 uint8_t) + Data Length (1 uint8_t)
break;
case ReadHoldingRegisters:
case ReadInputRegisters:
stepSize = 2;
dataOffset += 2; // Header + Function Code (1 uint8_t) + Data Length (1 uint8_t)
break;
case WriteCoil:
stepSize = 1;
dataOffset += 3; // Header + Function Code (1 uint8_t) + Address (2 uint8_t)
break;
case WriteHoldingRegister:
stepSize = 2;
dataOffset += 3; // Header + Function Code (1 uint8_t) + Address (2 uint8_t)
break;
}
ModbusDataType dataType = INVALID;
int dataLength = 0;
double conversionCoefficient = 1.0;
switch (capabilityType) {
case Telemetry:
{
ModbusTelemetry* telemetry = (ModbusTelemetry*)capability;
dataType = telemetry->DataType;
dataLength = telemetry->Length;
conversionCoefficient = telemetry->ConversionCoefficient;
break;
}
case Property:
{
ModbusProperty* property = (ModbusProperty*)capability;
dataType = property->DataType;
dataLength = property->Length;
conversionCoefficient = property->ConversionCoefficient;
break;
}
case Command:
{
ModbusCommand* command = (ModbusCommand*)capability;
dataType = command->DataType;
dataLength = command->Length;
conversionCoefficient = command->ConversionCoefficient;
break;
}
}
// Check Endian-ness
if (stepSize == 1)
{
// Read bits (1 bit)
uint8_t bitVal = (uint8_t)(response[dataOffset] & 0b1);
const char* data = (bitVal == (uint8_t)1) ? "true" : "false";
resultLength = sprintf_s((char*)result, MODBUS_RESPONSE_MAX_LENGTH, "%s", data);
}
else if (stepSize == 2)
{
double value = 0.0;
switch (dataType)
{
case HEXSTRING:
{
uint8_t *strBuffer = calloc((dataLength * 2) + 1, sizeof(uint8_t));
if (NULL == strBuffer)
{
LogError("Failed to convert the response to string: Memory allocation failed.");
return -1;
}
// Reverse data array
for (int i = 0; i < dataLength * 2; i++)
{
strBuffer[(dataLength * 2) - i - 1] = response[dataOffset + i];
}
uint8_t temp = 0x00;
for (int i = 0; i < dataLength; i++)
{
temp = strBuffer[i * 2];
strBuffer[i * 2] = strBuffer[(i * 2) + 1];
strBuffer[(i * 2) + 1] = temp;
}
// Convert Hex string
char* strPtr = (char*)result;
*(strPtr++) = '\"';
resultLength = 1;
for (int i = 0; i < (dataLength * 2); i++)
{
int length = 0;
length = sprintf_s(strPtr, MODBUS_RESPONSE_MAX_LENGTH - resultLength - 2, "%02X", (uint8_t)strBuffer[i]);
strPtr += length;
resultLength += length;
}
if (resultLength < (MODBUS_RESPONSE_MAX_LENGTH - 2))
{
result[resultLength++] = '\"';
result[resultLength++] = '\0';
}
free(strBuffer);
return resultLength;
}
case STRING:
{
uint8_t *strBuffer = calloc((dataLength * 2) + 1, sizeof(uint8_t));
if (NULL == strBuffer)
{
LogError("Failed to convert the response to string: Memory allocation failed.");
return -1;
}
// Reverse data array
for (int i = 0; i < dataLength * 2; i++)
{
strBuffer[(dataLength * 2) - i - 1] = response[dataOffset + i];
}
char temp = 0x00;
for (int i = 0; i < dataLength; i++)
{
temp = strBuffer[i * 2];
strBuffer[i * 2] = strBuffer[(i * 2) + 1];
strBuffer[(i * 2) + 1] = temp;
}
// Convert non-alpha-numberic char to Hex char
char* strPtr = (char*)result;
*(strPtr++) = '\"';
resultLength = 1;
for (int i = 0; i < (dataLength * 2); i++)
{
int length = 0;
if (iscsym(strBuffer[i]) != 0)
{
length = sprintf_s(strPtr, MODBUS_RESPONSE_MAX_LENGTH - resultLength - 2, "%c", (char)strBuffer[i]);
}
else
{
length = sprintf_s(strPtr, MODBUS_RESPONSE_MAX_LENGTH - resultLength - 2, "%02X", (uint8_t)strBuffer[i]);
}
strPtr += length;
resultLength += length;
}
if (resultLength < (MODBUS_RESPONSE_MAX_LENGTH - 2))
{
result[resultLength++] = '\"';
result[resultLength++] = '\0';
}
free(strBuffer);
return resultLength;
}
case NUMERIC:
{
int n = 1;
if (dataLength > 1 && *(char *)&n == 1)
{
// Is little Endian, reverse response array
uint8_t temp = 0x00;
for (size_t i = dataOffset, j = responseLength - 1; i < ((responseLength - dataOffset) / 2); i++, j--)
{
temp = response[i];
response[i] = response[j];
response[j] = temp;
}
}
switch (dataLength)
{
case 1:
{
uint16_t rawValue = ((response[dataOffset] << 8) + response[dataOffset + 1]);
value = rawValue * conversionCoefficient;
break;
}
case 2:
{
uint32_t rawValue = 0;
for (int i = 0; i < dataLength; i++)
{
rawValue <<= 16;
rawValue += ((response[dataOffset + i * 2] << 8) + response[dataOffset + 1]);
}
value = rawValue * conversionCoefficient;
break;
}
case 4:
{
uint64_t rawValue = 0;
for (int i = 0; i < dataLength; i++)
{
rawValue <<= 16;
rawValue += ((response[dataOffset + i * 2] << 8) + response[dataOffset + 1]);
}
value = rawValue * conversionCoefficient;
break;
}
}
break;
}
default:
LogError("Unsupported datatype.");
return -1;
}
resultLength = sprintf_s((char*)result, MODBUS_RESPONSE_MAX_LENGTH, "%g", value);
}
return resultLength;
}
bool ModbusPnp_CloseDevice(
MODBUS_CONNECTION_TYPE connectionType,
HANDLE hDevice,
LOCK_HANDLE hLock)
{
bool result = false;
switch (connectionType)
{
case TCP:
result = ModbusTcp_CloseDevice((SOCKET)hDevice, hLock);
break;
case RTU:
result = ModbusRtu_CloseDevice(hDevice, hLock);
break;
default:
break;
}
return result;
}
IOTHUB_CLIENT_RESULT ModbusPnp_SetReadRequest(
ModbusDeviceConfig* deviceConfig,
CapabilityType capabilityType,
void* capability)
{
int result = IOTHUB_CLIENT_ERROR;
switch (deviceConfig->ConnectionType)
{
case TCP:
result = ModbusTcp_SetReadRequest(capabilityType, capability, deviceConfig->UnitId);
break;
case RTU:
result = ModbusRtu_SetReadRequest(capabilityType, capability, deviceConfig->UnitId);
break;
default:
break;
}
return result;
}
IOTHUB_CLIENT_RESULT ModbusPnp_SetWriteRequest(
MODBUS_CONNECTION_TYPE connectionType,
CapabilityType capabilityType,
void* capability,
char* valueStr)
{
IOTHUB_CLIENT_RESULT result = IOTHUB_CLIENT_ERROR;
switch (connectionType)
{
case TCP:
result = ModbusTcp_SetWriteRequest(capabilityType, capability, valueStr);
break;
case RTU:
result = ModbusRtu_SetWriteRequest(capabilityType, capability, valueStr);
break;
default:
break;
}
return result;
}
int ModbusPnp_ReadResponse(
MODBUS_CONNECTION_TYPE connectionType,
HANDLE handler,
uint8_t *responseArr,
uint32_t arrLen)
{
int result = -1;
switch (connectionType)
{
case TCP:
result = ModbusTcp_ReadResponse((SOCKET)handler, responseArr, arrLen);
break;
case RTU:
result = ModbusRtu_ReadResponse(handler, responseArr, arrLen);
break;
default:
break;
}
return result;
}
int ModbusPnp_SendRequest(
MODBUS_CONNECTION_TYPE connectionType,
HANDLE handler,
uint8_t *requestArr,
uint32_t arrLen)
{
int result = -1;
switch (connectionType)
{
case TCP:
result = ModbusTcp_SendRequest((SOCKET)handler, requestArr, arrLen);
break;
case RTU:
result = ModbusRtu_SendRequest(handler, requestArr, arrLen);
break;
default:
break;
}
return result;
}
int ModbusPnp_ReadCapability(
CapabilityContext* capabilityContext,
CapabilityType capabilityType,
uint8_t* resultedData)
{
uint8_t response[MODBUS_RESPONSE_MAX_LENGTH];
memset(response, 0x00, MODBUS_RESPONSE_MAX_LENGTH);
size_t responseLength = 0;
int resultLength = -1;
const char* capabilityName = NULL;
uint8_t* requestArr = NULL;
int requestArrSize = 0;
switch (capabilityType)
{
case Telemetry:
{
ModbusTelemetry* telemetry = (ModbusTelemetry*) (capabilityContext->capability);
capabilityName = telemetry->Name;
switch (capabilityContext->connectionType)
{
case TCP:
requestArr = telemetry->ReadRequest.TcpArr;
requestArrSize = sizeof(telemetry->ReadRequest.TcpArr);
break;
case RTU:
requestArr = telemetry->ReadRequest.RtuArr;
requestArrSize = sizeof(telemetry->ReadRequest.RtuArr);
break;
default:
break;
}
break;
}
case Property:
{
ModbusProperty* property = (ModbusProperty*) (capabilityContext->capability);
capabilityName = property->Name;
switch (capabilityContext->connectionType)
{
case TCP:
requestArr = property->ReadRequest.TcpArr;
requestArrSize = sizeof(property->ReadRequest.TcpArr);
break;
case RTU:
requestArr = property->ReadRequest.RtuArr;
requestArrSize = sizeof(property->ReadRequest.RtuArr);
break;
default:
break;
}
break;
}
default:
LogError("Modbus read is not supported for the capability \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
if (LOCK_OK != Lock(capabilityContext->hLock))
{
LogError("Device communicate lock is abandoned.");
resultLength = -1;
goto exit;
}
if (requestArrSize != ModbusPnp_SendRequest(capabilityContext->connectionType, capabilityContext->hDevice, requestArr, requestArrSize))
{
LogError("Failed to send read request for capability \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
responseLength = ModbusPnp_ReadResponse(capabilityContext->connectionType, capabilityContext->hDevice, response, MODBUS_RESPONSE_MAX_LENGTH);
if (responseLength < 0)
{
LogError("Failed to get read response for capability \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
if (ValidateModbusResponse(capabilityContext->connectionType, response, requestArr))
{
resultLength = ProcessModbusResponse(capabilityContext->connectionType, capabilityType, capabilityContext->capability, response, responseLength, resultedData);
if (resultLength < 0)
{
LogError("Failed to parse response for reading capability \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
}
else
{
LogError("Invalid response for reading capability \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
exit:
Unlock(capabilityContext->hLock);
return resultLength;
}
int ModbusPnp_WriteToCapability(
CapabilityContext* capabilityContext,
CapabilityType capabilityType,
char* requestStr,
uint8_t* resultedData)
{
uint8_t response[MODBUS_RESPONSE_MAX_LENGTH];
memset(response, 0x00, MODBUS_RESPONSE_MAX_LENGTH);
size_t responseLength = 0;
int resultLength = -1;
const char* capabilityName = NULL;
uint8_t* requestArr = NULL;
int requestArrSize = 0;
switch (capabilityType)
{
case Command:
{
ModbusCommand* command = (ModbusCommand*)(capabilityContext->capability);
capabilityName = command->Name;
if (IOTHUB_CLIENT_OK != ModbusPnp_SetWriteRequest(capabilityContext->connectionType, Command, command, requestStr))
{
LogError("Failed to create write request for command \"%s\".", capabilityName);
return -1;
}
switch (capabilityContext->connectionType)
{
case TCP:
requestArr = command->WriteRequest.TcpArr;
requestArrSize = sizeof(command->WriteRequest.TcpArr);
break;
case RTU:
requestArr = command->WriteRequest.RtuArr;
requestArrSize = sizeof(command->WriteRequest.RtuArr);
break;
default:
break;
}
break;
}
case Property:
{
ModbusProperty* property = (ModbusProperty*)(capabilityContext->capability);
capabilityName = property->Name;
if (IOTHUB_CLIENT_OK != ModbusPnp_SetWriteRequest(capabilityContext->connectionType, Property, property, requestStr))
{
LogError("Failed to create write request for writable property \"%s\".", capabilityName);
return -1;
}
switch (capabilityContext->connectionType)
{
case TCP:
requestArr = property->WriteRequest.TcpArr;
requestArrSize = sizeof(property->WriteRequest.TcpArr);
break;
case RTU:
requestArr = property->WriteRequest.RtuArr;
requestArrSize = sizeof(property->WriteRequest.RtuArr);
break;
default:
break;
}
break;
}
default:
LogError("Modbus write is not supported for the capability.");
resultLength = -1;
goto exit;
}
if (LOCK_OK != Lock(capabilityContext->hLock))
{
LogError("Device communicate lock is abandoned.");
resultLength = -1;
goto exit;
}
if (requestArrSize != ModbusPnp_SendRequest(capabilityContext->connectionType, capabilityContext->hDevice, requestArr, requestArrSize))
{
LogError("Failed to send write request for capability \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
responseLength = ModbusPnp_ReadResponse(capabilityContext->connectionType, capabilityContext->hDevice, response, MODBUS_RESPONSE_MAX_LENGTH);
if (responseLength < 0)
{
LogError("Failed to get write response for capability \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
if (ValidateModbusResponse(capabilityContext->connectionType, response, requestArr))
{
resultLength = ProcessModbusResponse(capabilityContext->connectionType, capabilityType, capabilityContext->capability, response, responseLength, resultedData);
if (resultLength < 0)
{
LogError("Failed to parse response for command \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
}
else
{
LogError("Invalid response for command \"%s\".", capabilityName);
resultLength = -1;
goto exit;
}
exit:
Unlock(capabilityContext->hLock);
return resultLength;
} | 31.141914 | 167 | 0.545252 |
9a5fdd4e73867c81a41813d8e5e3b33691dd5906 | 653 | h | C | blackmeta/config-gamebuino.h | frenchcomp/blackmeta | 198938021b3e9cc7aaab330de707899a10b5beba | [
"MIT"
] | null | null | null | blackmeta/config-gamebuino.h | frenchcomp/blackmeta | 198938021b3e9cc7aaab330de707899a10b5beba | [
"MIT"
] | null | null | null | blackmeta/config-gamebuino.h | frenchcomp/blackmeta | 198938021b3e9cc7aaab330de707899a10b5beba | [
"MIT"
] | null | null | null | /**
* LICENSE
*
* This source file is subject to the MIT license and the version 3 of the GPL3
* license that are bundled with this package in the folder licences
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to richarddeloge@gmail.com so we can send you a copy immediately.
*
*
* @copyright Copyright (c) Richard Déloge (richarddeloge@gmail.com)
*
* @license http://teknoo.software/license/mit MIT License
* @author Richard Déloge <richarddeloge@gmail.com>
*/
#define FOLDER_NAME "BlackMeta"
#define DISPLAY_MODE DISPLAY_MODE_RGB565
| 34.368421 | 79 | 0.724349 |
9aabc360f6b8c3f72427e0a70ddf766dabe4d4d2 | 2,061 | c | C | glibc-2.21/stdlib/tst-limits.c | LinuxUser404/smack-glibc | 75137ec47348317a8dbb431774b74dbb7bd2ec4f | [
"MIT"
] | 12 | 2018-09-18T19:51:27.000Z | 2022-01-18T15:31:41.000Z | include/glibc-stdlib/tst-limits.c | DalavanCloud/libucresolv | 04a4827aa44c47556f425a4eed5e0ab4a5c0d25a | [
"Apache-2.0"
] | 3 | 2017-10-05T20:52:56.000Z | 2019-02-26T23:05:29.000Z | include/glibc-stdlib/tst-limits.c | DalavanCloud/libucresolv | 04a4827aa44c47556f425a4eed5e0ab4a5c0d25a | [
"Apache-2.0"
] | 7 | 2017-07-04T10:52:39.000Z | 2019-02-28T08:37:16.000Z | /* It is important that this comes first to not hide effects introduced
by other headers. */
#include <limits.h>
#include <inttypes.h>
#include <stdio.h>
static long long int
bitval (int bits)
{
long long int val = 0;
while (bits-- > 0)
val |= 1ll << bits;
return val;
}
static int
do_test (void)
{
int result = 0;
#define TEST(name, format, expected) \
printf ("%-12s expected = %-20" format " actual = %" format "\n", \
#name ":", expected, name); \
result |= name != expected
/* The limits from ISO C99. */
/* We cannot support anything but 8-bit chars. */
TEST (CHAR_BIT, "d", 8);
TEST (SCHAR_MIN, "d", -128);
TEST (SCHAR_MAX, "d", 127);
TEST (UCHAR_MAX, "d", 255);
TEST (SHRT_MIN, "d", -(1 << (sizeof (short int) * CHAR_BIT - 1)));
TEST (SHRT_MAX, "d", (1 << (sizeof (short int) * CHAR_BIT - 1)) - 1);
TEST (USHRT_MAX, "d", (1 << sizeof (short int) * CHAR_BIT) - 1);
TEST (INT_MIN, "d", (int) -bitval (sizeof (int) * CHAR_BIT - 1) - 1);
TEST (INT_MAX, "d", (int) bitval (sizeof (int) * CHAR_BIT - 1));
TEST (UINT_MAX, "u",
(unsigned int) bitval (sizeof (unsigned int) * CHAR_BIT));
TEST (LONG_MIN, "ld",
(long int) -bitval (sizeof (long int) * CHAR_BIT - 1) - 1);
TEST (LONG_MAX, "ld", (long int) bitval (sizeof (long int) * CHAR_BIT - 1));
TEST (ULONG_MAX, "lu",
(unsigned long int) bitval (sizeof (unsigned long int) * CHAR_BIT));
TEST (LLONG_MIN, "lld", -bitval (sizeof (long long int) * CHAR_BIT - 1) - 1);
TEST (LLONG_MAX, "lld", bitval (sizeof (long long int) * CHAR_BIT - 1));
TEST (ULLONG_MAX, "llu",
(unsigned long long int) bitval (sizeof (unsigned long long int)
* CHAR_BIT));
/* Values from POSIX and Unix. */
#ifdef PAGESIZE
TEST (PAGESIZE, "d", getpagesize ());
#elif defined (PAGE_SIZE)
TEST (PAGE_SIZE, "d", getpagesize ());
#endif
TEST (WORD_BIT, "d", (int) sizeof (int) * CHAR_BIT);
TEST (LONG_BIT, "d", (int) sizeof (long int) * CHAR_BIT);
return result;
}
#define TEST_FUNCTION do_test ()
#include "../test-skeleton.c"
| 28.232877 | 79 | 0.609898 |
36f6ce214f1bab131ba02de42b6f93ad6d49b7ee | 15,851 | h | C | src/avt/Plotter/vtk/vtkVisItCubeAxesActor.h | cstatz/visit | f352f3984fa77392e81acbaa6943778a779f0435 | [
"BSD-3-Clause"
] | null | null | null | src/avt/Plotter/vtk/vtkVisItCubeAxesActor.h | cstatz/visit | f352f3984fa77392e81acbaa6943778a779f0435 | [
"BSD-3-Clause"
] | null | null | null | src/avt/Plotter/vtk/vtkVisItCubeAxesActor.h | cstatz/visit | f352f3984fa77392e81acbaa6943778a779f0435 | [
"BSD-3-Clause"
] | 1 | 2020-03-18T23:17:43.000Z | 2020-03-18T23:17:43.000Z | /*=========================================================================
Program: Visualization Toolkit
Module: $RCSfile: vtkVisItCubeAxesActor.h,v $
Language: C++
Date: $Date: 2001/08/03 20:08:22 $
Version: $Revision: 1.22 $
Thanks: Kathleen Bonnell, B Division, Lawrence Livermore Nat'l Laboratory
Copyright (c) 1993-2001 Ken Martin, Will Schroeder, Bill Lorensen
All rights reserve
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkVisItCubeAxesActor - create a plot of a bounding box edges -
// used for navigation
// .SECTION Description
// vtkVisItCubeAxesActor is a composite actor that draws axes of the
// bounding box of an input dataset. The axes include labels and titles
// for the x-y-z axes. The algorithm selects which axes to draw based
// on the user-defined 'fly' mode. (STATIC is default).
// 'STATIC' constructs axes from all edges of the bounding box.
// 'CLOSEST_TRIAD' consists of the three axes x-y-z forming a triad that
// lies closest to the specified camera.
// 'FURTHEST_TRIAD' consists of the three axes x-y-z forming a triad that
// lies furthest from the specified camera.
// 'OUTER_EDGES' is constructed from edges that are on the "exterior" of the
// bounding box, exterior as determined from examining outer edges of the
// bounding box in projection (display) space.
//
// To use this object you must define a bounding box and the camera used
// to render the vtkVisItCubeAxesActor. You can optionally turn on/off labels,
// ticks, gridlines, and set tick location, number of labels, and text to
// use for axis-titles. A 'corner offset' can also be set. This allows
// the axes to be set partially away from the actual bounding box to perhaps
// prevent overlap of labels between the various axes.
//
// The Bounds instance variable (an array of six doubles) is used to determine
// the bounding box.
//
// .SECTION See Also
// vtkActor vtkAxisActor vtkCubeAxesActor2D
//
// Modifications:
// Jeremy Meredith, Wed May 5 14:31:37 EDT 2010
// Added support for title visibility separate from label visibility.
//
// Jeremy Meredith, Tue May 18 12:49:48 EDT 2010
// Renamed some instances of Range to Bounds to reflect their true
// usage (since in theory, the range of an axis need not be tied to
// its location in physical space).
//
// Jeremy Meredith, Tue May 18 13:14:37 EDT 2010
// Removed unused CornerOffset.
//
// Jeremy Meredith, Tue May 18 13:23:21 EDT 2010
// Added a concept of Range which is independent of Bounds.
// Removed trivial and now mislabeled AdjustAxes
// Renamed AdjustBounds and AdjustValues to ComputeLabelExponent and
// ComputeLabelFormat, respectively.
//
#ifndef __vtkVisItCubeAxesActor_h
#define __vtkVisItCubeAxesActor_h
#include <plotter_exports.h>
#include "vtkVisItAxisActor.h"
#include "vtkCamera.h"
#include <vtkTextProperty.h>
#define VTK_FLY_OUTER_EDGES 0
#define VTK_FLY_CLOSEST_TRIAD 1
#define VTK_FLY_FURTHEST_TRIAD 2
#define VTK_FLY_STATIC_TRIAD 3
#define VTK_FLY_STATIC_EDGES 4
#define VTK_TICKS_INSIDE 0
#define VTK_TICKS_OUTSIDE 1
#define VTK_TICKS_BOTH 2
class vtkCollection;
class PLOTTER_API vtkVisItCubeAxesActor : public vtkActor
{
public:
vtkTypeMacro(vtkVisItCubeAxesActor,vtkActor);
void PrintSelf(ostream& os, vtkIndent indent) override;
// Description:
// Instantiate object with label format "6.3g" and the number of labels
// per axis set to 3.
static vtkVisItCubeAxesActor *New();
// Description:
// Draw the axes as per the vtkProp superclass' API.
int RenderOpaqueGeometry(vtkViewport*) override;
int RenderTranslucentPolygonalGeometry(vtkViewport *) override {return 0;}
int HasTranslucentPolygonalGeometry() override {return 0;}
// Descrition
// Build the axes that can be used with VTK's scenegraph API
void BuildGeometry(vtkViewport*, vtkCollection* collection);
// Description:
// Explicitly specify the region in space around which to draw the bounds.
// The bounds is used only when no Input or Prop is specified. The bounds
// are specified according to (xmin,xmax, ymin,ymax, zmin,zmax), making
// sure that the min's are less than the max's.
vtkSetVector6Macro(Bounds,double);
double *GetBounds() override;
void GetBounds(double& xmin, double& xmax, double& ymin, double& ymax,
double& zmin, double& zmax);
void GetBounds(double bounds[6]);
// Description:
// Explicitly specify the actual min/max values assigned to each
// of the three axes. This is what controls the actual numbers
// displayed on the axes, and for the typical auto-set axes with
// no scaling, will be exactly the same as the bounds.
vtkSetVector6Macro(Ranges,double);
double *GetRanges();
// Description:
// Set/Get the camera to perform scaling and translation of the
// vtkVisItCubeAxesActor.
virtual void SetCamera(vtkCamera*);
vtkGetObjectMacro(Camera,vtkCamera);
// Description:
// Specify a mode to control how the axes are drawn: either static,
// closest triad, furthest triad or outer edges in relation to the
// camera position.
vtkSetClampMacro(FlyMode, int, VTK_FLY_OUTER_EDGES, VTK_FLY_STATIC_EDGES);
vtkGetMacro(FlyMode, int);
void SetFlyModeToOuterEdges()
{this->SetFlyMode(VTK_FLY_OUTER_EDGES);};
void SetFlyModeToClosestTriad()
{this->SetFlyMode(VTK_FLY_CLOSEST_TRIAD);};
void SetFlyModeToFurthestTriad()
{this->SetFlyMode(VTK_FLY_FURTHEST_TRIAD);};
void SetFlyModeToStaticTriad()
{this->SetFlyMode(VTK_FLY_STATIC_TRIAD);};
void SetFlyModeToStaticEdges()
{this->SetFlyMode(VTK_FLY_STATIC_EDGES);};
// Description:
// Set/Get the labels for the x, y, and z axes. By default,
// use "X-Axis", "Y-Axis" and "Z-Axis".
vtkSetStringMacro(XTitle);
vtkGetStringMacro(XTitle);
vtkSetStringMacro(XUnits);
vtkGetStringMacro(XUnits);
vtkSetStringMacro(YTitle);
vtkGetStringMacro(YTitle);
vtkSetStringMacro(YUnits);
vtkGetStringMacro(YUnits);
vtkSetStringMacro(ZTitle);
vtkGetStringMacro(ZTitle);
vtkSetStringMacro(ZUnits);
vtkGetStringMacro(ZUnits);
// Description:
// Set/Get the format with which to print the labels on each of the
// x-y-z axes.
vtkSetStringMacro(XLabelFormat);
vtkGetStringMacro(XLabelFormat);
vtkSetStringMacro(YLabelFormat);
vtkGetStringMacro(YLabelFormat);
vtkSetStringMacro(ZLabelFormat);
vtkGetStringMacro(ZLabelFormat);
// Description:
// Set/Get the inertial factor that controls how often (i.e, how
// many renders) the axes can switch position (jump from one axes
// to another).
vtkSetClampMacro(Inertia, int, 1, VTK_INT_MAX);
vtkGetMacro(Inertia, int);
// Description:
// Release any graphics resources that are being consumed by this actor.
// The parameter window could be used to determine which graphic
// resources to release.
void ReleaseGraphicsResources(vtkWindow *) override;
// Description:
// Turn on and off the visibility of each axis.
vtkSetMacro(XAxisVisibility,bool);
vtkGetMacro(XAxisVisibility,bool);
vtkBooleanMacro(XAxisVisibility,bool);
vtkSetMacro(YAxisVisibility,bool);
vtkGetMacro(YAxisVisibility,bool);
vtkBooleanMacro(YAxisVisibility,bool);
vtkSetMacro(ZAxisVisibility,bool);
vtkGetMacro(ZAxisVisibility,bool);
vtkBooleanMacro(ZAxisVisibility,bool);
// Description:
// Turn on and off the visibility of labels for each axis.
vtkSetMacro(XAxisLabelVisibility,bool);
vtkGetMacro(XAxisLabelVisibility,bool);
vtkBooleanMacro(XAxisLabelVisibility,bool);
vtkSetMacro(YAxisLabelVisibility,bool);
vtkGetMacro(YAxisLabelVisibility,bool);
vtkBooleanMacro(YAxisLabelVisibility,bool);
vtkSetMacro(ZAxisLabelVisibility,bool);
vtkGetMacro(ZAxisLabelVisibility,bool);
vtkBooleanMacro(ZAxisLabelVisibility,bool);
// Description:
// Turn on and off the visibility of titles for each axis.
vtkSetMacro(XAxisTitleVisibility,bool);
vtkGetMacro(XAxisTitleVisibility,bool);
vtkBooleanMacro(XAxisTitleVisibility,bool);
vtkSetMacro(YAxisTitleVisibility,bool);
vtkGetMacro(YAxisTitleVisibility,bool);
vtkBooleanMacro(YAxisTitleVisibility,bool);
vtkSetMacro(ZAxisTitleVisibility,bool);
vtkGetMacro(ZAxisTitleVisibility,bool);
vtkBooleanMacro(ZAxisTitleVisibility,bool);
// Description:
// Turn on and off the visibility of ticks for each axis.
vtkSetMacro(XAxisTickVisibility,bool);
vtkGetMacro(XAxisTickVisibility,bool);
vtkBooleanMacro(XAxisTickVisibility,bool);
vtkSetMacro(YAxisTickVisibility,bool);
vtkGetMacro(YAxisTickVisibility,bool);
vtkBooleanMacro(YAxisTickVisibility,bool);
vtkSetMacro(ZAxisTickVisibility,bool);
vtkGetMacro(ZAxisTickVisibility,bool);
vtkBooleanMacro(ZAxisTickVisibility,bool);
// Description:
// Turn on and off the visibility of minor ticks for each axis.
vtkSetMacro(XAxisMinorTickVisibility,bool);
vtkGetMacro(XAxisMinorTickVisibility,bool);
vtkBooleanMacro(XAxisMinorTickVisibility,bool);
vtkSetMacro(YAxisMinorTickVisibility,bool);
vtkGetMacro(YAxisMinorTickVisibility,bool);
vtkBooleanMacro(YAxisMinorTickVisibility,bool);
vtkSetMacro(ZAxisMinorTickVisibility,bool);
vtkGetMacro(ZAxisMinorTickVisibility,bool);
vtkBooleanMacro(ZAxisMinorTickVisibility,bool);
vtkSetMacro(DrawXGridlines,bool);
vtkGetMacro(DrawXGridlines,bool);
vtkBooleanMacro(DrawXGridlines,bool);
vtkSetMacro(DrawYGridlines,bool);
vtkGetMacro(DrawYGridlines,bool);
vtkBooleanMacro(DrawYGridlines,bool);
vtkSetMacro(DrawZGridlines,bool);
vtkGetMacro(DrawZGridlines,bool);
vtkBooleanMacro(DrawZGridlines,bool);
// Description:
// Set/Get the location of ticks marks.
vtkSetClampMacro(TickLocation, int, VTK_TICKS_INSIDE, VTK_TICKS_BOTH);
vtkGetMacro(TickLocation, int);
void SetTickLocationToInside(void)
{ this->SetTickLocation(VTK_TICKS_INSIDE); };
void SetTickLocationToOutside(void)
{ this->SetTickLocation(VTK_TICKS_OUTSIDE); };
void SetTickLocationToBoth(void)
{ this->SetTickLocation(VTK_TICKS_BOTH); };
void SetLabelScaling(bool, int, int, int);
// Description:
// Returns the text property for the title on an axis.
vtkTextProperty *GetTitleTextProperty(int);
// Description:
// Returns the text property for the labels on an axis.
vtkTextProperty *GetLabelTextProperty(int);
void SetTitleScale(double,double,double);
vtkGetVector3Macro(TitleScale, double);
void SetLabelScale(double,double,double);
vtkGetVector3Macro(LabelScale, double);
// Description:
// Set/Get the tick mark location properties for each of the x, y and
// z axes.
vtkSetMacro(AdjustLabels, bool);
vtkGetMacro(AdjustLabels, bool);
vtkBooleanMacro(AdjustLabels, bool);
vtkSetMacro(XMajorTickMinimum, double);
vtkGetMacro(XMajorTickMinimum, double);
vtkSetMacro(XMajorTickMaximum, double);
vtkGetMacro(XMajorTickMaximum, double);
vtkSetMacro(XMajorTickSpacing, double);
vtkGetMacro(XMajorTickSpacing, double);
vtkSetMacro(XMinorTickSpacing, double);
vtkGetMacro(XMinorTickSpacing, double);
vtkSetMacro(YMajorTickMinimum, double);
vtkGetMacro(YMajorTickMinimum, double);
vtkSetMacro(YMajorTickMaximum, double);
vtkGetMacro(YMajorTickMaximum, double);
vtkSetMacro(YMajorTickSpacing, double);
vtkGetMacro(YMajorTickSpacing, double);
vtkSetMacro(YMinorTickSpacing, double);
vtkGetMacro(YMinorTickSpacing, double);
vtkSetMacro(ZMajorTickMinimum, double);
vtkGetMacro(ZMajorTickMinimum, double);
vtkSetMacro(ZMajorTickMaximum, double);
vtkGetMacro(ZMajorTickMaximum, double);
vtkSetMacro(ZMajorTickSpacing, double);
vtkGetMacro(ZMajorTickSpacing, double);
vtkSetMacro(ZMinorTickSpacing, double);
vtkGetMacro(ZMinorTickSpacing, double);
// Description:
// Shallow copy of a VisItCubeAxesActor.
void ShallowCopy(vtkVisItCubeAxesActor *actor);
protected:
vtkVisItCubeAxesActor();
~vtkVisItCubeAxesActor();
double Bounds[6]; //Define bounds explicitly
double Ranges[6]; //Define ranges explicitly
vtkCamera *Camera;
int FlyMode;
// to control all axes
// [0] always for 'Major' axis during non-static fly modes.
vtkVisItAxisActor *XAxes[4];
vtkVisItAxisActor *YAxes[4];
vtkVisItAxisActor *ZAxes[4];
char *XTitle;
char *XUnits;
char *YTitle;
char *YUnits;
char *ZTitle;
char *ZUnits;
char *ActualXLabel;
char *ActualYLabel;
char *ActualZLabel;
int TickLocation;
bool XAxisVisibility;
bool YAxisVisibility;
bool ZAxisVisibility;
bool XAxisTickVisibility;
bool YAxisTickVisibility;
bool ZAxisTickVisibility;
bool XAxisMinorTickVisibility;
bool YAxisMinorTickVisibility;
bool ZAxisMinorTickVisibility;
bool XAxisLabelVisibility;
bool YAxisLabelVisibility;
bool ZAxisLabelVisibility;
bool XAxisTitleVisibility;
bool YAxisTitleVisibility;
bool ZAxisTitleVisibility;
bool DrawXGridlines;
bool DrawYGridlines;
bool DrawZGridlines;
char *XLabelFormat;
char *YLabelFormat;
char *ZLabelFormat;
double CornerOffset;
int Inertia;
int RenderCount;
int InertiaLocs[3];
bool RenderSomething;
vtkTextProperty *TitleTextProperty[3];
vtkTextProperty *LabelTextProperty[3];
double TitleScale[3];
double LabelScale[3];
bool AdjustLabels;
double XMajorTickMinimum;
double XMajorTickMaximum;
double XMajorTickSpacing;
double XMinorTickSpacing;
double YMajorTickMinimum;
double YMajorTickMaximum;
double YMajorTickSpacing;
double YMinorTickSpacing;
double ZMajorTickMinimum;
double ZMajorTickMaximum;
double ZMajorTickSpacing;
double ZMinorTickSpacing;
bool LastAdjustLabels;
double LastXMajorTickMinimum;
double LastXMajorTickMaximum;
double LastXMajorTickSpacing;
double LastXMinorTickSpacing;
double LastYMajorTickMinimum;
double LastYMajorTickMaximum;
double LastYMajorTickSpacing;
double LastYMinorTickSpacing;
double LastZMajorTickMinimum;
double LastZMajorTickMaximum;
double LastZMajorTickSpacing;
double LastZMinorTickSpacing;
private:
vtkVisItCubeAxesActor(const vtkVisItCubeAxesActor&);
void operator=(const vtkVisItCubeAxesActor&);
vtkSetStringMacro(ActualXLabel);
vtkSetStringMacro(ActualYLabel);
vtkSetStringMacro(ActualZLabel);
vtkTimeStamp BuildTime;
int lastXPow;
int lastYPow;
int lastZPow;
int userXPow;
int userYPow;
int userZPow;
bool autoLabelScaling;
int lastXAxisDigits;
int lastYAxisDigits;
int lastZAxisDigits;
double LastXBounds[2];
double LastYBounds[2];
double LastZBounds[2];
int LastFlyMode;
int renderAxesX[4];
int renderAxesY[4];
int renderAxesZ[4];
int numAxesX;
int numAxesY;
int numAxesZ;
bool mustAdjustXValue;
bool mustAdjustYValue;
bool mustAdjustZValue;
bool ForceXLabelReset;
bool ForceYLabelReset;
bool ForceZLabelReset;
bool scalingChanged;
// various helper methods
void TransformBounds(vtkViewport *viewport, const double bounds[6],
double pts[8][3]);
bool ComputeTickSize(double bounds[6]);
void ComputeLabelExponent(const double bounds[6]);
void ComputeLabelFormat(const double bounds[6]);
void BuildAxes(vtkViewport *);
void DetermineRenderAxes(vtkViewport *);
void SetNonDependentAttributes(void);
void BuildLabels(vtkVisItAxisActor *axes[4]);
void AdjustTicksComputeRange(vtkVisItAxisActor *axes[4]);
// hide the superclass' ShallowCopy() from the user and the compiler.
void ShallowCopy(vtkProp *prop) override { this->vtkProp::ShallowCopy( prop ); }
};
#endif
| 32.415133 | 82 | 0.754085 |
3c17e0376594b6028d153a292950877cb4e5d005 | 4,740 | c | C | ccan/list/test/run-single-eval.c | fspbld/skiboot | 10497d05169fe6e05cecb762a35c63c164469819 | [
"Apache-2.0"
] | 14 | 2016-05-09T06:38:11.000Z | 2021-08-24T14:33:39.000Z | ccan/list/test/run-single-eval.c | fspbld/skiboot | 10497d05169fe6e05cecb762a35c63c164469819 | [
"Apache-2.0"
] | 52 | 2016-03-22T08:28:58.000Z | 2022-03-03T07:26:27.000Z | ccan/list/test/run-single-eval.c | fspbld/skiboot | 10497d05169fe6e05cecb762a35c63c164469819 | [
"Apache-2.0"
] | 38 | 2016-03-22T09:39:06.000Z | 2021-11-15T00:52:42.000Z | /* Make sure macros only evaluate their args once. */
#include <ccan/list/list.h>
#include <ccan/tap/tap.h>
#include <ccan/list/list.c>
struct parent {
const char *name;
struct list_head children;
unsigned int num_children;
int eval_count;
};
struct child {
const char *name;
struct list_node list;
};
static LIST_HEAD(static_list);
#define ref(obj, counter) ((counter)++, (obj))
int main(int argc, char *argv[])
{
struct parent parent;
struct child c1, c2, c3, *c, *n;
unsigned int i;
unsigned int static_count = 0, parent_count = 0, list_count = 0,
node_count = 0;
struct list_head list = LIST_HEAD_INIT(list);
(void)argc;
(void)argv;
plan_tests(74);
/* Test LIST_HEAD, LIST_HEAD_INIT, list_empty and check_list */
ok1(list_empty(ref(&static_list, static_count)));
ok1(static_count == 1);
ok1(list_check(ref(&static_list, static_count), NULL));
ok1(static_count == 2);
ok1(list_empty(ref(&list, list_count)));
ok1(list_count == 1);
ok1(list_check(ref(&list, list_count), NULL));
ok1(list_count == 2);
parent.num_children = 0;
list_head_init(ref(&parent.children, parent_count));
ok1(parent_count == 1);
/* Test list_head_init */
ok1(list_empty(ref(&parent.children, parent_count)));
ok1(parent_count == 2);
ok1(list_check(ref(&parent.children, parent_count), NULL));
ok1(parent_count == 3);
c2.name = "c2";
list_add(ref(&parent.children, parent_count), &c2.list);
ok1(parent_count == 4);
/* Test list_add and !list_empty. */
ok1(!list_empty(ref(&parent.children, parent_count)));
ok1(parent_count == 5);
ok1(c2.list.next == &parent.children.n);
ok1(c2.list.prev == &parent.children.n);
ok1(parent.children.n.next == &c2.list);
ok1(parent.children.n.prev == &c2.list);
/* Test list_check */
ok1(list_check(ref(&parent.children, parent_count), NULL));
ok1(parent_count == 6);
c1.name = "c1";
list_add(ref(&parent.children, parent_count), &c1.list);
ok1(parent_count == 7);
/* Test list_add and !list_empty. */
ok1(!list_empty(ref(&parent.children, parent_count)));
ok1(parent_count == 8);
ok1(c2.list.next == &parent.children.n);
ok1(c2.list.prev == &c1.list);
ok1(parent.children.n.next == &c1.list);
ok1(parent.children.n.prev == &c2.list);
ok1(c1.list.next == &c2.list);
ok1(c1.list.prev == &parent.children.n);
/* Test list_check */
ok1(list_check(ref(&parent.children, parent_count), NULL));
ok1(parent_count == 9);
c3.name = "c3";
list_add_tail(ref(&parent.children, parent_count), &c3.list);
ok1(parent_count == 10);
/* Test list_add_tail and !list_empty. */
ok1(!list_empty(ref(&parent.children, parent_count)));
ok1(parent_count == 11);
ok1(parent.children.n.next == &c1.list);
ok1(parent.children.n.prev == &c3.list);
ok1(c1.list.next == &c2.list);
ok1(c1.list.prev == &parent.children.n);
ok1(c2.list.next == &c3.list);
ok1(c2.list.prev == &c1.list);
ok1(c3.list.next == &parent.children.n);
ok1(c3.list.prev == &c2.list);
/* Test list_check */
ok1(list_check(ref(&parent.children, parent_count), NULL));
ok1(parent_count == 12);
/* Test list_check_node */
ok1(list_check_node(&c1.list, NULL));
ok1(list_check_node(&c2.list, NULL));
ok1(list_check_node(&c3.list, NULL));
/* Test list_top */
ok1(list_top(ref(&parent.children, parent_count), struct child, list) == &c1);
ok1(parent_count == 13);
/* Test list_tail */
ok1(list_tail(ref(&parent.children, parent_count), struct child, list) == &c3);
ok1(parent_count == 14);
/* Test list_for_each. */
i = 0;
list_for_each(&parent.children, c, list) {
switch (i++) {
case 0:
ok1(c == &c1);
break;
case 1:
ok1(c == &c2);
break;
case 2:
ok1(c == &c3);
break;
}
if (i > 2)
break;
}
ok1(i == 3);
/* Test list_for_each_safe, list_del and list_del_from. */
i = 0;
list_for_each_safe(&parent.children, c, n, list) {
switch (i++) {
case 0:
ok1(c == &c1);
list_del(ref(&c->list, node_count));
ok1(node_count == 1);
break;
case 1:
ok1(c == &c2);
list_del_from(ref(&parent.children, parent_count),
ref(&c->list, node_count));
ok1(node_count == 2);
break;
case 2:
ok1(c == &c3);
list_del_from(ref(&parent.children, parent_count),
ref(&c->list, node_count));
ok1(node_count == 3);
break;
}
ok1(list_check(ref(&parent.children, parent_count), NULL));
if (i > 2)
break;
}
ok1(i == 3);
ok1(parent_count == 19);
ok1(list_empty(ref(&parent.children, parent_count)));
ok1(parent_count == 20);
/* Test list_top/list_tail on empty list. */
ok1(list_top(ref(&parent.children, parent_count), struct child, list) == NULL);
ok1(parent_count == 21);
ok1(list_tail(ref(&parent.children, parent_count), struct child, list) == NULL);
ok1(parent_count == 22);
return exit_status();
}
| 27.55814 | 81 | 0.664768 |
2cf274f802c5a508401645f73ccd29a95740d7d7 | 243 | h | C | BubleLogger/Tabbar/XKSTabbarViewController.h | weelh/XKSBubleLogger | b0d47c8fc923bbc91af36ff1b6bd6cb70222930d | [
"Apache-2.0"
] | null | null | null | BubleLogger/Tabbar/XKSTabbarViewController.h | weelh/XKSBubleLogger | b0d47c8fc923bbc91af36ff1b6bd6cb70222930d | [
"Apache-2.0"
] | null | null | null | BubleLogger/Tabbar/XKSTabbarViewController.h | weelh/XKSBubleLogger | b0d47c8fc923bbc91af36ff1b6bd6cb70222930d | [
"Apache-2.0"
] | null | null | null | //
// XKSTabbarViewController.h
// XKSBubleLoger
//
// Created by SuperMario@lvhan on 2018/1/25.
// Copyright © 2018年 Mario. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface XKSTabbarViewController : UITabBarController
@end
| 15.1875 | 55 | 0.72428 |
d6067f172598ab810ca38d25cebae98301acf98b | 313 | h | C | Example/YojoComplexListView/YOJOAppDelegate.h | SeasonFoam/YojoComplexListView | f64caf41c130cebb136849f17b694f9a553cf136 | [
"MIT"
] | null | null | null | Example/YojoComplexListView/YOJOAppDelegate.h | SeasonFoam/YojoComplexListView | f64caf41c130cebb136849f17b694f9a553cf136 | [
"MIT"
] | null | null | null | Example/YojoComplexListView/YOJOAppDelegate.h | SeasonFoam/YojoComplexListView | f64caf41c130cebb136849f17b694f9a553cf136 | [
"MIT"
] | null | null | null | //
// YOJOAppDelegate.h
// YojoComplexListView
//
// Created by yonghendeworld@163.com on 03/21/2021.
// Copyright (c) 2021 yonghendeworld@163.com. All rights reserved.
//
@import UIKit;
@interface YOJOAppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
| 19.5625 | 67 | 0.741214 |
96244274d46d5fc1adacd8af8bd81b28adf5d888 | 1,572 | h | C | Alternative_Implementation/ssse3/Vc_Compressed/rainbow_blas_simd.h | fast-crypto-lab/rainbow-submission-round2 | 173ada0e077e1b9dbd8e4a78994f87acc0c92263 | [
"CC0-1.0"
] | 15 | 2019-06-25T08:59:33.000Z | 2022-01-11T04:36:05.000Z | Alternative_Implementation/ssse3/IIIc_Classic/rainbow_blas_simd.h | fast-crypto-lab/rainbow-submission-round2 | 173ada0e077e1b9dbd8e4a78994f87acc0c92263 | [
"CC0-1.0"
] | null | null | null | Alternative_Implementation/ssse3/IIIc_Classic/rainbow_blas_simd.h | fast-crypto-lab/rainbow-submission-round2 | 173ada0e077e1b9dbd8e4a78994f87acc0c92263 | [
"CC0-1.0"
] | 4 | 2020-10-04T13:09:01.000Z | 2021-10-11T19:30:19.000Z | #ifndef _RAINBOW_BLAS_SIMD_H_
#define _RAINBOW_BLAS_SIMD_H_
#include "blas_config.h"
#include "rainbow_config.h"
#ifndef _BLAS_SSE_
error here.
#endif
#include "gf16_sse.h"
#include "blas_sse.h"
#include "blas_matrix_sse.h"
#include "parallel_matrix_op_sse.h"
#ifdef _USE_GF16
#define gfv_generate_multab gf16v_generate_multab_sse
#define gfmat_prod_multab gf16mat_prod_multab_sse
#define batch_quad_trimat_eval_multab batch_quad_trimat_eval_multab_gf16_sse
#define batch_trimat_madd_multab batch_trimat_madd_multab_gf16_sse
#define batch_trimatTr_madd_multab batch_trimatTr_madd_multab_gf16_sse
#define batch_2trimat_madd_multab batch_2trimat_madd_multab_gf16_sse
#define batch_matTr_madd_multab batch_matTr_madd_multab_gf16_sse
#define batch_bmatTr_madd_multab batch_bmatTr_madd_multab_gf16_sse
#define batch_mat_madd_multab batch_mat_madd_multab_gf16_sse
#else
#define gfv_generate_multab gf256v_generate_multab_sse
#define gfmat_prod_multab gf256mat_prod_multab_sse
#define batch_quad_trimat_eval_multab batch_quad_trimat_eval_multab_gf256_sse
#define batch_trimat_madd_multab batch_trimat_madd_multab_gf256_sse
#define batch_trimatTr_madd_multab batch_trimatTr_madd_multab_gf256_sse
#define batch_2trimat_madd_multab batch_2trimat_madd_multab_gf256_sse
#define batch_matTr_madd_multab batch_matTr_madd_multab_gf256_sse
#define batch_bmatTr_madd_multab batch_bmatTr_madd_multab_gf256_sse
#define batch_mat_madd_multab batch_mat_madd_multab_gf256_sse
#endif
#endif
| 31.44 | 78 | 0.850509 |
d0cf30628858403fce690ab35099a23d2fcd2411 | 2,745 | h | C | csg/include/votca/csg/version.h | ipelupessy/votca | b0daafb6f503e6a55c878172ef9d68c6639da9e0 | [
"Apache-2.0"
] | null | null | null | csg/include/votca/csg/version.h | ipelupessy/votca | b0daafb6f503e6a55c878172ef9d68c6639da9e0 | [
"Apache-2.0"
] | null | null | null | csg/include/votca/csg/version.h | ipelupessy/votca | b0daafb6f503e6a55c878172ef9d68c6639da9e0 | [
"Apache-2.0"
] | null | null | null | /*
* Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org)
*
* 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.
*
*/
/**
\mainpage VOTCA C++ reference
\section intro_sec Introduction
This page is the C++ code documentation of the VOTCA package
(http://www.votca.org). The main target of VOTCA-CSG is the implementation of
systematic coarse-graining techniques. However, it offers a powerful,
object-oriented framework to develop analysis tools for particle based
molecular simulations.
A later addition is the VOTCA-XTP package for charge/excition transport and
electronic structure calculations using GW-BSE. Here we focus on CSG first.
\section started_sec Getting started
To start developing custom analysis tools, a good place to start is the
csgapps folder:
https://github.com/votca/votca/tree/master/csg/src/csgapps
It contains several small analysis tools which were implemented based upon the
VOTCA-CSG framework. We highly recomment to use an IDE such as Visual Studio
Code for development since it offers lots of guides to get started with new
code (code completion, code documentation popups, navigation through code,
...).
The main container for the whole structure is the Topology, so it is a good
advise to get comfortable with this class. Also the standard applications in
csg/src/tools might help.
\section beginner_sec For beginners: how to avoid frustration
For those not familiar with object oriented code: don't try to dig into every
single function in order to understand what exactly is going on. This strategy
only works for very small projects and is not intended for oject oriented
programs. Think about the code in layers of abstraction! Your main focus
should be on the global structure and understand how objects relate to each
other. The code was designed that you don't have to redo and understand all
the nasty details!
*/
#ifndef VOTCA_CSG_VERSION_H
#define VOTCA_CSG_VERSION_H
// Standard includes
#include <string>
namespace votca {
namespace csg {
const std::string &CsgVersionStr();
void HelpTextHeader(const std::string &tool_name);
} // namespace csg
} // namespace votca
#endif /* VOTCA_CSG_VERSION_H */
| 36.6 | 80 | 0.765027 |
cf5d433fab1de49c12f2b94f703995ec928e3187 | 1,250 | h | C | Penthesilea/GlossySpecularReflectance.h | patricknboyd/penthesilea | 62f5bf212246c724f784b1e06833428630ceda83 | [
"MIT"
] | null | null | null | Penthesilea/GlossySpecularReflectance.h | patricknboyd/penthesilea | 62f5bf212246c724f784b1e06833428630ceda83 | [
"MIT"
] | null | null | null | Penthesilea/GlossySpecularReflectance.h | patricknboyd/penthesilea | 62f5bf212246c724f784b1e06833428630ceda83 | [
"MIT"
] | null | null | null | #pragma once
#include "stdafx.h"
/// <summary>
/// Reflectance functions for glossy surfaces. Produces an effect similar to shiny plastic.
/// </summary>
class GlossySpecularReflectance : public IReflectanceFunction
{
public:
GlossySpecularReflectance();
GlossySpecularReflectance(ISampler* sampler);
/// <summary>
/// Gets the intensity of the specular reflection.
/// </summary>
/// <returns></returns>
Float GetSpecularCoefficient() const { return specularCoefficient; }
void SetSpecularCoefficient(Float value) { specularCoefficient = value; }
/// <summary>
/// Gets the phone exponent which controls the size of the specular reflection.
/// </summary>
/// <returns></returns>
Float GetPhongExponent() const { return phongExponent; }
void SetPhongExponent(Float value) { phongExponent = value; }
virtual RGBColour Calculate(const TraceResult& result, const Vector3& incoming, const Vector3 outgoing) const;
virtual RGBColour GetReflectionAngle(const TraceResult& result, Vector3& incoming, const Vector3& outgoing) const;
virtual RGBColour HemisphericalReflectance(const TraceResult& result, const Vector3& outgoing) const;
private:
Float specularCoefficient;
Float phongExponent;
}; | 33.783784 | 116 | 0.7448 |
d6b3fca47066d118cc721d91968b314132681293 | 66 | h | C | lcd/HX8347D.h | MidnightProject/AVR-Programming-Library | a923bd3395a788ce54743ce307daa2530a22a250 | [
"MIT"
] | null | null | null | lcd/HX8347D.h | MidnightProject/AVR-Programming-Library | a923bd3395a788ce54743ce307daa2530a22a250 | [
"MIT"
] | null | null | null | lcd/HX8347D.h | MidnightProject/AVR-Programming-Library | a923bd3395a788ce54743ce307daa2530a22a250 | [
"MIT"
] | null | null | null | #ifndef HX8347D_H_
#define HX8347D_H_
#endif /* HX8347D_H_ */ | 8.25 | 23 | 0.712121 |
fdbf7077db7e41697bd50e9a11d3d04057087177 | 38,221 | c | C | release/src/linux/linux/drivers/char/drm-4.0/radeon_state.c | enfoTek/tomato.linksys.e2000.nvram-mod | 2ce3a5217def49d6df7348522e2bfda702b56029 | [
"FSFAP"
] | 80 | 2015-01-02T10:14:04.000Z | 2021-06-07T06:29:49.000Z | release/src/linux/linux/drivers/char/drm-4.0/radeon_state.c | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 9 | 2015-05-14T11:03:12.000Z | 2018-01-04T07:12:58.000Z | release/src/linux/linux/drivers/char/drm-4.0/radeon_state.c | unforgiven512/tomato | 96f09fab4929c6ddde5c9113f1b2476ad37133c4 | [
"FSFAP"
] | 69 | 2015-01-02T10:45:56.000Z | 2021-09-06T07:52:13.000Z | /* radeon_state.c -- State support for Radeon -*- linux-c -*-
*
* Copyright 2000 VA Linux Systems, Inc., Fremont, California.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
* Authors:
* Kevin E. Martin <martin@valinux.com>
* Gareth Hughes <gareth@valinux.com>
*
*/
#define __NO_VERSION__
#include "drmP.h"
#include "radeon_drv.h"
#include "drm.h"
#include <linux/delay.h>
/* ================================================================
* CP hardware state programming functions
*/
static inline void radeon_emit_clip_rect( drm_radeon_private_t *dev_priv,
drm_clip_rect_t *box )
{
RING_LOCALS;
DRM_DEBUG( " box: x1=%d y1=%d x2=%d y2=%d\n",
box->x1, box->y1, box->x2, box->y2 );
BEGIN_RING( 4 );
OUT_RING( CP_PACKET0( RADEON_RE_TOP_LEFT, 0 ) );
OUT_RING( (box->y1 << 16) | box->x1 );
OUT_RING( CP_PACKET0( RADEON_RE_WIDTH_HEIGHT, 0 ) );
OUT_RING( ((box->y2 - 1) << 16) | (box->x2 - 1) );
ADVANCE_RING();
}
static inline void radeon_emit_context( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 14 );
OUT_RING( CP_PACKET0( RADEON_PP_MISC, 6 ) );
OUT_RING( ctx->pp_misc );
OUT_RING( ctx->pp_fog_color );
OUT_RING( ctx->re_solid_color );
OUT_RING( ctx->rb3d_blendcntl );
OUT_RING( ctx->rb3d_depthoffset );
OUT_RING( ctx->rb3d_depthpitch );
OUT_RING( ctx->rb3d_zstencilcntl );
OUT_RING( CP_PACKET0( RADEON_PP_CNTL, 2 ) );
OUT_RING( ctx->pp_cntl );
OUT_RING( ctx->rb3d_cntl );
OUT_RING( ctx->rb3d_coloroffset );
OUT_RING( CP_PACKET0( RADEON_RB3D_COLORPITCH, 0 ) );
OUT_RING( ctx->rb3d_colorpitch );
ADVANCE_RING();
}
static inline void radeon_emit_vertfmt( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 2 );
OUT_RING( CP_PACKET0( RADEON_SE_COORD_FMT, 0 ) );
OUT_RING( ctx->se_coord_fmt );
ADVANCE_RING();
}
static inline void radeon_emit_line( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 5 );
OUT_RING( CP_PACKET0( RADEON_RE_LINE_PATTERN, 1 ) );
OUT_RING( ctx->re_line_pattern );
OUT_RING( ctx->re_line_state );
OUT_RING( CP_PACKET0( RADEON_SE_LINE_WIDTH, 0 ) );
OUT_RING( ctx->se_line_width );
ADVANCE_RING();
}
static inline void radeon_emit_bumpmap( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 5 );
OUT_RING( CP_PACKET0( RADEON_PP_LUM_MATRIX, 0 ) );
OUT_RING( ctx->pp_lum_matrix );
OUT_RING( CP_PACKET0( RADEON_PP_ROT_MATRIX_0, 1 ) );
OUT_RING( ctx->pp_rot_matrix_0 );
OUT_RING( ctx->pp_rot_matrix_1 );
ADVANCE_RING();
}
static inline void radeon_emit_masks( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 4 );
OUT_RING( CP_PACKET0( RADEON_RB3D_STENCILREFMASK, 2 ) );
OUT_RING( ctx->rb3d_stencilrefmask );
OUT_RING( ctx->rb3d_ropcntl );
OUT_RING( ctx->rb3d_planemask );
ADVANCE_RING();
}
static inline void radeon_emit_viewport( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 7 );
OUT_RING( CP_PACKET0( RADEON_SE_VPORT_XSCALE, 5 ) );
OUT_RING( ctx->se_vport_xscale );
OUT_RING( ctx->se_vport_xoffset );
OUT_RING( ctx->se_vport_yscale );
OUT_RING( ctx->se_vport_yoffset );
OUT_RING( ctx->se_vport_zscale );
OUT_RING( ctx->se_vport_zoffset );
ADVANCE_RING();
}
static inline void radeon_emit_setup( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 4 );
OUT_RING( CP_PACKET0( RADEON_SE_CNTL, 0 ) );
OUT_RING( ctx->se_cntl );
OUT_RING( CP_PACKET0( RADEON_SE_CNTL_STATUS, 0 ) );
OUT_RING( ctx->se_cntl_status );
ADVANCE_RING();
}
static inline void radeon_emit_tcl( drm_radeon_private_t *dev_priv )
{
#ifdef TCL_ENABLE
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 29 );
OUT_RING( CP_PACKET0( RADEON_SE_TCL_MATERIAL_EMMISSIVE_RED, 27 ) );
OUT_RING( ctx->se_tcl_material_emmissive.red );
OUT_RING( ctx->se_tcl_material_emmissive.green );
OUT_RING( ctx->se_tcl_material_emmissive.blue );
OUT_RING( ctx->se_tcl_material_emmissive.alpha );
OUT_RING( ctx->se_tcl_material_ambient.red );
OUT_RING( ctx->se_tcl_material_ambient.green );
OUT_RING( ctx->se_tcl_material_ambient.blue );
OUT_RING( ctx->se_tcl_material_ambient.alpha );
OUT_RING( ctx->se_tcl_material_diffuse.red );
OUT_RING( ctx->se_tcl_material_diffuse.green );
OUT_RING( ctx->se_tcl_material_diffuse.blue );
OUT_RING( ctx->se_tcl_material_diffuse.alpha );
OUT_RING( ctx->se_tcl_material_specular.red );
OUT_RING( ctx->se_tcl_material_specular.green );
OUT_RING( ctx->se_tcl_material_specular.blue );
OUT_RING( ctx->se_tcl_material_specular.alpha );
OUT_RING( ctx->se_tcl_shininess );
OUT_RING( ctx->se_tcl_output_vtx_fmt );
OUT_RING( ctx->se_tcl_output_vtx_sel );
OUT_RING( ctx->se_tcl_matrix_select_0 );
OUT_RING( ctx->se_tcl_matrix_select_1 );
OUT_RING( ctx->se_tcl_ucp_vert_blend_ctl );
OUT_RING( ctx->se_tcl_texture_proc_ctl );
OUT_RING( ctx->se_tcl_light_model_ctl );
for ( i = 0 ; i < 4 ; i++ ) {
OUT_RING( ctx->se_tcl_per_light_ctl[i] );
}
ADVANCE_RING();
#else
DRM_ERROR( "TCL not enabled!\n" );
#endif
}
static inline void radeon_emit_misc( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_context_regs_t *ctx = &sarea_priv->context_state;
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 2 );
OUT_RING( CP_PACKET0( RADEON_RE_MISC, 0 ) );
OUT_RING( ctx->re_misc );
ADVANCE_RING();
}
static inline void radeon_emit_tex0( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_texture_regs_t *tex = &sarea_priv->tex_state[0];
RING_LOCALS;
DRM_DEBUG( " %s: offset=0x%x\n", __FUNCTION__, tex->pp_txoffset );
BEGIN_RING( 9 );
OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_0, 5 ) );
OUT_RING( tex->pp_txfilter );
OUT_RING( tex->pp_txformat );
OUT_RING( tex->pp_txoffset );
OUT_RING( tex->pp_txcblend );
OUT_RING( tex->pp_txablend );
OUT_RING( tex->pp_tfactor );
OUT_RING( CP_PACKET0( RADEON_PP_BORDER_COLOR_0, 0 ) );
OUT_RING( tex->pp_border_color );
ADVANCE_RING();
}
static inline void radeon_emit_tex1( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_texture_regs_t *tex = &sarea_priv->tex_state[1];
RING_LOCALS;
DRM_DEBUG( " %s: offset=0x%x\n", __FUNCTION__, tex->pp_txoffset );
BEGIN_RING( 9 );
OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_1, 5 ) );
OUT_RING( tex->pp_txfilter );
OUT_RING( tex->pp_txformat );
OUT_RING( tex->pp_txoffset );
OUT_RING( tex->pp_txcblend );
OUT_RING( tex->pp_txablend );
OUT_RING( tex->pp_tfactor );
OUT_RING( CP_PACKET0( RADEON_PP_BORDER_COLOR_1, 0 ) );
OUT_RING( tex->pp_border_color );
ADVANCE_RING();
}
static inline void radeon_emit_tex2( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_texture_regs_t *tex = &sarea_priv->tex_state[2];
RING_LOCALS;
DRM_DEBUG( " %s\n", __FUNCTION__ );
BEGIN_RING( 9 );
OUT_RING( CP_PACKET0( RADEON_PP_TXFILTER_2, 5 ) );
OUT_RING( tex->pp_txfilter );
OUT_RING( tex->pp_txformat );
OUT_RING( tex->pp_txoffset );
OUT_RING( tex->pp_txcblend );
OUT_RING( tex->pp_txablend );
OUT_RING( tex->pp_tfactor );
OUT_RING( CP_PACKET0( RADEON_PP_BORDER_COLOR_2, 0 ) );
OUT_RING( tex->pp_border_color );
ADVANCE_RING();
}
static inline void radeon_emit_state( drm_radeon_private_t *dev_priv )
{
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
unsigned int dirty = sarea_priv->dirty;
DRM_DEBUG( "%s: dirty=0x%08x\n", __FUNCTION__, dirty );
if ( dirty & RADEON_UPLOAD_CONTEXT ) {
radeon_emit_context( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_CONTEXT;
}
if ( dirty & RADEON_UPLOAD_VERTFMT ) {
radeon_emit_vertfmt( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_VERTFMT;
}
if ( dirty & RADEON_UPLOAD_LINE ) {
radeon_emit_line( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_LINE;
}
if ( dirty & RADEON_UPLOAD_BUMPMAP ) {
radeon_emit_bumpmap( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_BUMPMAP;
}
if ( dirty & RADEON_UPLOAD_MASKS ) {
radeon_emit_masks( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_MASKS;
}
if ( dirty & RADEON_UPLOAD_VIEWPORT ) {
radeon_emit_viewport( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_VIEWPORT;
}
if ( dirty & RADEON_UPLOAD_SETUP ) {
radeon_emit_setup( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_SETUP;
}
if ( dirty & RADEON_UPLOAD_TCL ) {
#ifdef TCL_ENABLE
radeon_emit_tcl( dev_priv );
#endif
sarea_priv->dirty &= ~RADEON_UPLOAD_TCL;
}
if ( dirty & RADEON_UPLOAD_MISC ) {
radeon_emit_misc( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_MISC;
}
if ( dirty & RADEON_UPLOAD_TEX0 ) {
radeon_emit_tex0( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_TEX0;
}
if ( dirty & RADEON_UPLOAD_TEX1 ) {
radeon_emit_tex1( dev_priv );
sarea_priv->dirty &= ~RADEON_UPLOAD_TEX1;
}
if ( dirty & RADEON_UPLOAD_TEX2 ) {
sarea_priv->dirty &= ~RADEON_UPLOAD_TEX2;
}
sarea_priv->dirty &= ~(RADEON_UPLOAD_TEX0IMAGES |
RADEON_UPLOAD_TEX1IMAGES |
RADEON_UPLOAD_TEX2IMAGES |
RADEON_REQUIRE_QUIESCENCE);
}
#if RADEON_PERFORMANCE_BOXES
/* ================================================================
* Performance monitoring functions
*/
static void radeon_clear_box( drm_radeon_private_t *dev_priv,
int x, int y, int w, int h,
int r, int g, int b )
{
u32 pitch, offset;
u32 color;
RING_LOCALS;
switch ( dev_priv->color_fmt ) {
case RADEON_COLOR_FORMAT_RGB565:
color = (((r & 0xf8) << 8) |
((g & 0xfc) << 3) |
((b & 0xf8) >> 3));
break;
case RADEON_COLOR_FORMAT_ARGB8888:
default:
color = (((0xff) << 24) | (r << 16) | (g << 8) | b);
break;
}
offset = dev_priv->back_offset;
pitch = dev_priv->back_pitch >> 3;
BEGIN_RING( 6 );
OUT_RING( CP_PACKET3( RADEON_CNTL_PAINT_MULTI, 4 ) );
OUT_RING( RADEON_GMC_DST_PITCH_OFFSET_CNTL |
RADEON_GMC_BRUSH_SOLID_COLOR |
(dev_priv->color_fmt << 8) |
RADEON_GMC_SRC_DATATYPE_COLOR |
RADEON_ROP3_P |
RADEON_GMC_CLR_CMP_CNTL_DIS );
OUT_RING( (pitch << 22) | (offset >> 5) );
OUT_RING( color );
OUT_RING( (x << 16) | y );
OUT_RING( (w << 16) | h );
ADVANCE_RING();
}
static void radeon_cp_performance_boxes( drm_radeon_private_t *dev_priv )
{
if ( atomic_read( &dev_priv->idle_count ) == 0 ) {
radeon_clear_box( dev_priv, 64, 4, 8, 8, 0, 255, 0 );
} else {
atomic_set( &dev_priv->idle_count, 0 );
}
}
#endif
/* ================================================================
* CP command dispatch functions
*/
static void radeon_print_dirty( const char *msg, unsigned int flags )
{
DRM_DEBUG( "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
msg,
flags,
(flags & RADEON_UPLOAD_CONTEXT) ? "context, " : "",
(flags & RADEON_UPLOAD_VERTFMT) ? "vertfmt, " : "",
(flags & RADEON_UPLOAD_LINE) ? "line, " : "",
(flags & RADEON_UPLOAD_BUMPMAP) ? "bumpmap, " : "",
(flags & RADEON_UPLOAD_MASKS) ? "masks, " : "",
(flags & RADEON_UPLOAD_VIEWPORT) ? "viewport, " : "",
(flags & RADEON_UPLOAD_SETUP) ? "setup, " : "",
(flags & RADEON_UPLOAD_TCL) ? "tcl, " : "",
(flags & RADEON_UPLOAD_MISC) ? "misc, " : "",
(flags & RADEON_UPLOAD_TEX0) ? "tex0, " : "",
(flags & RADEON_UPLOAD_TEX1) ? "tex1, " : "",
(flags & RADEON_UPLOAD_TEX2) ? "tex2, " : "",
(flags & RADEON_UPLOAD_CLIPRECTS) ? "cliprects, " : "",
(flags & RADEON_REQUIRE_QUIESCENCE) ? "quiescence, " : "" );
}
static void radeon_cp_dispatch_clear( drm_device_t *dev,
drm_radeon_clear_t *clear )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
int nbox = sarea_priv->nbox;
drm_clip_rect_t *pbox = sarea_priv->boxes;
unsigned int flags = clear->flags;
int i;
RING_LOCALS;
DRM_DEBUG( "%s\n", __FUNCTION__ );
radeon_update_ring_snapshot( dev_priv );
if ( dev_priv->page_flipping && dev_priv->current_page == 1 ) {
unsigned int tmp = flags;
flags &= ~(RADEON_FRONT | RADEON_BACK);
if ( tmp & RADEON_FRONT ) flags |= RADEON_BACK;
if ( tmp & RADEON_BACK ) flags |= RADEON_FRONT;
}
for ( i = 0 ; i < nbox ; i++ ) {
int x = pbox[i].x1;
int y = pbox[i].y1;
int w = pbox[i].x2 - x;
int h = pbox[i].y2 - y;
DRM_DEBUG( "dispatch clear %d,%d-%d,%d flags 0x%x\n",
x, y, w, h, flags );
if ( flags & (RADEON_FRONT | RADEON_BACK) ) {
BEGIN_RING( 4 );
/* Ensure the 3D stream is idle before doing a
* 2D fill to clear the front or back buffer.
*/
RADEON_WAIT_UNTIL_3D_IDLE();
OUT_RING( CP_PACKET0( RADEON_DP_WRITE_MASK, 0 ) );
OUT_RING( sarea_priv->context_state.rb3d_planemask );
ADVANCE_RING();
/* Make sure we restore the 3D state next time.
*/
dev_priv->sarea_priv->dirty |= (RADEON_UPLOAD_CONTEXT |
RADEON_UPLOAD_MASKS);
}
if ( flags & RADEON_FRONT ) {
BEGIN_RING( 6 );
OUT_RING( CP_PACKET3( RADEON_CNTL_PAINT_MULTI, 4 ) );
OUT_RING( RADEON_GMC_DST_PITCH_OFFSET_CNTL |
RADEON_GMC_BRUSH_SOLID_COLOR |
(dev_priv->color_fmt << 8) |
RADEON_GMC_SRC_DATATYPE_COLOR |
RADEON_ROP3_P |
RADEON_GMC_CLR_CMP_CNTL_DIS );
OUT_RING( dev_priv->front_pitch_offset );
OUT_RING( clear->clear_color );
OUT_RING( (x << 16) | y );
OUT_RING( (w << 16) | h );
ADVANCE_RING();
}
if ( flags & RADEON_BACK ) {
BEGIN_RING( 6 );
OUT_RING( CP_PACKET3( RADEON_CNTL_PAINT_MULTI, 4 ) );
OUT_RING( RADEON_GMC_DST_PITCH_OFFSET_CNTL |
RADEON_GMC_BRUSH_SOLID_COLOR |
(dev_priv->color_fmt << 8) |
RADEON_GMC_SRC_DATATYPE_COLOR |
RADEON_ROP3_P |
RADEON_GMC_CLR_CMP_CNTL_DIS );
OUT_RING( dev_priv->back_pitch_offset );
OUT_RING( clear->clear_color );
OUT_RING( (x << 16) | y );
OUT_RING( (w << 16) | h );
ADVANCE_RING();
}
if ( flags & RADEON_DEPTH ) {
drm_radeon_depth_clear_t *depth_clear =
&dev_priv->depth_clear;
if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
radeon_emit_state( dev_priv );
}
BEGIN_RING( 23 );
RADEON_WAIT_UNTIL_2D_IDLE();
OUT_RING( CP_PACKET0( RADEON_PP_CNTL, 1 ) );
OUT_RING( 0x00000000 );
OUT_RING( depth_clear->rb3d_cntl );
OUT_RING( CP_PACKET0( RADEON_RB3D_ZSTENCILCNTL, 0 ) );
OUT_RING( depth_clear->rb3d_zstencilcntl );
OUT_RING( CP_PACKET0( RADEON_RB3D_PLANEMASK, 0 ) );
OUT_RING( 0x00000000 );
OUT_RING( CP_PACKET0( RADEON_SE_CNTL, 0 ) );
OUT_RING( depth_clear->se_cntl );
OUT_RING( CP_PACKET3( RADEON_3D_DRAW_IMMD, 10 ) );
OUT_RING( RADEON_VTX_Z_PRESENT );
OUT_RING( (RADEON_PRIM_TYPE_RECT_LIST |
RADEON_PRIM_WALK_RING |
RADEON_MAOS_ENABLE |
RADEON_VTX_FMT_RADEON_MODE |
(3 << RADEON_NUM_VERTICES_SHIFT)) );
OUT_RING( clear->rect.ui[CLEAR_X1] );
OUT_RING( clear->rect.ui[CLEAR_Y1] );
OUT_RING( clear->rect.ui[CLEAR_DEPTH] );
OUT_RING( clear->rect.ui[CLEAR_X1] );
OUT_RING( clear->rect.ui[CLEAR_Y2] );
OUT_RING( clear->rect.ui[CLEAR_DEPTH] );
OUT_RING( clear->rect.ui[CLEAR_X2] );
OUT_RING( clear->rect.ui[CLEAR_Y2] );
OUT_RING( clear->rect.ui[CLEAR_DEPTH] );
ADVANCE_RING();
/* Make sure we restore the 3D state next time.
*/
dev_priv->sarea_priv->dirty |= (RADEON_UPLOAD_CONTEXT |
RADEON_UPLOAD_SETUP |
RADEON_UPLOAD_MASKS);
}
}
/* Increment the clear counter. The client-side 3D driver must
* wait on this value before performing the clear ioctl. We
* need this because the card's so damned fast...
*/
dev_priv->sarea_priv->last_clear++;
BEGIN_RING( 4 );
RADEON_CLEAR_AGE( dev_priv->sarea_priv->last_clear );
RADEON_WAIT_UNTIL_IDLE();
ADVANCE_RING();
}
static void radeon_cp_dispatch_swap( drm_device_t *dev )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
int nbox = sarea_priv->nbox;
drm_clip_rect_t *pbox = sarea_priv->boxes;
int i;
RING_LOCALS;
DRM_DEBUG( "%s\n", __FUNCTION__ );
radeon_update_ring_snapshot( dev_priv );
#if RADEON_PERFORMANCE_BOXES
/* Do some trivial performance monitoring...
*/
radeon_cp_performance_boxes( dev_priv );
#endif
/* Wait for the 3D stream to idle before dispatching the bitblt.
* This will prevent data corruption between the two streams.
*/
BEGIN_RING( 2 );
RADEON_WAIT_UNTIL_3D_IDLE();
ADVANCE_RING();
for ( i = 0 ; i < nbox ; i++ ) {
int x = pbox[i].x1;
int y = pbox[i].y1;
int w = pbox[i].x2 - x;
int h = pbox[i].y2 - y;
DRM_DEBUG( "dispatch swap %d,%d-%d,%d\n",
x, y, w, h );
BEGIN_RING( 7 );
OUT_RING( CP_PACKET3( RADEON_CNTL_BITBLT_MULTI, 5 ) );
OUT_RING( RADEON_GMC_SRC_PITCH_OFFSET_CNTL |
RADEON_GMC_DST_PITCH_OFFSET_CNTL |
RADEON_GMC_BRUSH_NONE |
(dev_priv->color_fmt << 8) |
RADEON_GMC_SRC_DATATYPE_COLOR |
RADEON_ROP3_S |
RADEON_DP_SRC_SOURCE_MEMORY |
RADEON_GMC_CLR_CMP_CNTL_DIS |
RADEON_GMC_WR_MSK_DIS );
OUT_RING( dev_priv->back_pitch_offset );
OUT_RING( dev_priv->front_pitch_offset );
OUT_RING( (x << 16) | y );
OUT_RING( (x << 16) | y );
OUT_RING( (w << 16) | h );
ADVANCE_RING();
}
/* Increment the frame counter. The client-side 3D driver must
* throttle the framerate by waiting for this value before
* performing the swapbuffer ioctl.
*/
dev_priv->sarea_priv->last_frame++;
BEGIN_RING( 4 );
RADEON_FRAME_AGE( dev_priv->sarea_priv->last_frame );
RADEON_WAIT_UNTIL_2D_IDLE();
ADVANCE_RING();
}
static void radeon_cp_dispatch_flip( drm_device_t *dev )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
RING_LOCALS;
DRM_DEBUG( "%s: page=%d\n", __FUNCTION__, dev_priv->current_page );
radeon_update_ring_snapshot( dev_priv );
#if RADEON_PERFORMANCE_BOXES
/* Do some trivial performance monitoring...
*/
radeon_cp_performance_boxes( dev_priv );
#endif
BEGIN_RING( 6 );
RADEON_WAIT_UNTIL_3D_IDLE();
RADEON_WAIT_UNTIL_PAGE_FLIPPED();
OUT_RING( CP_PACKET0( RADEON_CRTC_OFFSET, 0 ) );
if ( dev_priv->current_page == 0 ) {
OUT_RING( dev_priv->back_offset );
dev_priv->current_page = 1;
} else {
OUT_RING( dev_priv->front_offset );
dev_priv->current_page = 0;
}
ADVANCE_RING();
/* Increment the frame counter. The client-side 3D driver must
* throttle the framerate by waiting for this value before
* performing the swapbuffer ioctl.
*/
dev_priv->sarea_priv->last_frame++;
BEGIN_RING( 2 );
RADEON_FRAME_AGE( dev_priv->sarea_priv->last_frame );
ADVANCE_RING();
}
static void radeon_cp_dispatch_vertex( drm_device_t *dev,
drm_buf_t *buf )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_buf_priv_t *buf_priv = buf->dev_private;
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
int format = sarea_priv->vc_format;
int offset = dev_priv->agp_buffers_offset + buf->offset;
int size = buf->used;
int prim = buf_priv->prim;
int i = 0;
RING_LOCALS;
DRM_DEBUG( "%s: nbox=%d\n", __FUNCTION__, sarea_priv->nbox );
radeon_update_ring_snapshot( dev_priv );
if ( 0 )
radeon_print_dirty( "dispatch_vertex", sarea_priv->dirty );
if ( buf->used ) {
buf_priv->dispatched = 1;
if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
radeon_emit_state( dev_priv );
}
do {
/* Emit the next set of up to three cliprects */
if ( i < sarea_priv->nbox ) {
radeon_emit_clip_rect( dev_priv,
&sarea_priv->boxes[i] );
}
/* Emit the vertex buffer rendering commands */
BEGIN_RING( 5 );
OUT_RING( CP_PACKET3( RADEON_3D_RNDR_GEN_INDX_PRIM, 3 ) );
OUT_RING( offset );
OUT_RING( size );
OUT_RING( format );
OUT_RING( prim | RADEON_PRIM_WALK_LIST |
RADEON_COLOR_ORDER_RGBA |
RADEON_VTX_FMT_RADEON_MODE |
(size << RADEON_NUM_VERTICES_SHIFT) );
ADVANCE_RING();
i++;
} while ( i < sarea_priv->nbox );
}
if ( buf_priv->discard ) {
buf_priv->age = dev_priv->sarea_priv->last_dispatch;
/* Emit the vertex buffer age */
BEGIN_RING( 2 );
RADEON_DISPATCH_AGE( buf_priv->age );
ADVANCE_RING();
buf->pending = 1;
buf->used = 0;
buf_priv->dispatched = 0;
}
dev_priv->sarea_priv->last_dispatch++;
sarea_priv->dirty &= ~RADEON_UPLOAD_CLIPRECTS;
sarea_priv->nbox = 0;
}
static void radeon_cp_dispatch_indirect( drm_device_t *dev,
drm_buf_t *buf,
int start, int end )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_buf_priv_t *buf_priv = buf->dev_private;
RING_LOCALS;
DRM_DEBUG( "indirect: buf=%d s=0x%x e=0x%x\n",
buf->idx, start, end );
radeon_update_ring_snapshot( dev_priv );
if ( start != end ) {
int offset = (dev_priv->agp_buffers_offset
+ buf->offset + start);
int dwords = (end - start + 3) / sizeof(u32);
/* Indirect buffer data must be an even number of
* dwords, so if we've been given an odd number we must
* pad the data with a Type-2 CP packet.
*/
if ( dwords & 1 ) {
u32 *data = (u32 *)
((char *)dev_priv->buffers->handle
+ buf->offset + start);
data[dwords++] = RADEON_CP_PACKET2;
}
buf_priv->dispatched = 1;
/* Fire off the indirect buffer */
BEGIN_RING( 3 );
OUT_RING( CP_PACKET0( RADEON_CP_IB_BASE, 1 ) );
OUT_RING( offset );
OUT_RING( dwords );
ADVANCE_RING();
}
if ( buf_priv->discard ) {
buf_priv->age = dev_priv->sarea_priv->last_dispatch;
/* Emit the indirect buffer age */
BEGIN_RING( 2 );
RADEON_DISPATCH_AGE( buf_priv->age );
ADVANCE_RING();
buf->pending = 1;
buf->used = 0;
buf_priv->dispatched = 0;
}
dev_priv->sarea_priv->last_dispatch++;
}
static void radeon_cp_dispatch_indices( drm_device_t *dev,
drm_buf_t *buf,
int start, int end,
int count )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_buf_priv_t *buf_priv = buf->dev_private;
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
int format = sarea_priv->vc_format;
int offset = dev_priv->agp_buffers_offset;
int prim = buf_priv->prim;
u32 *data;
int dwords;
int i = 0;
RING_LOCALS;
DRM_DEBUG( "indices: s=%d e=%d c=%d\n", start, end, count );
radeon_update_ring_snapshot( dev_priv );
if ( 0 )
radeon_print_dirty( "dispatch_indices", sarea_priv->dirty );
if ( start != end ) {
buf_priv->dispatched = 1;
if ( sarea_priv->dirty & ~RADEON_UPLOAD_CLIPRECTS ) {
radeon_emit_state( dev_priv );
}
dwords = (end - start + 3) / sizeof(u32);
data = (u32 *)((char *)dev_priv->buffers->handle
+ buf->offset + start);
data[0] = CP_PACKET3( RADEON_3D_RNDR_GEN_INDX_PRIM, dwords-2 );
data[1] = offset;
data[2] = RADEON_MAX_VB_VERTS;
data[3] = format;
data[4] = (prim | RADEON_PRIM_WALK_IND |
RADEON_COLOR_ORDER_RGBA |
RADEON_VTX_FMT_RADEON_MODE |
(count << RADEON_NUM_VERTICES_SHIFT) );
if ( count & 0x1 ) {
data[dwords-1] &= 0x0000ffff;
}
do {
/* Emit the next set of up to three cliprects */
if ( i < sarea_priv->nbox ) {
radeon_emit_clip_rect( dev_priv,
&sarea_priv->boxes[i] );
}
radeon_cp_dispatch_indirect( dev, buf, start, end );
i++;
} while ( i < sarea_priv->nbox );
}
if ( buf_priv->discard ) {
buf_priv->age = dev_priv->sarea_priv->last_dispatch;
/* Emit the vertex buffer age */
BEGIN_RING( 2 );
RADEON_DISPATCH_AGE( buf_priv->age );
ADVANCE_RING();
buf->pending = 1;
buf_priv->dispatched = 0;
}
dev_priv->sarea_priv->last_dispatch++;
sarea_priv->dirty &= ~RADEON_UPLOAD_CLIPRECTS;
sarea_priv->nbox = 0;
}
static int radeon_cp_dispatch_blit( drm_device_t *dev,
drm_radeon_blit_t *blit )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_device_dma_t *dma = dev->dma;
drm_buf_t *buf;
drm_radeon_buf_priv_t *buf_priv;
u32 format;
u32 *data;
int dword_shift, dwords;
RING_LOCALS;
DRM_DEBUG( "blit: ofs=0x%x p=%d f=%d x=%hd y=%hd w=%hd h=%hd\n",
blit->offset >> 10, blit->pitch, blit->format,
blit->x, blit->y, blit->width, blit->height );
radeon_update_ring_snapshot( dev_priv );
/* The compiler won't optimize away a division by a variable,
* even if the only legal values are powers of two. Thus, we'll
* use a shift instead.
*/
switch ( blit->format ) {
case RADEON_TXF_32BPP_ARGB8888:
case RADEON_TXF_32BPP_RGBA8888:
format = RADEON_COLOR_FORMAT_ARGB8888;
dword_shift = 0;
break;
case RADEON_TXF_16BPP_AI88:
case RADEON_TXF_16BPP_ARGB1555:
case RADEON_TXF_16BPP_RGB565:
case RADEON_TXF_16BPP_ARGB4444:
format = RADEON_COLOR_FORMAT_RGB565;
dword_shift = 1;
break;
case RADEON_TXF_8BPP_I:
case RADEON_TXF_8BPP_RGB332:
format = RADEON_COLOR_FORMAT_CI8;
dword_shift = 2;
break;
default:
DRM_ERROR( "invalid blit format %d\n", blit->format );
return -EINVAL;
}
/* Flush the pixel cache. This ensures no pixel data gets mixed
* up with the texture data from the host data blit, otherwise
* part of the texture image may be corrupted.
*/
BEGIN_RING( 4 );
RADEON_FLUSH_CACHE();
RADEON_WAIT_UNTIL_IDLE();
ADVANCE_RING();
/* Dispatch the indirect buffer.
*/
buf = dma->buflist[blit->idx];
buf_priv = buf->dev_private;
if ( buf->pid != current->pid ) {
DRM_ERROR( "process %d using buffer owned by %d\n",
current->pid, buf->pid );
return -EINVAL;
}
if ( buf->pending ) {
DRM_ERROR( "sending pending buffer %d\n", blit->idx );
return -EINVAL;
}
buf_priv->discard = 1;
dwords = (blit->width * blit->height) >> dword_shift;
if ( !dwords ) dwords = 1;
data = (u32 *)((char *)dev_priv->buffers->handle + buf->offset);
data[0] = CP_PACKET3( RADEON_CNTL_HOSTDATA_BLT, dwords + 6 );
data[1] = (RADEON_GMC_DST_PITCH_OFFSET_CNTL |
RADEON_GMC_BRUSH_NONE |
(format << 8) |
RADEON_GMC_SRC_DATATYPE_COLOR |
RADEON_ROP3_S |
RADEON_DP_SRC_SOURCE_HOST_DATA |
RADEON_GMC_CLR_CMP_CNTL_DIS |
RADEON_GMC_WR_MSK_DIS);
data[2] = (blit->pitch << 22) | (blit->offset >> 10);
data[3] = 0xffffffff;
data[4] = 0xffffffff;
data[5] = (blit->y << 16) | blit->x;
data[6] = (blit->height << 16) | blit->width;
data[7] = dwords;
buf->used = (dwords + 8) * sizeof(u32);
radeon_cp_dispatch_indirect( dev, buf, 0, buf->used );
/* Flush the pixel cache after the blit completes. This ensures
* the texture data is written out to memory before rendering
* continues.
*/
BEGIN_RING( 4 );
RADEON_FLUSH_CACHE();
RADEON_WAIT_UNTIL_2D_IDLE();
ADVANCE_RING();
return 0;
}
static void radeon_cp_dispatch_stipple( drm_device_t *dev, u32 *stipple )
{
drm_radeon_private_t *dev_priv = dev->dev_private;
int i;
RING_LOCALS;
DRM_DEBUG( "%s\n", __FUNCTION__ );
radeon_update_ring_snapshot( dev_priv );
BEGIN_RING( 35 );
OUT_RING( CP_PACKET0( RADEON_RE_STIPPLE_ADDR, 0 ) );
OUT_RING( 0x00000000 );
OUT_RING( CP_PACKET0_TABLE( RADEON_RE_STIPPLE_DATA, 31 ) );
for ( i = 0 ; i < 32 ; i++ ) {
OUT_RING( stipple[i] );
}
ADVANCE_RING();
}
/* ================================================================
* IOCTL functions
*/
int radeon_cp_clear( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
drm_radeon_clear_t clear;
DRM_DEBUG( "%s\n", __FUNCTION__ );
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) ||
dev->lock.pid != current->pid ) {
DRM_ERROR( "%s called without lock held\n", __FUNCTION__ );
return -EINVAL;
}
if ( copy_from_user( &clear, (drm_radeon_clear_t *) arg,
sizeof(clear) ) )
return -EFAULT;
if ( sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS )
sarea_priv->nbox = RADEON_NR_SAREA_CLIPRECTS;
radeon_cp_dispatch_clear( dev, &clear );
return 0;
}
int radeon_cp_swap( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
DRM_DEBUG( "%s\n", __FUNCTION__ );
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) ||
dev->lock.pid != current->pid ) {
DRM_ERROR( "%s called without lock held\n", __FUNCTION__ );
return -EINVAL;
}
if ( sarea_priv->nbox > RADEON_NR_SAREA_CLIPRECTS )
sarea_priv->nbox = RADEON_NR_SAREA_CLIPRECTS;
if ( !dev_priv->page_flipping ) {
radeon_cp_dispatch_swap( dev );
dev_priv->sarea_priv->dirty |= (RADEON_UPLOAD_CONTEXT |
RADEON_UPLOAD_MASKS);
} else {
radeon_cp_dispatch_flip( dev );
}
return 0;
}
int radeon_cp_vertex( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_device_dma_t *dma = dev->dma;
drm_buf_t *buf;
drm_radeon_buf_priv_t *buf_priv;
drm_radeon_vertex_t vertex;
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) ||
dev->lock.pid != current->pid ) {
DRM_ERROR( "%s called without lock held\n", __FUNCTION__ );
return -EINVAL;
}
if ( !dev_priv || dev_priv->is_pci ) {
DRM_ERROR( "%s called with a PCI card\n", __FUNCTION__ );
return -EINVAL;
}
if ( copy_from_user( &vertex, (drm_radeon_vertex_t *)arg,
sizeof(vertex) ) )
return -EFAULT;
DRM_DEBUG( "%s: pid=%d index=%d count=%d discard=%d\n",
__FUNCTION__, current->pid,
vertex.idx, vertex.count, vertex.discard );
if ( vertex.idx < 0 || vertex.idx >= dma->buf_count ) {
DRM_ERROR( "buffer index %d (of %d max)\n",
vertex.idx, dma->buf_count - 1 );
return -EINVAL;
}
if ( vertex.prim < 0 ||
vertex.prim > RADEON_PRIM_TYPE_3VRT_LINE_LIST ) {
DRM_ERROR( "buffer prim %d\n", vertex.prim );
return -EINVAL;
}
VB_AGE_CHECK_WITH_RET( dev_priv );
buf = dma->buflist[vertex.idx];
buf_priv = buf->dev_private;
if ( buf->pid != current->pid ) {
DRM_ERROR( "process %d using buffer owned by %d\n",
current->pid, buf->pid );
return -EINVAL;
}
if ( buf->pending ) {
DRM_ERROR( "sending pending buffer %d\n", vertex.idx );
return -EINVAL;
}
buf->used = vertex.count;
buf_priv->prim = vertex.prim;
buf_priv->discard = vertex.discard;
radeon_cp_dispatch_vertex( dev, buf );
return 0;
}
int radeon_cp_indices( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_device_dma_t *dma = dev->dma;
drm_buf_t *buf;
drm_radeon_buf_priv_t *buf_priv;
drm_radeon_indices_t elts;
int count;
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) ||
dev->lock.pid != current->pid ) {
DRM_ERROR( "%s called without lock held\n", __FUNCTION__ );
return -EINVAL;
}
if ( !dev_priv || dev_priv->is_pci ) {
DRM_ERROR( "%s called with a PCI card\n", __FUNCTION__ );
return -EINVAL;
}
if ( copy_from_user( &elts, (drm_radeon_indices_t *)arg,
sizeof(elts) ) )
return -EFAULT;
DRM_DEBUG( "%s: pid=%d index=%d start=%d end=%d discard=%d\n",
__FUNCTION__, current->pid,
elts.idx, elts.start, elts.end, elts.discard );
if ( elts.idx < 0 || elts.idx >= dma->buf_count ) {
DRM_ERROR( "buffer index %d (of %d max)\n",
elts.idx, dma->buf_count - 1 );
return -EINVAL;
}
if ( elts.prim < 0 ||
elts.prim > RADEON_PRIM_TYPE_3VRT_LINE_LIST ) {
DRM_ERROR( "buffer prim %d\n", elts.prim );
return -EINVAL;
}
VB_AGE_CHECK_WITH_RET( dev_priv );
buf = dma->buflist[elts.idx];
buf_priv = buf->dev_private;
if ( buf->pid != current->pid ) {
DRM_ERROR( "process %d using buffer owned by %d\n",
current->pid, buf->pid );
return -EINVAL;
}
if ( buf->pending ) {
DRM_ERROR( "sending pending buffer %d\n", elts.idx );
return -EINVAL;
}
count = (elts.end - elts.start) / sizeof(u16);
elts.start -= RADEON_INDEX_PRIM_OFFSET;
if ( elts.start & 0x7 ) {
DRM_ERROR( "misaligned buffer 0x%x\n", elts.start );
return -EINVAL;
}
if ( elts.start < buf->used ) {
DRM_ERROR( "no header 0x%x - 0x%x\n", elts.start, buf->used );
return -EINVAL;
}
buf->used = elts.end;
buf_priv->prim = elts.prim;
buf_priv->discard = elts.discard;
radeon_cp_dispatch_indices( dev, buf, elts.start, elts.end, count );
return 0;
}
int radeon_cp_blit( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_device_dma_t *dma = dev->dma;
drm_radeon_blit_t blit;
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) ||
dev->lock.pid != current->pid ) {
DRM_ERROR( "%s called without lock held\n", __FUNCTION__ );
return -EINVAL;
}
if ( copy_from_user( &blit, (drm_radeon_blit_t *)arg,
sizeof(blit) ) )
return -EFAULT;
DRM_DEBUG( "%s: pid=%d index=%d\n",
__FUNCTION__, current->pid, blit.idx );
if ( blit.idx < 0 || blit.idx > dma->buf_count ) {
DRM_ERROR( "sending %d buffers (of %d max)\n",
blit.idx, dma->buf_count );
return -EINVAL;
}
VB_AGE_CHECK_WITH_RET( dev_priv );
return radeon_cp_dispatch_blit( dev, &blit );
}
int radeon_cp_stipple( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_radeon_stipple_t stipple;
u32 mask[32];
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) ||
dev->lock.pid != current->pid ) {
DRM_ERROR( "%s called without lock held\n", __FUNCTION__ );
return -EINVAL;
}
if ( copy_from_user( &stipple, (drm_radeon_stipple_t *)arg,
sizeof(stipple) ) )
return -EFAULT;
if ( copy_from_user( &mask, stipple.mask,
32 * sizeof(u32) ) )
return -EFAULT;
radeon_cp_dispatch_stipple( dev, mask );
return 0;
}
int radeon_cp_indirect( struct inode *inode, struct file *filp,
unsigned int cmd, unsigned long arg )
{
drm_file_t *priv = filp->private_data;
drm_device_t *dev = priv->dev;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_device_dma_t *dma = dev->dma;
drm_buf_t *buf;
drm_radeon_buf_priv_t *buf_priv;
drm_radeon_indirect_t indirect;
RING_LOCALS;
if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) ||
dev->lock.pid != current->pid ) {
DRM_ERROR( "%s called without lock held\n", __FUNCTION__ );
return -EINVAL;
}
if ( !dev_priv || dev_priv->is_pci ) {
DRM_ERROR( "%s called with a PCI card\n", __FUNCTION__ );
return -EINVAL;
}
if ( copy_from_user( &indirect, (drm_radeon_indirect_t *)arg,
sizeof(indirect) ) )
return -EFAULT;
DRM_DEBUG( "indirect: idx=%d s=%d e=%d d=%d\n",
indirect.idx, indirect.start,
indirect.end, indirect.discard );
if ( indirect.idx < 0 || indirect.idx >= dma->buf_count ) {
DRM_ERROR( "buffer index %d (of %d max)\n",
indirect.idx, dma->buf_count - 1 );
return -EINVAL;
}
buf = dma->buflist[indirect.idx];
buf_priv = buf->dev_private;
if ( buf->pid != current->pid ) {
DRM_ERROR( "process %d using buffer owned by %d\n",
current->pid, buf->pid );
return -EINVAL;
}
if ( buf->pending ) {
DRM_ERROR( "sending pending buffer %d\n", indirect.idx );
return -EINVAL;
}
if ( indirect.start < buf->used ) {
DRM_ERROR( "reusing indirect: start=0x%x actual=0x%x\n",
indirect.start, buf->used );
return -EINVAL;
}
VB_AGE_CHECK_WITH_RET( dev_priv );
buf->used = indirect.end;
buf_priv->discard = indirect.discard;
/* Wait for the 3D stream to idle before the indirect buffer
* containing 2D acceleration commands is processed.
*/
BEGIN_RING( 2 );
RADEON_WAIT_UNTIL_3D_IDLE();
ADVANCE_RING();
/* Dispatch the indirect buffer full of commands from the
* X server. This is insecure and is thus only available to
* privileged clients.
*/
radeon_cp_dispatch_indirect( dev, buf, indirect.start, indirect.end );
return 0;
}
| 26.560806 | 78 | 0.684388 |
aaab1ee10f87a2f664eb319406e8ffebbd4c86c1 | 302 | h | C | test/Interpreter/Inputs/availability_host_os.h | lwhsu/swift | e1e7a3fe75b4762d5e3d4d241f40b56946a03fdb | [
"Apache-2.0"
] | 427 | 2018-05-29T14:21:02.000Z | 2022-03-16T03:17:54.000Z | test/Interpreter/Inputs/availability_host_os.h | lwhsu/swift | e1e7a3fe75b4762d5e3d4d241f40b56946a03fdb | [
"Apache-2.0"
] | 153 | 2018-01-21T15:24:47.000Z | 2018-09-13T12:46:16.000Z | test/Interpreter/Inputs/availability_host_os.h | lwhsu/swift | e1e7a3fe75b4762d5e3d4d241f40b56946a03fdb | [
"Apache-2.0"
] | 52 | 2018-07-19T19:57:32.000Z | 2022-03-11T16:05:38.000Z | __attribute__((availability(macosx,introduced=10.9)))
static inline int mavericks() { return 9; }
__attribute__((availability(macosx,introduced=10.10)))
static inline int yosemite() { return 10; }
__attribute__((availability(macosx,introduced=10.99)))
static inline int todosSantos() { return 99; }
| 43.142857 | 55 | 0.761589 |
10f6cc8bfdd40ba2f73e2f0ee248bddbe7889cd7 | 676 | h | C | System/Library/PrivateFrameworks/GeoServices.framework/GEOSpatialPlaceLookupResult.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | 1 | 2020-11-04T15:43:01.000Z | 2020-11-04T15:43:01.000Z | System/Library/PrivateFrameworks/GeoServices.framework/GEOSpatialPlaceLookupResult.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | System/Library/PrivateFrameworks/GeoServices.framework/GEOSpatialPlaceLookupResult.h | zhangkn/iOS14Header | 4323e9459ed6f6f5504ecbea2710bfd6c3d7c946 | [
"MIT"
] | null | null | null | /*
* This header is generated by classdump-dyld 1.0
* on Sunday, September 27, 2020 at 11:39:31 AM Mountain Standard Time
* Operating System: Version 14.0 (Build 18A373)
* Image Source: /System/Library/PrivateFrameworks/GeoServices.framework/GeoServices
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos.
*/
@class NSMapTable;
@interface GEOSpatialPlaceLookupResult : NSObject {
NSMapTable* _parametersToMapItemsMap;
NSMapTable* _parametersToResultItemMap;
}
-(id)mapItemsForSpatialLookupParameters:(id)arg1 ;
-(id)resultItemForSpatialLookupParameters:(id)arg1 ;
-(id)init;
-(id)initWithMapItemMap:(id)arg1 resultItemMap:(id)arg2 ;
@end
| 28.166667 | 83 | 0.786982 |
e7856514e9ccbee90dac8c93fb37535af79b6d56 | 3,681 | h | C | hadoop-1.1.2/utils/impl/config.h | GeekerClub/thirdparty | aa3057801b89accee71e0dd697fbec2c216c6b32 | [
"MIT"
] | null | null | null | hadoop-1.1.2/utils/impl/config.h | GeekerClub/thirdparty | aa3057801b89accee71e0dd697fbec2c216c6b32 | [
"MIT"
] | null | null | null | hadoop-1.1.2/utils/impl/config.h | GeekerClub/thirdparty | aa3057801b89accee71e0dd697fbec2c216c6b32 | [
"MIT"
] | null | null | null | /* impl/config.h. Generated from config.h.in by configure. */
/* impl/config.h.in. Generated from configure.ac by autoheader. */
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#define HAVE_DECL_STRERROR_R 1
/* Define to 1 if you have the <dlfcn.h> header file. */
#define HAVE_DLFCN_H 1
/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
/* Define to 1 if you have the `mkdir' function. */
#define HAVE_MKDIR 1
/* Define to 1 if stdbool.h conforms to C99. */
#define HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
/* Define to 1 if you have the `strerror_r' function. */
#define HAVE_STRERROR_R 1
/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#define HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `uname' function. */
#define HAVE_UNAME 1
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
/* Define to 1 if the system has the type `_Bool'. */
/* #undef HAVE__BOOL */
/* Name of package */
#define PACKAGE "hadoop-utils"
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "omalley@apache.org"
/* Define to the full name of this package. */
#define PACKAGE_NAME "hadoop-utils"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "hadoop-utils 0.13.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "hadoop-utils"
/* Define to the home page for this package. */
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.13.0"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define to 1 if strerror_r returns char *. */
#define STRERROR_R_CHAR_P 1
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# define _ALL_SOURCE 1
#endif
/* Enable GNU extensions on systems that have them. */
#ifndef _GNU_SOURCE
# define _GNU_SOURCE 1
#endif
/* Enable threading extensions on Solaris. */
#ifndef _POSIX_PTHREAD_SEMANTICS
# define _POSIX_PTHREAD_SEMANTICS 1
#endif
/* Enable extensions on HP NonStop. */
#ifndef _TANDEM_SOURCE
# define _TANDEM_SOURCE 1
#endif
/* Enable general extensions on Solaris. */
#ifndef __EXTENSIONS__
# define __EXTENSIONS__ 1
#endif
/* Version number of package */
#define VERSION "0.13.0"
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1
#endif
/* Number of bits in a file offset, on hosts where this is settable. */
/* #undef _FILE_OFFSET_BITS */
/* Define for large files, on AIX-style hosts. */
/* #undef _LARGE_FILES */
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
/* #undef _POSIX_1_SOURCE */
/* Define to 1 if you need to in order for `stat' and other things to work. */
/* #undef _POSIX_SOURCE */
/* Define to empty if `const' does not conform to ANSI C. */
/* #undef const */
/* Define to `long int' if <sys/types.h> does not define. */
/* #undef off_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
| 27.470149 | 78 | 0.708775 |
2c0db01fc21f98381dfa0ddbae24fce647f82675 | 2,924 | h | C | TVM/webpageCode.h | Chumsy0725/Vending-Machine-Monitoring-System | 88be793f50fb3220588ff96c934e6d29eb3d49e1 | [
"MIT"
] | 1 | 2021-12-30T04:05:38.000Z | 2021-12-30T04:05:38.000Z | TVM/webpageCode.h | Chumsy0725/Vending-Machine-Monitoring-System | 88be793f50fb3220588ff96c934e6d29eb3d49e1 | [
"MIT"
] | null | null | null | TVM/webpageCode.h | Chumsy0725/Vending-Machine-Monitoring-System | 88be793f50fb3220588ff96c934e6d29eb3d49e1 | [
"MIT"
] | null | null | null | const char webpageCode[] =
R"=====(
<!DOCTYPE html>
<html>
<!------------------------------C S S--------------------------------->
<head>
<style>
#btn
{ background-color: #000000;
border: none;
border-radius: 120px;
color: #ffffff;
padding: 16px 40px;
text-decoration: none;
font-size: 30px;
margin: 2px;
cursor: pointer;}
body {font-family: "Calibri"; background-color: grey}
h1{color: whitesmoke; text-align:center; font-size: 50px;}
h2{color: whitesmoke; text-align:center; font-size: 50px;}
</style>
<style>
#btn1
{
background-color: #af0c0c;
border: none;
border-radius: 120px;
color: #ffffff;
padding: 16px 40px;
text-decoration: none;
font-size: 30px;
margin: 2px;
cursor: pointer;}
</style>
<style>
#btn2
{
background-color: #2306c7;
border: none;
border-radius: 120px;
color: #c50e0e;
padding: 16px 40px;
text-decoration: none;
font-size: 30px;
margin: 2px;
cursor: pointer;}
</style>
<style>
#btn3
{
background-color: #098119;
border: none;
border-radius: 120px;
color: #ffffff;
padding: 16px 40px;
text-decoration: none;
font-size: 30px;
margin: 2px;
cursor: pointer;}
</style>
</head>
<!----------------------------H T M L--------------------------------->
<body>
<h1>
<br> Touchless Vending Machine <br><br>
<a href="1" id="btn1" ONCLICK='JS1()'>Coke</a> <br><br>
<a href="2" id="btn2" ONCLICK='JS2()'>Pepsi</a> <br><br>
<a href="3" id="btn3" ONCLICK='JS3()'>Sprite</a>
</h1>
<hr size="6" width="60%" color=#098119;>
<h2>
Vendor <br><br>
<a href="0" id="btn" ONCLICK='JS0()'>Refill</a> <br><br>
</h2>
<!---------------------------JavaScript------------------------------->
<script>
//function displays text message
let m0 = 'Place your ID'
let m1 = 'You Selected Coke, Pay Here'
let m2 = 'You Selected Pepsi, Pay Here'
let m3 = 'You Selected Sprite, Pay Here'
function JS0()
{
alert(m0);
}
function JS1()
{
alert(m1);
}
//function prompts for name, then displays message
function JS2()
{
alert(m2);
}
//function computes factorial of integer number
function JS3()
{ alert(m3);
}
</script>
</body>
</html>
)=====";
| 26.581818 | 72 | 0.426813 |
2c0dcd7acf3fd9be0abfff51ce76acc2c1c4a93a | 29,947 | c | C | openeuler-kernel/drivers/net/ethernet/microchip/encx24j600.c | Ddnirvana/test-CI | dd7a0a71281075e8ab300bddbab4a9fa039958f0 | [
"MulanPSL-1.0"
] | 31 | 2021-04-27T08:50:40.000Z | 2022-03-01T02:26:21.000Z | openeuler-kernel/drivers/net/ethernet/microchip/encx24j600.c | Ddnirvana/test-CI | dd7a0a71281075e8ab300bddbab4a9fa039958f0 | [
"MulanPSL-1.0"
] | 13 | 2021-07-10T04:36:17.000Z | 2022-03-03T10:50:05.000Z | openeuler-kernel/drivers/net/ethernet/microchip/encx24j600.c | Ddnirvana/test-CI | dd7a0a71281075e8ab300bddbab4a9fa039958f0 | [
"MulanPSL-1.0"
] | 12 | 2021-04-06T02:23:10.000Z | 2022-02-28T11:43:19.000Z | // SPDX-License-Identifier: GPL-2.0-or-later
/**
* Microchip ENCX24J600 ethernet driver
*
* Copyright (C) 2015 Gridpoint
* Author: Jon Ringle <jringle@gridpoint.com>
*/
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/regmap.h>
#include <linux/skbuff.h>
#include <linux/spi/spi.h>
#include "encx24j600_hw.h"
#define DRV_NAME "encx24j600"
#define DRV_VERSION "1.0"
#define DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)
static int debug = -1;
module_param(debug, int, 0000);
MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
/* SRAM memory layout:
*
* 0x0000-0x05ff TX buffers 1.5KB (1*1536) reside in the GP area in SRAM
* 0x0600-0x5fff RX buffers 22.5KB (15*1536) reside in the RX area in SRAM
*/
#define ENC_TX_BUF_START 0x0000U
#define ENC_RX_BUF_START 0x0600U
#define ENC_RX_BUF_END 0x5fffU
#define ENC_SRAM_SIZE 0x6000U
enum {
RXFILTER_NORMAL,
RXFILTER_MULTI,
RXFILTER_PROMISC
};
struct encx24j600_priv {
struct net_device *ndev;
struct mutex lock; /* device access lock */
struct encx24j600_context ctx;
struct sk_buff *tx_skb;
struct task_struct *kworker_task;
struct kthread_worker kworker;
struct kthread_work tx_work;
struct kthread_work setrx_work;
u16 next_packet;
bool hw_enabled;
bool full_duplex;
bool autoneg;
u16 speed;
int rxfilter;
u32 msg_enable;
};
static void dump_packet(const char *msg, int len, const char *data)
{
pr_debug(DRV_NAME ": %s - packet len:%d\n", msg, len);
print_hex_dump_bytes("pk data: ", DUMP_PREFIX_OFFSET, data, len);
}
static void encx24j600_dump_rsv(struct encx24j600_priv *priv, const char *msg,
struct rsv *rsv)
{
struct net_device *dev = priv->ndev;
netdev_info(dev, "RX packet Len:%d\n", rsv->len);
netdev_dbg(dev, "%s - NextPk: 0x%04x\n", msg,
rsv->next_packet);
netdev_dbg(dev, "RxOK: %d, DribbleNibble: %d\n",
RSV_GETBIT(rsv->rxstat, RSV_RXOK),
RSV_GETBIT(rsv->rxstat, RSV_DRIBBLENIBBLE));
netdev_dbg(dev, "CRCErr:%d, LenChkErr: %d, LenOutOfRange: %d\n",
RSV_GETBIT(rsv->rxstat, RSV_CRCERROR),
RSV_GETBIT(rsv->rxstat, RSV_LENCHECKERR),
RSV_GETBIT(rsv->rxstat, RSV_LENOUTOFRANGE));
netdev_dbg(dev, "Multicast: %d, Broadcast: %d, LongDropEvent: %d, CarrierEvent: %d\n",
RSV_GETBIT(rsv->rxstat, RSV_RXMULTICAST),
RSV_GETBIT(rsv->rxstat, RSV_RXBROADCAST),
RSV_GETBIT(rsv->rxstat, RSV_RXLONGEVDROPEV),
RSV_GETBIT(rsv->rxstat, RSV_CARRIEREV));
netdev_dbg(dev, "ControlFrame: %d, PauseFrame: %d, UnknownOp: %d, VLanTagFrame: %d\n",
RSV_GETBIT(rsv->rxstat, RSV_RXCONTROLFRAME),
RSV_GETBIT(rsv->rxstat, RSV_RXPAUSEFRAME),
RSV_GETBIT(rsv->rxstat, RSV_RXUNKNOWNOPCODE),
RSV_GETBIT(rsv->rxstat, RSV_RXTYPEVLAN));
}
static u16 encx24j600_read_reg(struct encx24j600_priv *priv, u8 reg)
{
struct net_device *dev = priv->ndev;
unsigned int val = 0;
int ret = regmap_read(priv->ctx.regmap, reg, &val);
if (unlikely(ret))
netif_err(priv, drv, dev, "%s: error %d reading reg %02x\n",
__func__, ret, reg);
return val;
}
static void encx24j600_write_reg(struct encx24j600_priv *priv, u8 reg, u16 val)
{
struct net_device *dev = priv->ndev;
int ret = regmap_write(priv->ctx.regmap, reg, val);
if (unlikely(ret))
netif_err(priv, drv, dev, "%s: error %d writing reg %02x=%04x\n",
__func__, ret, reg, val);
}
static void encx24j600_update_reg(struct encx24j600_priv *priv, u8 reg,
u16 mask, u16 val)
{
struct net_device *dev = priv->ndev;
int ret = regmap_update_bits(priv->ctx.regmap, reg, mask, val);
if (unlikely(ret))
netif_err(priv, drv, dev, "%s: error %d updating reg %02x=%04x~%04x\n",
__func__, ret, reg, val, mask);
}
static u16 encx24j600_read_phy(struct encx24j600_priv *priv, u8 reg)
{
struct net_device *dev = priv->ndev;
unsigned int val = 0;
int ret = regmap_read(priv->ctx.phymap, reg, &val);
if (unlikely(ret))
netif_err(priv, drv, dev, "%s: error %d reading %02x\n",
__func__, ret, reg);
return val;
}
static void encx24j600_write_phy(struct encx24j600_priv *priv, u8 reg, u16 val)
{
struct net_device *dev = priv->ndev;
int ret = regmap_write(priv->ctx.phymap, reg, val);
if (unlikely(ret))
netif_err(priv, drv, dev, "%s: error %d writing reg %02x=%04x\n",
__func__, ret, reg, val);
}
static void encx24j600_clr_bits(struct encx24j600_priv *priv, u8 reg, u16 mask)
{
encx24j600_update_reg(priv, reg, mask, 0);
}
static void encx24j600_set_bits(struct encx24j600_priv *priv, u8 reg, u16 mask)
{
encx24j600_update_reg(priv, reg, mask, mask);
}
static void encx24j600_cmd(struct encx24j600_priv *priv, u8 cmd)
{
struct net_device *dev = priv->ndev;
int ret = regmap_write(priv->ctx.regmap, cmd, 0);
if (unlikely(ret))
netif_err(priv, drv, dev, "%s: error %d with cmd %02x\n",
__func__, ret, cmd);
}
static int encx24j600_raw_read(struct encx24j600_priv *priv, u8 reg, u8 *data,
size_t count)
{
int ret;
mutex_lock(&priv->ctx.mutex);
ret = regmap_encx24j600_spi_read(&priv->ctx, reg, data, count);
mutex_unlock(&priv->ctx.mutex);
return ret;
}
static int encx24j600_raw_write(struct encx24j600_priv *priv, u8 reg,
const u8 *data, size_t count)
{
int ret;
mutex_lock(&priv->ctx.mutex);
ret = regmap_encx24j600_spi_write(&priv->ctx, reg, data, count);
mutex_unlock(&priv->ctx.mutex);
return ret;
}
static void encx24j600_update_phcon1(struct encx24j600_priv *priv)
{
u16 phcon1 = encx24j600_read_phy(priv, PHCON1);
if (priv->autoneg == AUTONEG_ENABLE) {
phcon1 |= ANEN | RENEG;
} else {
phcon1 &= ~ANEN;
if (priv->speed == SPEED_100)
phcon1 |= SPD100;
else
phcon1 &= ~SPD100;
if (priv->full_duplex)
phcon1 |= PFULDPX;
else
phcon1 &= ~PFULDPX;
}
encx24j600_write_phy(priv, PHCON1, phcon1);
}
/* Waits for autonegotiation to complete. */
static int encx24j600_wait_for_autoneg(struct encx24j600_priv *priv)
{
struct net_device *dev = priv->ndev;
unsigned long timeout = jiffies + msecs_to_jiffies(2000);
u16 phstat1;
u16 estat;
int ret = 0;
phstat1 = encx24j600_read_phy(priv, PHSTAT1);
while ((phstat1 & ANDONE) == 0) {
if (time_after(jiffies, timeout)) {
u16 phstat3;
netif_notice(priv, drv, dev, "timeout waiting for autoneg done\n");
priv->autoneg = AUTONEG_DISABLE;
phstat3 = encx24j600_read_phy(priv, PHSTAT3);
priv->speed = (phstat3 & PHY3SPD100)
? SPEED_100 : SPEED_10;
priv->full_duplex = (phstat3 & PHY3DPX) ? 1 : 0;
encx24j600_update_phcon1(priv);
netif_notice(priv, drv, dev, "Using parallel detection: %s/%s",
priv->speed == SPEED_100 ? "100" : "10",
priv->full_duplex ? "Full" : "Half");
return -ETIMEDOUT;
}
cpu_relax();
phstat1 = encx24j600_read_phy(priv, PHSTAT1);
}
estat = encx24j600_read_reg(priv, ESTAT);
if (estat & PHYDPX) {
encx24j600_set_bits(priv, MACON2, FULDPX);
encx24j600_write_reg(priv, MABBIPG, 0x15);
} else {
encx24j600_clr_bits(priv, MACON2, FULDPX);
encx24j600_write_reg(priv, MABBIPG, 0x12);
/* Max retransmittions attempt */
encx24j600_write_reg(priv, MACLCON, 0x370f);
}
return ret;
}
/* Access the PHY to determine link status */
static void encx24j600_check_link_status(struct encx24j600_priv *priv)
{
struct net_device *dev = priv->ndev;
u16 estat;
estat = encx24j600_read_reg(priv, ESTAT);
if (estat & PHYLNK) {
if (priv->autoneg == AUTONEG_ENABLE)
encx24j600_wait_for_autoneg(priv);
netif_carrier_on(dev);
netif_info(priv, ifup, dev, "link up\n");
} else {
netif_info(priv, ifdown, dev, "link down\n");
/* Re-enable autoneg since we won't know what we might be
* connected to when the link is brought back up again.
*/
priv->autoneg = AUTONEG_ENABLE;
priv->full_duplex = true;
priv->speed = SPEED_100;
netif_carrier_off(dev);
}
}
static void encx24j600_int_link_handler(struct encx24j600_priv *priv)
{
struct net_device *dev = priv->ndev;
netif_dbg(priv, intr, dev, "%s", __func__);
encx24j600_check_link_status(priv);
encx24j600_clr_bits(priv, EIR, LINKIF);
}
static void encx24j600_tx_complete(struct encx24j600_priv *priv, bool err)
{
struct net_device *dev = priv->ndev;
if (!priv->tx_skb) {
BUG();
return;
}
mutex_lock(&priv->lock);
if (err)
dev->stats.tx_errors++;
else
dev->stats.tx_packets++;
dev->stats.tx_bytes += priv->tx_skb->len;
encx24j600_clr_bits(priv, EIR, TXIF | TXABTIF);
netif_dbg(priv, tx_done, dev, "TX Done%s\n", err ? ": Err" : "");
dev_kfree_skb(priv->tx_skb);
priv->tx_skb = NULL;
netif_wake_queue(dev);
mutex_unlock(&priv->lock);
}
static int encx24j600_receive_packet(struct encx24j600_priv *priv,
struct rsv *rsv)
{
struct net_device *dev = priv->ndev;
struct sk_buff *skb = netdev_alloc_skb(dev, rsv->len + NET_IP_ALIGN);
if (!skb) {
pr_err_ratelimited("RX: OOM: packet dropped\n");
dev->stats.rx_dropped++;
return -ENOMEM;
}
skb_reserve(skb, NET_IP_ALIGN);
encx24j600_raw_read(priv, RRXDATA, skb_put(skb, rsv->len), rsv->len);
if (netif_msg_pktdata(priv))
dump_packet("RX", skb->len, skb->data);
skb->dev = dev;
skb->protocol = eth_type_trans(skb, dev);
skb->ip_summed = CHECKSUM_COMPLETE;
/* Maintain stats */
dev->stats.rx_packets++;
dev->stats.rx_bytes += rsv->len;
netif_rx(skb);
return 0;
}
static void encx24j600_rx_packets(struct encx24j600_priv *priv, u8 packet_count)
{
struct net_device *dev = priv->ndev;
while (packet_count--) {
struct rsv rsv;
u16 newrxtail;
encx24j600_write_reg(priv, ERXRDPT, priv->next_packet);
encx24j600_raw_read(priv, RRXDATA, (u8 *)&rsv, sizeof(rsv));
if (netif_msg_rx_status(priv))
encx24j600_dump_rsv(priv, __func__, &rsv);
if (!RSV_GETBIT(rsv.rxstat, RSV_RXOK) ||
(rsv.len > MAX_FRAMELEN)) {
netif_err(priv, rx_err, dev, "RX Error %04x\n",
rsv.rxstat);
dev->stats.rx_errors++;
if (RSV_GETBIT(rsv.rxstat, RSV_CRCERROR))
dev->stats.rx_crc_errors++;
if (RSV_GETBIT(rsv.rxstat, RSV_LENCHECKERR))
dev->stats.rx_frame_errors++;
if (rsv.len > MAX_FRAMELEN)
dev->stats.rx_over_errors++;
} else {
encx24j600_receive_packet(priv, &rsv);
}
priv->next_packet = rsv.next_packet;
newrxtail = priv->next_packet - 2;
if (newrxtail == ENC_RX_BUF_START)
newrxtail = SRAM_SIZE - 2;
encx24j600_cmd(priv, SETPKTDEC);
encx24j600_write_reg(priv, ERXTAIL, newrxtail);
}
}
static irqreturn_t encx24j600_isr(int irq, void *dev_id)
{
struct encx24j600_priv *priv = dev_id;
struct net_device *dev = priv->ndev;
int eir;
/* Clear interrupts */
encx24j600_cmd(priv, CLREIE);
eir = encx24j600_read_reg(priv, EIR);
if (eir & LINKIF)
encx24j600_int_link_handler(priv);
if (eir & TXIF)
encx24j600_tx_complete(priv, false);
if (eir & TXABTIF)
encx24j600_tx_complete(priv, true);
if (eir & RXABTIF) {
if (eir & PCFULIF) {
/* Packet counter is full */
netif_err(priv, rx_err, dev, "Packet counter full\n");
}
dev->stats.rx_dropped++;
encx24j600_clr_bits(priv, EIR, RXABTIF);
}
if (eir & PKTIF) {
u8 packet_count;
mutex_lock(&priv->lock);
packet_count = encx24j600_read_reg(priv, ESTAT) & 0xff;
while (packet_count) {
encx24j600_rx_packets(priv, packet_count);
packet_count = encx24j600_read_reg(priv, ESTAT) & 0xff;
}
mutex_unlock(&priv->lock);
}
/* Enable interrupts */
encx24j600_cmd(priv, SETEIE);
return IRQ_HANDLED;
}
static int encx24j600_soft_reset(struct encx24j600_priv *priv)
{
int ret = 0;
int timeout;
u16 eudast;
/* Write and verify a test value to EUDAST */
regcache_cache_bypass(priv->ctx.regmap, true);
timeout = 10;
do {
encx24j600_write_reg(priv, EUDAST, EUDAST_TEST_VAL);
eudast = encx24j600_read_reg(priv, EUDAST);
usleep_range(25, 100);
} while ((eudast != EUDAST_TEST_VAL) && --timeout);
regcache_cache_bypass(priv->ctx.regmap, false);
if (timeout == 0) {
ret = -ETIMEDOUT;
goto err_out;
}
/* Wait for CLKRDY to become set */
timeout = 10;
while (!(encx24j600_read_reg(priv, ESTAT) & CLKRDY) && --timeout)
usleep_range(25, 100);
if (timeout == 0) {
ret = -ETIMEDOUT;
goto err_out;
}
/* Issue a System Reset command */
encx24j600_cmd(priv, SETETHRST);
usleep_range(25, 100);
/* Confirm that EUDAST has 0000h after system reset */
if (encx24j600_read_reg(priv, EUDAST) != 0) {
ret = -EINVAL;
goto err_out;
}
/* Wait for PHY register and status bits to become available */
usleep_range(256, 1000);
err_out:
return ret;
}
static int encx24j600_hw_reset(struct encx24j600_priv *priv)
{
int ret;
mutex_lock(&priv->lock);
ret = encx24j600_soft_reset(priv);
mutex_unlock(&priv->lock);
return ret;
}
static void encx24j600_reset_hw_tx(struct encx24j600_priv *priv)
{
encx24j600_set_bits(priv, ECON2, TXRST);
encx24j600_clr_bits(priv, ECON2, TXRST);
}
static void encx24j600_hw_init_tx(struct encx24j600_priv *priv)
{
/* Reset TX */
encx24j600_reset_hw_tx(priv);
/* Clear the TXIF flag if were previously set */
encx24j600_clr_bits(priv, EIR, TXIF | TXABTIF);
/* Write the Tx Buffer pointer */
encx24j600_write_reg(priv, EGPWRPT, ENC_TX_BUF_START);
}
static void encx24j600_hw_init_rx(struct encx24j600_priv *priv)
{
encx24j600_cmd(priv, DISABLERX);
/* Set up RX packet start address in the SRAM */
encx24j600_write_reg(priv, ERXST, ENC_RX_BUF_START);
/* Preload the RX Data pointer to the beginning of the RX area */
encx24j600_write_reg(priv, ERXRDPT, ENC_RX_BUF_START);
priv->next_packet = ENC_RX_BUF_START;
/* Set up RX end address in the SRAM */
encx24j600_write_reg(priv, ERXTAIL, ENC_SRAM_SIZE - 2);
/* Reset the user data pointers */
encx24j600_write_reg(priv, EUDAST, ENC_SRAM_SIZE);
encx24j600_write_reg(priv, EUDAND, ENC_SRAM_SIZE + 1);
/* Set Max Frame length */
encx24j600_write_reg(priv, MAMXFL, MAX_FRAMELEN);
}
static void encx24j600_dump_config(struct encx24j600_priv *priv,
const char *msg)
{
pr_info(DRV_NAME ": %s\n", msg);
/* CHIP configuration */
pr_info(DRV_NAME " ECON1: %04X\n", encx24j600_read_reg(priv, ECON1));
pr_info(DRV_NAME " ECON2: %04X\n", encx24j600_read_reg(priv, ECON2));
pr_info(DRV_NAME " ERXFCON: %04X\n", encx24j600_read_reg(priv,
ERXFCON));
pr_info(DRV_NAME " ESTAT: %04X\n", encx24j600_read_reg(priv, ESTAT));
pr_info(DRV_NAME " EIR: %04X\n", encx24j600_read_reg(priv, EIR));
pr_info(DRV_NAME " EIDLED: %04X\n", encx24j600_read_reg(priv, EIDLED));
/* MAC layer configuration */
pr_info(DRV_NAME " MACON1: %04X\n", encx24j600_read_reg(priv, MACON1));
pr_info(DRV_NAME " MACON2: %04X\n", encx24j600_read_reg(priv, MACON2));
pr_info(DRV_NAME " MAIPG: %04X\n", encx24j600_read_reg(priv, MAIPG));
pr_info(DRV_NAME " MACLCON: %04X\n", encx24j600_read_reg(priv,
MACLCON));
pr_info(DRV_NAME " MABBIPG: %04X\n", encx24j600_read_reg(priv,
MABBIPG));
/* PHY configuation */
pr_info(DRV_NAME " PHCON1: %04X\n", encx24j600_read_phy(priv, PHCON1));
pr_info(DRV_NAME " PHCON2: %04X\n", encx24j600_read_phy(priv, PHCON2));
pr_info(DRV_NAME " PHANA: %04X\n", encx24j600_read_phy(priv, PHANA));
pr_info(DRV_NAME " PHANLPA: %04X\n", encx24j600_read_phy(priv,
PHANLPA));
pr_info(DRV_NAME " PHANE: %04X\n", encx24j600_read_phy(priv, PHANE));
pr_info(DRV_NAME " PHSTAT1: %04X\n", encx24j600_read_phy(priv,
PHSTAT1));
pr_info(DRV_NAME " PHSTAT2: %04X\n", encx24j600_read_phy(priv,
PHSTAT2));
pr_info(DRV_NAME " PHSTAT3: %04X\n", encx24j600_read_phy(priv,
PHSTAT3));
}
static void encx24j600_set_rxfilter_mode(struct encx24j600_priv *priv)
{
switch (priv->rxfilter) {
case RXFILTER_PROMISC:
encx24j600_set_bits(priv, MACON1, PASSALL);
encx24j600_write_reg(priv, ERXFCON, UCEN | MCEN | NOTMEEN);
break;
case RXFILTER_MULTI:
encx24j600_clr_bits(priv, MACON1, PASSALL);
encx24j600_write_reg(priv, ERXFCON, UCEN | CRCEN | BCEN | MCEN);
break;
case RXFILTER_NORMAL:
default:
encx24j600_clr_bits(priv, MACON1, PASSALL);
encx24j600_write_reg(priv, ERXFCON, UCEN | CRCEN | BCEN);
break;
}
}
static void encx24j600_hw_init(struct encx24j600_priv *priv)
{
u16 macon2;
priv->hw_enabled = false;
/* PHY Leds: link status,
* LEDA: Link State + collision events
* LEDB: Link State + transmit/receive events
*/
encx24j600_update_reg(priv, EIDLED, 0xff00, 0xcb00);
/* Loopback disabled */
encx24j600_write_reg(priv, MACON1, 0x9);
/* interpacket gap value */
encx24j600_write_reg(priv, MAIPG, 0x0c12);
/* Write the auto negotiation pattern */
encx24j600_write_phy(priv, PHANA, PHANA_DEFAULT);
encx24j600_update_phcon1(priv);
encx24j600_check_link_status(priv);
macon2 = MACON2_RSV1 | TXCRCEN | PADCFG0 | PADCFG2 | MACON2_DEFER;
if ((priv->autoneg == AUTONEG_DISABLE) && priv->full_duplex)
macon2 |= FULDPX;
encx24j600_set_bits(priv, MACON2, macon2);
priv->rxfilter = RXFILTER_NORMAL;
encx24j600_set_rxfilter_mode(priv);
/* Program the Maximum frame length */
encx24j600_write_reg(priv, MAMXFL, MAX_FRAMELEN);
/* Init Tx pointers */
encx24j600_hw_init_tx(priv);
/* Init Rx pointers */
encx24j600_hw_init_rx(priv);
if (netif_msg_hw(priv))
encx24j600_dump_config(priv, "Hw is initialized");
}
static void encx24j600_hw_enable(struct encx24j600_priv *priv)
{
/* Clear the interrupt flags in case was set */
encx24j600_clr_bits(priv, EIR, (PCFULIF | RXABTIF | TXABTIF | TXIF |
PKTIF | LINKIF));
/* Enable the interrupts */
encx24j600_write_reg(priv, EIE, (PCFULIE | RXABTIE | TXABTIE | TXIE |
PKTIE | LINKIE | INTIE));
/* Enable RX */
encx24j600_cmd(priv, ENABLERX);
priv->hw_enabled = true;
}
static void encx24j600_hw_disable(struct encx24j600_priv *priv)
{
/* Disable all interrupts */
encx24j600_write_reg(priv, EIE, 0);
/* Disable RX */
encx24j600_cmd(priv, DISABLERX);
priv->hw_enabled = false;
}
static int encx24j600_setlink(struct net_device *dev, u8 autoneg, u16 speed,
u8 duplex)
{
struct encx24j600_priv *priv = netdev_priv(dev);
int ret = 0;
if (!priv->hw_enabled) {
/* link is in low power mode now; duplex setting
* will take effect on next encx24j600_hw_init()
*/
if (speed == SPEED_10 || speed == SPEED_100) {
priv->autoneg = (autoneg == AUTONEG_ENABLE);
priv->full_duplex = (duplex == DUPLEX_FULL);
priv->speed = (speed == SPEED_100);
} else {
netif_warn(priv, link, dev, "unsupported link speed setting\n");
/*speeds other than SPEED_10 and SPEED_100 */
/*are not supported by chip */
ret = -EOPNOTSUPP;
}
} else {
netif_warn(priv, link, dev, "Warning: hw must be disabled to set link mode\n");
ret = -EBUSY;
}
return ret;
}
static void encx24j600_hw_get_macaddr(struct encx24j600_priv *priv,
unsigned char *ethaddr)
{
unsigned short val;
val = encx24j600_read_reg(priv, MAADR1);
ethaddr[0] = val & 0x00ff;
ethaddr[1] = (val & 0xff00) >> 8;
val = encx24j600_read_reg(priv, MAADR2);
ethaddr[2] = val & 0x00ffU;
ethaddr[3] = (val & 0xff00U) >> 8;
val = encx24j600_read_reg(priv, MAADR3);
ethaddr[4] = val & 0x00ffU;
ethaddr[5] = (val & 0xff00U) >> 8;
}
/* Program the hardware MAC address from dev->dev_addr.*/
static int encx24j600_set_hw_macaddr(struct net_device *dev)
{
struct encx24j600_priv *priv = netdev_priv(dev);
if (priv->hw_enabled) {
netif_info(priv, drv, dev, "Hardware must be disabled to set Mac address\n");
return -EBUSY;
}
mutex_lock(&priv->lock);
netif_info(priv, drv, dev, "%s: Setting MAC address to %pM\n",
dev->name, dev->dev_addr);
encx24j600_write_reg(priv, MAADR3, (dev->dev_addr[4] |
dev->dev_addr[5] << 8));
encx24j600_write_reg(priv, MAADR2, (dev->dev_addr[2] |
dev->dev_addr[3] << 8));
encx24j600_write_reg(priv, MAADR1, (dev->dev_addr[0] |
dev->dev_addr[1] << 8));
mutex_unlock(&priv->lock);
return 0;
}
/* Store the new hardware address in dev->dev_addr, and update the MAC.*/
static int encx24j600_set_mac_address(struct net_device *dev, void *addr)
{
struct sockaddr *address = addr;
if (netif_running(dev))
return -EBUSY;
if (!is_valid_ether_addr(address->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, address->sa_data, dev->addr_len);
return encx24j600_set_hw_macaddr(dev);
}
static int encx24j600_open(struct net_device *dev)
{
struct encx24j600_priv *priv = netdev_priv(dev);
int ret = request_threaded_irq(priv->ctx.spi->irq, NULL, encx24j600_isr,
IRQF_TRIGGER_FALLING | IRQF_ONESHOT,
DRV_NAME, priv);
if (unlikely(ret < 0)) {
netdev_err(dev, "request irq %d failed (ret = %d)\n",
priv->ctx.spi->irq, ret);
return ret;
}
encx24j600_hw_disable(priv);
encx24j600_hw_init(priv);
encx24j600_hw_enable(priv);
netif_start_queue(dev);
return 0;
}
static int encx24j600_stop(struct net_device *dev)
{
struct encx24j600_priv *priv = netdev_priv(dev);
netif_stop_queue(dev);
free_irq(priv->ctx.spi->irq, priv);
return 0;
}
static void encx24j600_setrx_proc(struct kthread_work *ws)
{
struct encx24j600_priv *priv =
container_of(ws, struct encx24j600_priv, setrx_work);
mutex_lock(&priv->lock);
encx24j600_set_rxfilter_mode(priv);
mutex_unlock(&priv->lock);
}
static void encx24j600_set_multicast_list(struct net_device *dev)
{
struct encx24j600_priv *priv = netdev_priv(dev);
int oldfilter = priv->rxfilter;
if (dev->flags & IFF_PROMISC) {
netif_dbg(priv, link, dev, "promiscuous mode\n");
priv->rxfilter = RXFILTER_PROMISC;
} else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev)) {
netif_dbg(priv, link, dev, "%smulticast mode\n",
(dev->flags & IFF_ALLMULTI) ? "all-" : "");
priv->rxfilter = RXFILTER_MULTI;
} else {
netif_dbg(priv, link, dev, "normal mode\n");
priv->rxfilter = RXFILTER_NORMAL;
}
if (oldfilter != priv->rxfilter)
kthread_queue_work(&priv->kworker, &priv->setrx_work);
}
static void encx24j600_hw_tx(struct encx24j600_priv *priv)
{
struct net_device *dev = priv->ndev;
netif_info(priv, tx_queued, dev, "TX Packet Len:%d\n",
priv->tx_skb->len);
if (netif_msg_pktdata(priv))
dump_packet("TX", priv->tx_skb->len, priv->tx_skb->data);
if (encx24j600_read_reg(priv, EIR) & TXABTIF)
/* Last transmition aborted due to error. Reset TX interface */
encx24j600_reset_hw_tx(priv);
/* Clear the TXIF flag if were previously set */
encx24j600_clr_bits(priv, EIR, TXIF);
/* Set the data pointer to the TX buffer address in the SRAM */
encx24j600_write_reg(priv, EGPWRPT, ENC_TX_BUF_START);
/* Copy the packet into the SRAM */
encx24j600_raw_write(priv, WGPDATA, (u8 *)priv->tx_skb->data,
priv->tx_skb->len);
/* Program the Tx buffer start pointer */
encx24j600_write_reg(priv, ETXST, ENC_TX_BUF_START);
/* Program the packet length */
encx24j600_write_reg(priv, ETXLEN, priv->tx_skb->len);
/* Start the transmission */
encx24j600_cmd(priv, SETTXRTS);
}
static void encx24j600_tx_proc(struct kthread_work *ws)
{
struct encx24j600_priv *priv =
container_of(ws, struct encx24j600_priv, tx_work);
mutex_lock(&priv->lock);
encx24j600_hw_tx(priv);
mutex_unlock(&priv->lock);
}
static netdev_tx_t encx24j600_tx(struct sk_buff *skb, struct net_device *dev)
{
struct encx24j600_priv *priv = netdev_priv(dev);
netif_stop_queue(dev);
/* save the timestamp */
netif_trans_update(dev);
/* Remember the skb for deferred processing */
priv->tx_skb = skb;
kthread_queue_work(&priv->kworker, &priv->tx_work);
return NETDEV_TX_OK;
}
/* Deal with a transmit timeout */
static void encx24j600_tx_timeout(struct net_device *dev, unsigned int txqueue)
{
struct encx24j600_priv *priv = netdev_priv(dev);
netif_err(priv, tx_err, dev, "TX timeout at %ld, latency %ld\n",
jiffies, jiffies - dev_trans_start(dev));
dev->stats.tx_errors++;
netif_wake_queue(dev);
}
static int encx24j600_get_regs_len(struct net_device *dev)
{
return SFR_REG_COUNT;
}
static void encx24j600_get_regs(struct net_device *dev,
struct ethtool_regs *regs, void *p)
{
struct encx24j600_priv *priv = netdev_priv(dev);
u16 *buff = p;
u8 reg;
regs->version = 1;
mutex_lock(&priv->lock);
for (reg = 0; reg < SFR_REG_COUNT; reg += 2) {
unsigned int val = 0;
/* ignore errors for unreadable registers */
regmap_read(priv->ctx.regmap, reg, &val);
buff[reg] = val & 0xffff;
}
mutex_unlock(&priv->lock);
}
static void encx24j600_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
strlcpy(info->version, DRV_VERSION, sizeof(info->version));
strlcpy(info->bus_info, dev_name(dev->dev.parent),
sizeof(info->bus_info));
}
static int encx24j600_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct encx24j600_priv *priv = netdev_priv(dev);
u32 supported;
supported = SUPPORTED_10baseT_Half | SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half | SUPPORTED_100baseT_Full |
SUPPORTED_Autoneg | SUPPORTED_TP;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
cmd->base.speed = priv->speed;
cmd->base.duplex = priv->full_duplex ? DUPLEX_FULL : DUPLEX_HALF;
cmd->base.port = PORT_TP;
cmd->base.autoneg = priv->autoneg ? AUTONEG_ENABLE : AUTONEG_DISABLE;
return 0;
}
static int
encx24j600_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{
return encx24j600_setlink(dev, cmd->base.autoneg,
cmd->base.speed, cmd->base.duplex);
}
static u32 encx24j600_get_msglevel(struct net_device *dev)
{
struct encx24j600_priv *priv = netdev_priv(dev);
return priv->msg_enable;
}
static void encx24j600_set_msglevel(struct net_device *dev, u32 val)
{
struct encx24j600_priv *priv = netdev_priv(dev);
priv->msg_enable = val;
}
static const struct ethtool_ops encx24j600_ethtool_ops = {
.get_drvinfo = encx24j600_get_drvinfo,
.get_msglevel = encx24j600_get_msglevel,
.set_msglevel = encx24j600_set_msglevel,
.get_regs_len = encx24j600_get_regs_len,
.get_regs = encx24j600_get_regs,
.get_link_ksettings = encx24j600_get_link_ksettings,
.set_link_ksettings = encx24j600_set_link_ksettings,
};
static const struct net_device_ops encx24j600_netdev_ops = {
.ndo_open = encx24j600_open,
.ndo_stop = encx24j600_stop,
.ndo_start_xmit = encx24j600_tx,
.ndo_set_rx_mode = encx24j600_set_multicast_list,
.ndo_set_mac_address = encx24j600_set_mac_address,
.ndo_tx_timeout = encx24j600_tx_timeout,
.ndo_validate_addr = eth_validate_addr,
};
static int encx24j600_spi_probe(struct spi_device *spi)
{
int ret;
struct net_device *ndev;
struct encx24j600_priv *priv;
u16 eidled;
ndev = alloc_etherdev(sizeof(struct encx24j600_priv));
if (!ndev) {
ret = -ENOMEM;
goto error_out;
}
priv = netdev_priv(ndev);
spi_set_drvdata(spi, priv);
dev_set_drvdata(&spi->dev, priv);
SET_NETDEV_DEV(ndev, &spi->dev);
priv->msg_enable = netif_msg_init(debug, DEFAULT_MSG_ENABLE);
priv->ndev = ndev;
/* Default configuration PHY configuration */
priv->full_duplex = true;
priv->autoneg = AUTONEG_ENABLE;
priv->speed = SPEED_100;
priv->ctx.spi = spi;
devm_regmap_init_encx24j600(&spi->dev, &priv->ctx);
ndev->irq = spi->irq;
ndev->netdev_ops = &encx24j600_netdev_ops;
mutex_init(&priv->lock);
/* Reset device and check if it is connected */
if (encx24j600_hw_reset(priv)) {
netif_err(priv, probe, ndev,
DRV_NAME ": Chip is not detected\n");
ret = -EIO;
goto out_free;
}
/* Initialize the device HW to the consistent state */
encx24j600_hw_init(priv);
kthread_init_worker(&priv->kworker);
kthread_init_work(&priv->tx_work, encx24j600_tx_proc);
kthread_init_work(&priv->setrx_work, encx24j600_setrx_proc);
priv->kworker_task = kthread_run(kthread_worker_fn, &priv->kworker,
"encx24j600");
if (IS_ERR(priv->kworker_task)) {
ret = PTR_ERR(priv->kworker_task);
goto out_free;
}
/* Get the MAC address from the chip */
encx24j600_hw_get_macaddr(priv, ndev->dev_addr);
ndev->ethtool_ops = &encx24j600_ethtool_ops;
ret = register_netdev(ndev);
if (unlikely(ret)) {
netif_err(priv, probe, ndev, "Error %d initializing card encx24j600 card\n",
ret);
goto out_stop;
}
eidled = encx24j600_read_reg(priv, EIDLED);
if (((eidled & DEVID_MASK) >> DEVID_SHIFT) != ENCX24J600_DEV_ID) {
ret = -EINVAL;
goto out_unregister;
}
netif_info(priv, probe, ndev, "Silicon rev ID: 0x%02x\n",
(eidled & REVID_MASK) >> REVID_SHIFT);
netif_info(priv, drv, priv->ndev, "MAC address %pM\n", ndev->dev_addr);
return ret;
out_unregister:
unregister_netdev(priv->ndev);
out_stop:
kthread_stop(priv->kworker_task);
out_free:
free_netdev(ndev);
error_out:
return ret;
}
static int encx24j600_spi_remove(struct spi_device *spi)
{
struct encx24j600_priv *priv = dev_get_drvdata(&spi->dev);
unregister_netdev(priv->ndev);
kthread_stop(priv->kworker_task);
free_netdev(priv->ndev);
return 0;
}
static const struct spi_device_id encx24j600_spi_id_table[] = {
{ .name = "encx24j600" },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(spi, encx24j600_spi_id_table);
static struct spi_driver encx24j600_spi_net_driver = {
.driver = {
.name = DRV_NAME,
.owner = THIS_MODULE,
.bus = &spi_bus_type,
},
.probe = encx24j600_spi_probe,
.remove = encx24j600_spi_remove,
.id_table = encx24j600_spi_id_table,
};
static int __init encx24j600_init(void)
{
return spi_register_driver(&encx24j600_spi_net_driver);
}
module_init(encx24j600_init);
static void encx24j600_exit(void)
{
spi_unregister_driver(&encx24j600_spi_net_driver);
}
module_exit(encx24j600_exit);
MODULE_DESCRIPTION(DRV_NAME " ethernet driver");
MODULE_AUTHOR("Jon Ringle <jringle@gridpoint.com>");
MODULE_LICENSE("GPL");
MODULE_ALIAS("spi:" DRV_NAME);
| 26.33861 | 87 | 0.710655 |
c867c1444bf9180845f0bfe0b247a08715725163 | 1,436 | h | C | MITK/Modules/PointRegService/Internal/niftkPointRegServiceUsingSVD.h | NifTK/NifTK | 2358b333c89ff1bba1c232eecbbcdc8003305dfe | [
"BSD-3-Clause"
] | 13 | 2018-07-28T13:36:38.000Z | 2021-11-01T19:17:39.000Z | MITK/Modules/PointRegService/Internal/niftkPointRegServiceUsingSVD.h | NifTK/NifTK | 2358b333c89ff1bba1c232eecbbcdc8003305dfe | [
"BSD-3-Clause"
] | null | null | null | MITK/Modules/PointRegService/Internal/niftkPointRegServiceUsingSVD.h | NifTK/NifTK | 2358b333c89ff1bba1c232eecbbcdc8003305dfe | [
"BSD-3-Clause"
] | 10 | 2018-08-20T07:06:00.000Z | 2021-07-07T07:55:27.000Z | /*=============================================================================
NifTK: A software platform for medical image computing.
Copyright (c) University College London (UCL). All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
See LICENSE.txt in the top level directory for details.
=============================================================================*/
#ifndef niftkPointRegServiceUsingSVD_h
#define niftkPointRegServiceUsingSVD_h
#include <niftkPointRegServiceI.h>
namespace niftk
{
/**
* @class PointRegServiceUsingSVD
* @brief Implements niftk::PointRegServiceI using niftk::PointBasedRegistrationUsingSVD.
*/
class PointRegServiceUsingSVD : public niftk::PointRegServiceI
{
public:
PointRegServiceUsingSVD();
~PointRegServiceUsingSVD();
/**
* @see niftk::PointBasedRegistrationUsingSVD
* @throws mitk::Exception for all errors
*/
virtual double Register(const mitk::PointSet::Pointer fixedPoints,
const mitk::PointSet::Pointer movingPoints,
vtkMatrix4x4& matrix) const override;
private:
PointRegServiceUsingSVD(const PointRegServiceUsingSVD&); // deliberately not implemented
PointRegServiceUsingSVD& operator=(const PointRegServiceUsingSVD&); // deliberately not implemented
};
} // end namespace
#endif
| 27.615385 | 101 | 0.673398 |
0c27a4dc36eb1dabd9005ee9ccaa8555af2b1086 | 13,440 | h | C | services/bluetooth_standard/service/src/map_mce/map_mce_instance_stm.h | openharmony-sig-ci/communication_bluetooth | c9d9614e881224abfb423505e25e72163dd25df3 | [
"Apache-2.0"
] | null | null | null | services/bluetooth_standard/service/src/map_mce/map_mce_instance_stm.h | openharmony-sig-ci/communication_bluetooth | c9d9614e881224abfb423505e25e72163dd25df3 | [
"Apache-2.0"
] | null | null | null | services/bluetooth_standard/service/src/map_mce/map_mce_instance_stm.h | openharmony-sig-ci/communication_bluetooth | c9d9614e881224abfb423505e25e72163dd25df3 | [
"Apache-2.0"
] | 1 | 2021-09-13T11:16:33.000Z | 2021-09-13T11:16:33.000Z | /*
* Copyright (C) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup Bluetooth
* @{
*
* @brief Defines map client service instance state machine object.
*
*/
/**
* @file map_mce_instance_stm.h
*
* @brief map client service instance state machine header file .
*
*/
#ifndef MAP_MCE_INSTANCE_STM_H
#define MAP_MCE_INSTANCE_STM_H
#include <atomic>
#include <memory>
#include <mutex>
#include <string>
#include "../obex/obex_headers.h"
#include "btstack.h"
#include "dispatcher.h"
#include "map_mce_device_ctrl.h"
#include "map_mce_instance_client.h"
#include "map_mce_instance_request.h"
#include "map_mce_types.h"
#include "message.h"
#include "state_machine.h"
namespace bluetooth {
/**
* @brief MceInstanceState Type
*/
enum MceInstanceStateType {
MCE_INSTANCE_STATE_CONNECTED,
MCE_INSTANCE_STATE_CONNECTING,
MCE_INSTANCE_STATE_DISCONNECTED,
MCE_INSTANCE_STATE_DISCONNECTING
};
/**
* @brief state machine message define
*/
enum MapMceStmMessage {
// instance stm message
MSG_MASSTM_START = 0x2000,
// client stm interface api msg
MSG_MASSTM_REQ_CONNECT,
MSG_MASSTM_REQ_DISCONNECT,
MSG_MASSTM_REQ_GET_FOLDER_LISTING,
MSG_MASSTM_REQ_SET_NOTIFICATION_REGIST,
MSG_MASSTM_REQ_SET_PATH,
MSG_MASSTM_REQ_GET_INSTANCE,
// send request
MSG_MASSTM_REQ_SEND_REQUEST,
MSG_MASSTM_REQ_SEND_REQUEST_SELF,
// device msg
MSG_MASSTM_GAP_REQUEST_FINISH = MSG_MASSTM_START + 0x100,
MSG_MASSTM_GAP_REQUEST_FAILED,
MSG_MASSTM_OBEX_CONNECTED,
MSG_MASSTM_OBEX_CONNECTED_FAILED,
MSG_MASSTM_OBEX_TRANSPORT_FAILED,
MSG_MASSTM_OBEX_DISCONNECTED,
MSG_MASSTM_OBEX_INFO_CHG_CONTINUEBUSY_STATUS,
// normal request response
MSG_MASSTM_RECEIVE_REQUEST_COMPLETED,
};
const std::string MCE_DISCONNECTED_STATE = "MceDisconnected";
const std::string MCE_CONNECTING_STATE = "MceConnecting";
const std::string MCE_CONNECTED_STATE = "MceConnected";
const std::string MCE_DISCONNECTING_STATE = "MceDisconnecting";
const std::string MCE_CONNECTED_STATE_S_REQSENDING = "MceConnectedReqSending";
class MapMceInstanceStm : public utility::StateMachine {
public:
/**
* @brief copy operator
*/
DISALLOW_COPY_AND_ASSIGN(MapMceInstanceStm);
/**
* @brief Construct a new Map Mce Instance Stm object
* @param deviceMgr
* @param dispatcher
* @param instanceId
*/
MapMceInstanceStm(
MapMceDeviceCtrl &deviceMgr, utility::Dispatcher &dispatcher, int instanceId, const MasInstanceConfig &config);
/**
* @brief Destroy the Mce Mas Instance Stm object
*/
~MapMceInstanceStm();
/**
* @brief Create a Stm object
*/
void CreateStm();
/**
* @brief Post Message to map mce service task
* @param msg
*/
void PostMessage(utility::Message msg);
/**
* @brief message process
* @param msg
*/
void MceProcessMessage(utility::Message msg);
/**
* @brief Get the Target State object
* @return MceInstanceStateType
*/
MceInstanceStateType GetTargetState();
/**
* @brief Get the current State object
* @return MceInstanceStateType
*/
std::string GetCurrentMceStmStateName();
/**
* @brief Get the Bt Device object
* @return std::string
*/
std::string GetBtDevice();
/**
* @brief Get the Bt Address object
* @return BtAddr
*/
BtAddr GetBtAddress();
/**
* @brief Tans client TargetState
* @param state
*/
void TansTargetState(MceInstanceStateType state);
/**
* @brief Post Message to map mce service task
* @param msg message
* @param head obex header
*/
void PostMessageWithObexHeader(utility::Message msg, ObexHeader head);
/**
* @brief message process
* @param msg message
* @param head obex header
*/
void MceProcessMessageWithObexHeader(utility::Message msg, ObexHeader head);
/**
* @brief Post Message to map mce service task
* @param msg message
* @param req request
* @return int
*/
void PostMessageWithRequest(utility::Message msg, std::unique_ptr<MapMceInstanceRequest> &req);
/**
* @brief process Message to map mce service task
* @param msg message
* @param req request
* @return int
*/
void MceProcessMessageWithRequest(utility::Message msg, std::unique_ptr<MapMceInstanceRequest> &req);
/**
* @brief process Message to map mce service task
* @param msg message
* @param req request
* @return int
*/
void MceProcessMessageWithRequestInternal(utility::Message msg, std::unique_ptr<MapMceInstanceRequest> &req);
/**
* @brief GetBusyStatus
* @return bool
*/
bool GetBusyStatus();
/**
* @brief Change Busy Status
* @param status
*/
void ChangeStmBusyStatus(bool status);
/**
* @brief Get the Client object
* @return MapMceInstanceClient&
*/
MapMceInstanceClient &GetMasClient();
private:
// mas client
std::unique_ptr<MapMceInstanceClient> masClient_ = nullptr;
// mce device mgr
MapMceDeviceCtrl &mceDeviceMgr_;
// obex header
std::unique_ptr<ObexHeader> stmObexHeader_ = nullptr;
// request ptr
std::unique_ptr<MapMceInstanceRequest> stmRequestPtr_ = nullptr;
// sending flag
std::atomic_bool stmSendFlag {false};
/**
* @brief Change Busy Status
* @param status
*/
void ChangeContinueBusyStatus(bool status);
// bluetooth device address ,string
std::string btDevice_ = "";
// bluetooth device address ,array
BtAddr btAddress_ {};
// instance id
int masInstanceId_ = 0;
// target state
MceInstanceStateType targetState_ = MceInstanceStateType::MCE_INSTANCE_STATE_DISCONNECTED;
// dispacher
utility::Dispatcher &mceStmDispacher_;
// default config
MasInstanceConfig insDefaultConfig_ {};
// stm mutex
std::recursive_mutex mceInstanceStmMutex_ {};
// stm Data busy Flag
std::atomic_bool busyFlag_ {false};
// stm ata Continue Flag
std::atomic_bool stmDataContinueFlag_ {false};
// stm Data busy Flag
std::atomic_bool stmDataStmBusyFlag_ {false};
/**
* @brief map state machine state
*/
class MapMceState : public utility::StateMachine::State {
public:
/**
* @brief Construct a new Map Mce State object
* @param name
* @param stm
* @param parent
*/
explicit MapMceState(const std::string &name, utility::StateMachine &stm) : State(name, stm){};
/**
* @brief Construct a new Map Mce State object
* @param name
* @param stm
* @param parent
*/
explicit MapMceState(const std::string &name, utility::StateMachine &stm, State &parent)
: State(name, stm, parent){};
/**
* @brief Destroy the Map Mce State object
*/
virtual ~MapMceState() = default;
};
/**
* @brief map state machine state
*/
class MapMceDisconnectedState : public MapMceState {
public:
/**
* @brief Construct a new Map Mce Disconnected State object
* @param stm
*/
explicit MapMceDisconnectedState(utility::StateMachine &stm)
: MapMceState(MCE_DISCONNECTED_STATE, stm), mceInstanceStm_((MapMceInstanceStm &)stm){};
/**
* @brief Destroy the Map Mce Disconnected State object
*/
virtual ~MapMceDisconnectedState() = default;
/**
* @brief state entry
*/
virtual void Entry();
/**
* @brief state exit
*/
virtual void Exit();
/**
* @brief dispatch
* @param msg
* @return true
* @return false
*/
virtual bool Dispatch(const utility::Message &msg);
private:
// instance stm
MapMceInstanceStm &mceInstanceStm_;
};
/**
* @brief map state machine state
*/
class MapMceConnectingState : public MapMceState {
public:
/**
* @brief Construct a new Map Mce Connecting State object
* @param stm
*/
explicit MapMceConnectingState(utility::StateMachine &stm)
: MapMceState(MCE_CONNECTING_STATE, stm), mceInstanceStm_((MapMceInstanceStm &)stm){};
/**
* @brief Destroy the Map Mce Connecting State object
*/
virtual ~MapMceConnectingState() = default;
/**
* @brief state entry
*/
virtual void Entry();
/**
* @brief state exit
*/
virtual void Exit();
/**
* @brief msg dispatch
* @param msg
* @return true
* @return false
*/
virtual bool Dispatch(const utility::Message &msg);
private:
/**
* @brief Connected dispatch
*/
void DispatchProcObexConnected();
/**
* @brief disconnected dispatch
*/
void DispatchProcObexDisconnected();
/**
* @brief transport failed dispatch
*/
void DispatchProcTransportFailed(const utility::Message &msg);
/**
* @brief connected failed dispatch
*/
void DispatchProcObexConnectedFailed();
/**
* @brief connected failed dispatch
*/
void DispatchProcConnectedFailed();
// mce instance stm
MapMceInstanceStm &mceInstanceStm_;
};
/**
* @brief map state machine state
*/
class MapMceConnectedState : public MapMceState {
public:
/**
* @brief Construct a new Map Mce Connected State object
* @param stm
*/
explicit MapMceConnectedState(utility::StateMachine &stm)
: MapMceState(MCE_CONNECTED_STATE, stm), mceInstanceStm_((MapMceInstanceStm &)stm){};
/**
* @brief Destroy the Map Mce Connected State object
*/
virtual ~MapMceConnectedState() = default;
/**
* @brief state entry
*/
virtual void Entry();
/**
* @brief state exit
*/
virtual void Exit();
/**
* @brief msg dispatch
* @param msg
* @return true
* @return false
*/
virtual bool Dispatch(const utility::Message &msg);
private:
// instance stm
MapMceInstanceStm &mceInstanceStm_;
};
/**
* @brief map state machine state
*/
class MapMceConnectedStateSubReqSending : public MapMceState {
public:
/**
* @brief Construct a new Map Mce Connected State Sub Req Sending object
* @param stm
* @param parent
*/
MapMceConnectedStateSubReqSending(utility::StateMachine &stm, State &parent)
: MapMceState(MCE_CONNECTED_STATE_S_REQSENDING, stm, parent), mceInstanceStm_((MapMceInstanceStm &)stm){};
/**
* @brief Destroy the Map Mce Connected State Sub Req Sending object
*/
virtual ~MapMceConnectedStateSubReqSending() = default;
/**
* @brief state entry
*/
virtual void Entry();
/**
* @brief state exit
*/
virtual void Exit();
/**
* @brief state dispatch
* @param msg
* @return true
* @return false
*/
virtual bool Dispatch(const utility::Message &msg);
private:
/**
* @brief process Receive Request Complite
* @param msg My Param doc
*/
void ProcReceiveRequestComplite(const utility::Message &msg);
// mce instance stm
MapMceInstanceStm &mceInstanceStm_;
};
/**
* @brief map state machine state
*/
class MapMceDisconnectingState : public MapMceState {
public:
/**
* @brief Construct a new Map Mce Disconnecting State object
* @param stm
*/
explicit MapMceDisconnectingState(utility::StateMachine &stm)
: MapMceState(MCE_DISCONNECTING_STATE, stm), mceInstanceStm_((MapMceInstanceStm &)stm){};
/**
* @brief Destroy the Map Mce Disconnecting State object
*/
virtual ~MapMceDisconnectingState() = default;
/**
* @brief state entry
*/
virtual void Entry();
/**
* @brief state exit
*/
virtual void Exit();
/**
* @brief msg dispatch
*/
virtual bool Dispatch(const utility::Message &msg);
private:
// instance stm
MapMceInstanceStm &mceInstanceStm_;
};
};
} // namespace bluetooth
#endif // MAP_MCE_INSTANCE_STM_H
| 29.090909 | 119 | 0.614435 |
ae8a7e9ea37a3e0ee46836060b6ad5f6d63dcc6e | 47,445 | c | C | linux-3.4/modules/rogue_km/services/server/env/linux/pvr_sync.c | xregist/v3s-linux-sdk | a2b013e3959662d65650a13fc23ec1cd503865eb | [
"Apache-2.0"
] | null | null | null | linux-3.4/modules/rogue_km/services/server/env/linux/pvr_sync.c | xregist/v3s-linux-sdk | a2b013e3959662d65650a13fc23ec1cd503865eb | [
"Apache-2.0"
] | null | null | null | linux-3.4/modules/rogue_km/services/server/env/linux/pvr_sync.c | xregist/v3s-linux-sdk | a2b013e3959662d65650a13fc23ec1cd503865eb | [
"Apache-2.0"
] | 1 | 2020-01-31T10:27:07.000Z | 2020-01-31T10:27:07.000Z | /*************************************************************************/ /*!
@File pvr_sync.c
@Title Kernel driver for Android's sync mechanism
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include "pvr_sync.h"
#include <linux/errno.h>
#include <linux/file.h>
#include <linux/miscdevice.h>
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/debugfs.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/version.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0))
#include <linux/sync.h>
#else
#include <../drivers/staging/android/sync.h>
#endif
#include "img_types.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "pvrsrv.h"
#include "sync_server.h"
#include "pvr_fd_sync_user.h"
/*#define DEBUG_OUTPUT 1*/
#ifdef DEBUG_OUTPUT
#define DPF(fmt, ...) PVR_DPF((PVR_DBG_BUFFERED, fmt, __VA_ARGS__))
#else
#define DPF(fmt, ...) do {} while(0)
#endif
/* This is the IMG extension of a sync_timeline */
struct PVR_SYNC_TIMELINE
{
struct sync_timeline obj;
/* Global timeline list support */
struct list_head sTlList;
IMG_UINT32 ui32Id;
atomic_t sValue;
};
struct PVR_SYNC_TL_TO_SIGNAL
{
/* List entry support for the list of timelines which needs signaling */
struct list_head sList;
/* The timeline to signal */
struct PVR_SYNC_TIMELINE *psPVRTl;
};
struct PVR_SYNC_KERNEL_SYNC_PRIM
{
/* Base services sync prim structure */
SERVER_SYNC_PRIMITIVE *psSync;
/* FWAddr used by the server sync */
IMG_UINT32 ui32SyncPrimVAddr;
/* Internal sync update value. Currently always '1'.
* This might change when/if we change to local syncs. */
IMG_UINT32 ui32SyncValue;
/* Cleanup sync prim structure.
* If the base sync prim is used for "checking" only within a gl stream,
* there is no way of knowing when this has happened. So use a second sync
* prim which just gets updated and check the update count when freeing
* this struct. */
SERVER_SYNC_PRIMITIVE *psCleanUpSync;
/* Id from the cleanup server sync */
IMG_UINT32 ui32CleanUpId;
/* FWAddr used by the cleanup server sync */
IMG_UINT32 ui32CleanUpVAddr;
/* Last used update value for the cleanup server sync */
IMG_UINT32 ui32CleanUpValue;
/* Sync points can go away when there are deferred hardware
* operations still outstanding. We must not free the SERVER_SYNC_PRIMITIVE
* until the hardware is finished, so we add it to a defer list
* which is processed periodically ("defer-free").
*
* Note that the defer-free list is global, not per-timeline.
*/
struct list_head sHead;
};
struct PVR_SYNC_DATA
{
/* Every sync point has a services sync object. This object is used
* by the hardware to enforce ordering -- it is attached as a source
* dependency to various commands.
*/
struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel;
/* Every sync data will get some unique id */
IMG_UINT32 ui32Id;
/* The value when the this fence was taken according to the timeline this
* fence belongs to. Defines somehow the age of the fence point. */
IMG_UINT32 ui32FenceValue;
/* This refcount is incremented at create and dup time, and decremented
* at free time. It ensures the object doesn't start the defer-free
* process until it is no longer referenced.
*/
atomic_t sRefCount;
};
/* This is the IMG extension of a sync_pt */
struct PVR_SYNC_PT
{
/* Private data */
struct sync_pt pt;
struct PVR_SYNC_DATA *psSyncData;
IMG_BOOL bSignaled;
IMG_BOOL bUpdated;
};
/* Any sync point from a foreign (non-PVR) timeline needs to have a "shadow"
* sync prim. This is modelled as a software operation. The foreign driver
* completes the operation by calling a callback we registered with it. */
struct PVR_SYNC_FENCE_WAITER
{
/* Base sync driver waiter structure */
struct sync_fence_waiter waiter;
/* "Shadow" sync prim backing the foreign driver's sync_pt */
struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel;
};
/* Global data for the sync driver */
static struct
{
/* Services connection */
IMG_HANDLE hDevCookie;
/* Unique requester id for taking sw sync ops. */
IMG_UINT32 ui32SyncRequesterId;
/* Complete notify handle */
IMG_HANDLE hCmdCompHandle;
/* Multi-purpose workqueue. Various functions in the Google sync driver
* may call down to us in atomic context. However, sometimes we may need
* to lock a mutex. To work around this conflict, use the workqueue to
* defer whatever the operation was. */
struct workqueue_struct *psWorkQueue;
/* Linux work struct for workqueue. */
struct work_struct sWork;
/* Unique id counter for the timelines. */
atomic_t sTimelineId;
}gsPVRSync;
static LIST_HEAD(gTlList);
static DEFINE_MUTEX(gTlListLock);
/* The "defer-free" object list. Driver global. */
static LIST_HEAD(gSyncPrimFreeList);
static DEFINE_SPINLOCK(gSyncPrimFreeListLock);
/* Linux debugfs handle */
static struct dentry *gpsDebugfsDentry;
#ifdef DEBUG_OUTPUT
static char* _debugInfoTl(struct sync_timeline *tl)
{
static char szInfo[256];
struct PVR_SYNC_TIMELINE* psPVRTl = (struct PVR_SYNC_TIMELINE*)tl;
szInfo[0] = '\0';
snprintf(szInfo, sizeof(szInfo), "id=%u n='%s' tv=%d",
psPVRTl->ui32Id,
tl->name,
atomic_read(&psPVRTl->sValue));
return szInfo;
}
static char* _debugInfoPt(struct sync_pt *pt)
{
static char szInfo[256];
static char szInfo1[256];
struct PVR_SYNC_PT* psPVRPt = (struct PVR_SYNC_PT*)pt;
szInfo[0] = '\0';
szInfo1[0] = '\0';
if (psPVRPt->psSyncData->psSyncKernel->psCleanUpSync)
{
snprintf(szInfo1, sizeof(szInfo1), " # cleanup: fw=%08x v=%u",
psPVRPt->psSyncData->psSyncKernel->ui32CleanUpVAddr,
psPVRPt->psSyncData->psSyncKernel->ui32CleanUpValue);
}
snprintf(szInfo, sizeof(szInfo), "sync: id=%u%s tv=%u # fw=%08x v=%u r=%d%s p: %s",
psPVRPt->psSyncData->ui32Id,
psPVRPt->bSignaled ? "* " : " ",
psPVRPt->psSyncData->ui32FenceValue,
psPVRPt->psSyncData->psSyncKernel->ui32SyncPrimVAddr,
psPVRPt->psSyncData->psSyncKernel->ui32SyncValue,
atomic_read(&psPVRPt->psSyncData->sRefCount),
szInfo1,
_debugInfoTl(pt->parent));
return szInfo;
}
#endif /* DEBUG_OUTPUT */
static struct sync_pt *PVRSyncDup(struct sync_pt *sync_pt)
{
struct PVR_SYNC_PT *psPVRPtOne = (struct PVR_SYNC_PT *)sync_pt;
struct PVR_SYNC_PT *psPVRPtTwo = IMG_NULL;
DPF("%s: # %s", __func__,
_debugInfoPt(sync_pt));
psPVRPtTwo = (struct PVR_SYNC_PT *)
sync_pt_create(psPVRPtOne->pt.parent, sizeof(struct PVR_SYNC_PT));
if (!psPVRPtTwo)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to dup sync pt",
__func__));
goto err_out;
}
psPVRPtTwo->psSyncData = psPVRPtOne->psSyncData;
psPVRPtTwo->bSignaled = psPVRPtOne->bSignaled;
psPVRPtTwo->bUpdated = psPVRPtOne->bUpdated;
atomic_inc(&psPVRPtTwo->psSyncData->sRefCount);
err_out:
return (struct sync_pt*)psPVRPtTwo;
}
static int PVRSyncHasSignaled(struct sync_pt *sync_pt)
{
struct PVR_SYNC_PT *psPVRPt = (struct PVR_SYNC_PT *)sync_pt;
if (ServerSyncFenceIsMeet(psPVRPt->psSyncData->psSyncKernel->psSync,
psPVRPt->psSyncData->psSyncKernel->ui32SyncValue))
psPVRPt->bSignaled = IMG_TRUE;
DPF("%s: r: %d # %s", __func__,
psPVRPt->bSignaled, _debugInfoPt(sync_pt));
return psPVRPt->bSignaled == IMG_TRUE ? 1 : 0;
}
static int PVRSyncCompare(struct sync_pt *a, struct sync_pt *b)
{
DPF("%s: a # %s", __func__,
_debugInfoPt(a));
DPF("%s: b # %s", __func__,
_debugInfoPt(b));
return
((struct PVR_SYNC_PT*)a)->psSyncData->ui32FenceValue == ((struct PVR_SYNC_PT*)b)->psSyncData->ui32FenceValue ? 0 :
((struct PVR_SYNC_PT*)a)->psSyncData->ui32FenceValue > ((struct PVR_SYNC_PT*)b)->psSyncData->ui32FenceValue ? 1 : -1;
}
static void PVRSyncReleaseTimeline(struct sync_timeline *psObj)
{
struct PVR_SYNC_TIMELINE *psPVRTl = (struct PVR_SYNC_TIMELINE *)psObj;
DPF("%s: # %s", __func__,
_debugInfoTl(psObj));
mutex_lock(&gTlListLock);
list_del(&psPVRTl->sTlList);
mutex_unlock(&gTlListLock);
}
static void PVRSyncValueStrTimeline(struct sync_timeline *psObj,
char *str, int size)
{
struct PVR_SYNC_TIMELINE *psPVRTl = (struct PVR_SYNC_TIMELINE *)psObj;
snprintf(str, size, "%d", atomic_read(&psPVRTl->sValue));
}
static void PVRSyncValueStr(struct sync_pt *psPt,
char *str, int size)
{
struct PVR_SYNC_PT *psPVRPt = (struct PVR_SYNC_PT *)psPt;
/* This output is very compressed cause in the systrace case we just have
* 32 chars and when printing it to /d/sync there are only 64 chars
* available. Prints:
* s=actual sync, cls=cleanup sync
* timeline value (s_id/s_address:latest cls_value-cls_id/cls_addr) */
if (psPVRPt->psSyncData)
{
if (!psPVRPt->psSyncData->psSyncKernel->psCleanUpSync)
{
snprintf(str, size, "%u (%u/0x%08x)",
psPVRPt->psSyncData->ui32FenceValue,
psPVRPt->psSyncData->ui32Id,
psPVRPt->psSyncData->psSyncKernel->ui32SyncPrimVAddr);
}else
{
snprintf(str, size, "%u (%u/0x%08x:%u-%u/0x%08x)",
psPVRPt->psSyncData->ui32FenceValue,
psPVRPt->psSyncData->ui32Id,
psPVRPt->psSyncData->psSyncKernel->ui32SyncPrimVAddr,
psPVRPt->psSyncData->psSyncKernel->ui32CleanUpValue,
psPVRPt->psSyncData->psSyncKernel->ui32CleanUpId,
psPVRPt->psSyncData->psSyncKernel->ui32CleanUpVAddr);
}
}
}
static struct PVR_SYNC_PT *
PVRSyncCreateSync(struct PVR_SYNC_TIMELINE *psPVRTl)
{
struct PVR_SYNC_DATA *psSyncData;
struct PVR_SYNC_PT *psPVRPt = IMG_NULL;
IMG_UINT32 ui32Dummy;
IMG_UINT32 ui32FWAddr;
IMG_UINT32 ui32CurrOp;
IMG_UINT32 ui32NextOp;
PVRSRV_ERROR eError;
/* We create our internal data first, before creating a new sync point and
* attaching the data to it. */
psSyncData = OSAllocZMem(sizeof(struct PVR_SYNC_DATA));
if (!psSyncData)
{
goto err_out;
}
psSyncData->psSyncKernel = OSAllocMem(sizeof(struct PVR_SYNC_KERNEL_SYNC_PRIM));
if (!psSyncData->psSyncKernel)
{
goto err_free_data;
}
atomic_set(&psSyncData->sRefCount, 1);
psSyncData->ui32FenceValue = atomic_inc_return(&psPVRTl->sValue);
eError = PVRSRVServerSyncAllocKM(gsPVRSync.hDevCookie,
&psSyncData->psSyncKernel->psSync,
&psSyncData->psSyncKernel->ui32SyncPrimVAddr);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_free_data1;
}
eError = PVRSRVServerSyncGetStatusKM(1, &psSyncData->psSyncKernel->psSync,
&psSyncData->ui32Id,
&ui32FWAddr,
&ui32CurrOp, &ui32NextOp);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to get status of prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_free_sync;
}
eError = PVRSRVServerSyncQueueHWOpKM(psSyncData->psSyncKernel->psSync,
IMG_TRUE,
&ui32Dummy,
&psSyncData->psSyncKernel->ui32SyncValue);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to queue prim server sync hw operation (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_free_sync;
}
psSyncData->psSyncKernel->psCleanUpSync = IMG_NULL;
psSyncData->psSyncKernel->ui32CleanUpId = 0;
psSyncData->psSyncKernel->ui32CleanUpVAddr = 0;
psSyncData->psSyncKernel->ui32CleanUpValue = 0;
psPVRPt = (struct PVR_SYNC_PT *)
sync_pt_create(&psPVRTl->obj, sizeof(struct PVR_SYNC_PT));
if (!psPVRPt)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to create sync pt",
__func__));
goto err_complete_sync;
}
psPVRPt->psSyncData = psSyncData;
psPVRPt->bSignaled = IMG_FALSE;
psPVRPt->bUpdated = IMG_FALSE;
err_out:
return psPVRPt;
err_complete_sync:
ServerSyncCompleteOp(psSyncData->psSyncKernel->psSync, IMG_TRUE,
psSyncData->psSyncKernel->ui32SyncValue);
err_free_sync:
PVRSRVServerSyncFreeKM(psSyncData->psSyncKernel->psSync);
err_free_data1:
OSFreeMem(psSyncData->psSyncKernel);
err_free_data:
OSFreeMem(psSyncData);
goto err_out;
}
static void
PVRSyncAddToDeferFreeList(struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel)
{
unsigned long flags;
spin_lock_irqsave(&gSyncPrimFreeListLock, flags);
list_add_tail(&psSyncKernel->sHead, &gSyncPrimFreeList);
spin_unlock_irqrestore(&gSyncPrimFreeListLock, flags);
}
/* Releases a sync prim - freeing it if there are no outstanding
* operations, else adding it to a deferred list to be freed later.
* Returns IMG_TRUE if the free was deferred, IMG_FALSE otherwise.
*/
static IMG_BOOL
PVRSyncReleaseSyncPrim(struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel)
{
PVRSRV_ERROR eError;
/* Freeing the sync needs us to be in non atomic context,
* but this function may be called from the sync driver in
* interrupt context (for example a sw_sync user incs a timeline).
* In such a case we must defer processing to the WQ.
*/
if(in_atomic() || in_interrupt())
{
PVRSyncAddToDeferFreeList(psSyncKernel);
return IMG_TRUE;
}
OSAcquireBridgeLock();
if ( !ServerSyncFenceIsMeet(psSyncKernel->psSync, psSyncKernel->ui32SyncValue)
|| (psSyncKernel->psCleanUpSync && !ServerSyncFenceIsMeet(psSyncKernel->psCleanUpSync, psSyncKernel->ui32CleanUpValue)))
{
OSReleaseBridgeLock();
PVRSyncAddToDeferFreeList(psSyncKernel);
return IMG_TRUE;
}
eError = PVRSRVServerSyncFreeKM(psSyncKernel->psSync);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to free prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
/* Fall-thru */
}
if (psSyncKernel->psCleanUpSync)
{
eError = PVRSRVServerSyncFreeKM(psSyncKernel->psCleanUpSync);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to free prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
/* Fall-thru */
}
}
OSFreeMem(psSyncKernel);
OSReleaseBridgeLock();
return IMG_FALSE;
}
static void PVRSyncFreeSync(struct sync_pt *psPt)
{
struct PVR_SYNC_PT *psPVRPt = (struct PVR_SYNC_PT *)psPt;
DPF("%s: # %s", __func__,
_debugInfoPt(psPt));
/* Only free on the last reference */
if (atomic_dec_return(&psPVRPt->psSyncData->sRefCount) != 0)
return;
if(PVRSyncReleaseSyncPrim(psPVRPt->psSyncData->psSyncKernel))
queue_work(gsPVRSync.psWorkQueue, &gsPVRSync.sWork);
OSFreeMem(psPVRPt->psSyncData);
}
static struct sync_timeline_ops gsPVR_SYNC_TIMELINE_ops =
{
.driver_name = PVRSYNC_MODNAME,
.dup = PVRSyncDup,
.has_signaled = PVRSyncHasSignaled,
.compare = PVRSyncCompare,
.free_pt = PVRSyncFreeSync,
.release_obj = PVRSyncReleaseTimeline,
.timeline_value_str = PVRSyncValueStrTimeline,
.pt_value_str = PVRSyncValueStr,
};
/* foreign sync handling */
static void
PVRSyncForeignSyncPtSignaled(struct sync_fence *fence,
struct sync_fence_waiter *waiter)
{
struct PVR_SYNC_FENCE_WAITER *psWaiter =
(struct PVR_SYNC_FENCE_WAITER *)waiter;
/* Complete the SW operation and free the sync if we can. If we can't,
* it will be checked by a later workqueue kick. */
ServerSyncCompleteOp(psWaiter->psSyncKernel->psSync, IMG_TRUE, psWaiter->psSyncKernel->ui32SyncValue);
/* Can ignore retval because we queue_work anyway */
PVRSyncReleaseSyncPrim(psWaiter->psSyncKernel);
/* This complete may unblock the GPU. */
queue_work(gsPVRSync.psWorkQueue, &gsPVRSync.sWork);
OSFreeMem(psWaiter);
sync_fence_put(fence);
}
static struct PVR_SYNC_KERNEL_SYNC_PRIM *
PVRSyncCreateWaiterForForeignSync(int iFenceFd)
{
struct PVR_SYNC_FENCE_WAITER *psWaiter;
struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel = IMG_NULL;
struct sync_fence *psFence;
IMG_UINT32 ui32Dummy;
PVRSRV_ERROR eError;
int err;
psFence = sync_fence_fdget(iFenceFd);
if(!psFence)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to take reference on fence",
__func__));
goto err_out;
}
psSyncKernel = OSAllocMem(sizeof(struct PVR_SYNC_KERNEL_SYNC_PRIM));
if(!psSyncKernel)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate sync kernel", __func__));
goto err_put_fence;
}
eError = PVRSRVServerSyncAllocKM(gsPVRSync.hDevCookie,
&psSyncKernel->psSync,
&psSyncKernel->ui32SyncPrimVAddr);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_free_kernel;
}
eError = PVRSRVServerSyncQueueSWOpKM(psSyncKernel->psSync,
&ui32Dummy,
&psSyncKernel->ui32SyncValue,
gsPVRSync.ui32SyncRequesterId,
IMG_TRUE,
IMG_NULL);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to queue prim server sync sw operation (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_free_sync;
}
eError = PVRSRVServerSyncAllocKM(gsPVRSync.hDevCookie,
&psSyncKernel->psCleanUpSync,
&psSyncKernel->ui32CleanUpVAddr);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate cleanup prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_complete_sync;
}
eError = PVRSRVServerSyncQueueHWOpKM(psSyncKernel->psCleanUpSync,
IMG_TRUE,
&ui32Dummy,
&psSyncKernel->ui32CleanUpValue);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to queue cleanup prim server sync hw operation (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_free_cleanup_sync;
}
/* The custom waiter structure is freed in the waiter callback */
psWaiter = OSAllocMem(sizeof(struct PVR_SYNC_FENCE_WAITER));
if(!psWaiter)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate waiter", __func__));
goto err_complete_cleanup_sync;
}
psWaiter->psSyncKernel = psSyncKernel;
sync_fence_waiter_init(&psWaiter->waiter, PVRSyncForeignSyncPtSignaled);
err = sync_fence_wait_async(psFence, &psWaiter->waiter);
if(err)
{
if(err < 0)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Fence was in error state", __func__));
/* Fall-thru */
}
/* -1 means the fence was broken, 1 means the fence already
* signalled. In either case, roll back what we've done and
* skip using this sync_pt for synchronization.
*/
goto err_free_waiter;
}
err_out:
return psSyncKernel;
err_free_waiter:
OSFreeMem(psWaiter);
err_complete_cleanup_sync:
PVRSRVServerSyncPrimSetKM(psSyncKernel->psCleanUpSync, psSyncKernel->ui32CleanUpValue);
err_free_cleanup_sync:
eError = PVRSRVServerSyncFreeKM(psSyncKernel->psCleanUpSync);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to free cleanup prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
/* Fall-thru */
}
err_complete_sync:
ServerSyncCompleteOp(psSyncKernel->psSync, IMG_TRUE, psSyncKernel->ui32SyncValue);
err_free_sync:
eError = PVRSRVServerSyncFreeKM(psSyncKernel->psSync);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to free prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
/* Fall-thru */
}
err_free_kernel:
OSFreeMem(psSyncKernel);
psSyncKernel = IMG_NULL;
err_put_fence:
sync_fence_put(psFence);
goto err_out;
}
static PVRSRV_ERROR
PVRSyncDebugFenceKM(IMG_INT32 i32FDFence,
IMG_CHAR *pszName,
IMG_INT32 *pi32Status,
IMG_UINT32 ui32MaxNumSyncs,
IMG_UINT32 *pui32NumSyncs,
PVR_SYNC_DEBUG_SYNC_DATA *aPts)
{
struct list_head *psEntry;
struct sync_fence *psFence = sync_fence_fdget(i32FDFence);
PVRSRV_ERROR eError = PVRSRV_OK;
if (!psFence)
return PVRSRV_ERROR_HANDLE_NOT_FOUND;
if (!pui32NumSyncs || !pi32Status)
return PVRSRV_ERROR_INVALID_PARAMS;
*pui32NumSyncs = 0;
strncpy(pszName, psFence->name, sizeof(psFence->name));
*pi32Status = psFence->status;
list_for_each(psEntry, &psFence->pt_list_head)
{
struct sync_pt *psPt =
container_of(psEntry, struct sync_pt, pt_list);
if (*pui32NumSyncs == ui32MaxNumSyncs)
{
PVR_DPF((PVR_DBG_WARNING, "%s: To less space on fence query for all "
"the sync points in this fence", __func__));
goto err_put;
}
/* Clear the entry */
memset(&aPts[*pui32NumSyncs], 0, sizeof(aPts[*pui32NumSyncs]));
/* Save this within the sync point. */
strncpy(aPts[*pui32NumSyncs].szParentName, psPt->parent->name,
sizeof(aPts[*pui32NumSyncs].szParentName));
/* Only fill this for our sync points. Foreign syncs will get empty
* fields. */
if(psPt->parent->ops == &gsPVR_SYNC_TIMELINE_ops)
{
struct PVR_SYNC_PT *psPVRPt = (struct PVR_SYNC_PT *)psPt;
IMG_UINT32 ui32UID;
IMG_UINT32 ui32FWAddr;
IMG_UINT32 ui32CurrOp;
IMG_UINT32 ui32NextOp;
eError = PVRSRVServerSyncGetStatusKM(1, &psPVRPt->psSyncData->psSyncKernel->psSync,
&ui32UID, &ui32FWAddr,
&ui32CurrOp, &ui32NextOp);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to get status of prim server "
"sync (%s)", __func__, PVRSRVGetErrorStringKM(eError)));
goto err_put;
}
aPts[*pui32NumSyncs].ui32Id = ui32UID;
aPts[*pui32NumSyncs].ui32CurrOp = ui32CurrOp;
aPts[*pui32NumSyncs].ui32NextOp = ui32NextOp;
aPts[*pui32NumSyncs].sData.ui32FWAddr = psPVRPt->psSyncData->psSyncKernel->ui32SyncPrimVAddr;
aPts[*pui32NumSyncs].sData.ui32FenceValue = psPVRPt->psSyncData->ui32FenceValue;
aPts[*pui32NumSyncs].sData.ui32UpdateValue = psPVRPt->psSyncData->ui32FenceValue;
}
++*pui32NumSyncs;
}
err_put:
sync_fence_put(psFence);
return eError;
}
/* ioctl and fops handling */
static int PVRSyncOpen(struct inode *inode, struct file *file)
{
IMG_CHAR task_comm[TASK_COMM_LEN + 1];
struct PVR_SYNC_TIMELINE *psPVRTl;
int err = -ENOMEM;
get_task_comm(task_comm, current);
psPVRTl = (struct PVR_SYNC_TIMELINE *)
sync_timeline_create(&gsPVR_SYNC_TIMELINE_ops,
sizeof(struct PVR_SYNC_TIMELINE), task_comm);
if (!psPVRTl)
{
PVR_DPF((PVR_DBG_ERROR, "%s: sync_timeline_create failed", __func__));
goto err_out;
}
psPVRTl->ui32Id = atomic_inc_return(&gsPVRSync.sTimelineId);
atomic_set(&psPVRTl->sValue, 0);
DPF("%s: # %s", __func__,
_debugInfoTl((struct sync_timeline*)psPVRTl));
mutex_lock(&gTlListLock);
list_add_tail(&psPVRTl->sTlList, &gTlList);
mutex_unlock(&gTlListLock);
file->private_data = psPVRTl;
err = 0;
err_out:
return err;
}
static int PVRSyncRelease(struct inode *inode, struct file *file)
{
struct PVR_SYNC_TIMELINE *psPVRTl = file->private_data;
DPF("%s: # %s", __func__,
_debugInfoTl((struct sync_timeline*)psPVRTl));
sync_timeline_destroy(&psPVRTl->obj);
return 0;
}
static long
PVRSyncIOCTLCreateFence(struct PVR_SYNC_TIMELINE *psPVRTl, void __user *pvData)
{
struct PVR_SYNC_CREATE_FENCE_IOCTL_DATA sData;
int err = -EFAULT, iFd = get_unused_fd();
struct sync_fence *psFence;
struct sync_pt *psPt;
if (iFd < 0)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to find unused fd (%d)",
__func__, iFd));
goto err_out;
}
if (!access_ok(VERIFY_READ, pvData, sizeof(sData)))
{
goto err_put_fd;
}
if (copy_from_user(&sData, pvData, sizeof(sData)))
{
goto err_put_fd;
}
psPt = (struct sync_pt *)
PVRSyncCreateSync(psPVRTl);
if (!psPt)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to create a sync point (%d)",
__func__, iFd));
err = -ENOMEM;
goto err_put_fd;
}
sData.szName[sizeof(sData.szName) - 1] = '\0';
DPF("%s: %d('%s') # %s", __func__,
iFd, sData.szName,
_debugInfoTl((struct sync_timeline*)psPVRTl));
psFence = sync_fence_create(sData.szName, psPt);
if (!psFence)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to create a fence (%d)",
__func__, iFd));
err = -ENOMEM;
goto err_sync_free;
}
sData.iFenceFd = iFd;
if (!access_ok(VERIFY_WRITE, pvData, sizeof(sData)))
{
goto err_put_fence;
}
if (copy_to_user(pvData, &sData, sizeof(sData)))
{
goto err_put_fence;
}
sync_fence_install(psFence, iFd);
err = 0;
err_out:
return err;
err_put_fence:
sync_fence_put(psFence);
err_sync_free:
sync_pt_free(psPt);
err_put_fd:
put_unused_fd(iFd);
goto err_out;
}
static long
PVRSyncIOCTLDebugFence(struct PVR_SYNC_TIMELINE *psPVRTl, void __user *pvData)
{
struct PVR_SYNC_DEBUG_FENCE_IOCTL_DATA sData;
PVRSRV_ERROR eError;
int err = -EFAULT;
if (!access_ok(VERIFY_READ, pvData, sizeof(sData)))
{
goto err_out;
}
if (copy_from_user(&sData, pvData, sizeof(sData)))
{
goto err_out;
}
eError = PVRSyncDebugFenceKM(sData.iFenceFd,
sData.szName,
&sData.i32Status,
PVR_SYNC_MAX_QUERY_FENCE_POINTS,
&sData.ui32NumSyncs,
sData.aPts);
if (eError != PVRSRV_OK)
{
goto err_out;
}
if (!access_ok(VERIFY_WRITE, pvData, sizeof(sData)))
{
goto err_out;
}
if (copy_to_user(pvData, &sData, sizeof(sData)))
{
goto err_out;
}
err = 0;
err_out:
return err;
return 0;
}
static long
PVRSyncIOCTL(struct file *file, unsigned int cmd, unsigned long __user arg)
{
struct PVR_SYNC_TIMELINE *psPVRTl = file->private_data;
void __user *pvData = (void __user *)arg;
long err = -ENOTTY;
OSAcquireBridgeLock();
switch (cmd)
{
case PVR_SYNC_IOC_CREATE_FENCE:
err = PVRSyncIOCTLCreateFence(psPVRTl, pvData);
break;
case PVR_SYNC_IOC_DEBUG_FENCE:
err = PVRSyncIOCTLDebugFence(psPVRTl, pvData);
break;
default:
break;
}
OSReleaseBridgeLock();
return err;
}
static void
PVRSyncWorkQueueFunction(struct work_struct *data)
{
struct list_head sFreeList, *psEntry, *n;
unsigned long flags;
PVRSRV_ERROR eError;
/* A completed SW operation may un-block the GPU */
PVRSRVCheckStatus(IMG_NULL);
/* We can't call PVRSRVServerSyncFreeKM directly in this loop because
* that will take the mmap mutex. We can't take mutexes while we have
* this list locked with a spinlock. So move all the items we want to
* free to another, local list (no locking required) and process it
* in a second loop.
*/
OSAcquireBridgeLock();
INIT_LIST_HEAD(&sFreeList);
spin_lock_irqsave(&gSyncPrimFreeListLock, flags);
list_for_each_safe(psEntry, n, &gSyncPrimFreeList)
{
struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel =
container_of(psEntry, struct PVR_SYNC_KERNEL_SYNC_PRIM, sHead);
/* Check if this sync is not used anymore. */
if ( !ServerSyncFenceIsMeet(psSyncKernel->psSync, psSyncKernel->ui32SyncValue)
|| (psSyncKernel->psCleanUpSync && !ServerSyncFenceIsMeet(psSyncKernel->psCleanUpSync, psSyncKernel->ui32CleanUpValue)))
continue;
/* Remove the entry from the free list. */
list_move_tail(psEntry, &sFreeList);
}
spin_unlock_irqrestore(&gSyncPrimFreeListLock, flags);
list_for_each_safe(psEntry, n, &sFreeList)
{
struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel =
container_of(psEntry, struct PVR_SYNC_KERNEL_SYNC_PRIM, sHead);
list_del(psEntry);
eError = PVRSRVServerSyncFreeKM(psSyncKernel->psSync);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to free prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
/* Fall-thru */
}
if (psSyncKernel->psCleanUpSync)
{
eError = PVRSRVServerSyncFreeKM(psSyncKernel->psCleanUpSync);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to free cleanup prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
/* Fall-thru */
}
}
OSFreeMem(psSyncKernel);
}
OSReleaseBridgeLock();
}
static const struct file_operations gsPVRSyncFOps =
{
.owner = THIS_MODULE,
.open = PVRSyncOpen,
.release = PVRSyncRelease,
.unlocked_ioctl = PVRSyncIOCTL,
};
static struct miscdevice sPVRSyncDev =
{
.minor = MISC_DYNAMIC_MINOR,
.name = PVRSYNC_MODNAME,
.fops = &gsPVRSyncFOps,
};
static int PVRSyncDebugfsShow(struct seq_file *s, void *unused)
{
/* struct list_head *pos;*/
seq_printf(s, "Timelines:\n----------\n");
#ifdef DEBUG_OUTPUT
PVRSRVDebugPrintfDumpCCB();
#endif
//mutex_lock(&gTimelineListLock);
//list_for_each(pos, &gTimelineList)
//{
// unsigned long flags;
// struct list_head *activePoint;
// struct sync_timeline *psTimeline = (struct sync_timeline*)
// container_of(pos, struct PVR_SYNC_TIMELINE, sTimelineList);
// seq_printf(s, "%s :", psTimeline->name);
// PVRSyncPrintTimeline(s, psTimeline);
// seq_printf(s, "\n ");
// spin_lock_irqsave(&psTimeline->active_list_lock, flags);
// list_for_each(activePoint, &psTimeline->active_list_head)
// {
// struct sync_pt *psPt =
// container_of(activePoint, struct sync_pt, active_list);
// PVRSyncPrint(s, psPt);
// seq_printf(s, "\n ");
// }
// spin_unlock_irqrestore(&psTimeline->active_list_lock, flags);
// seq_printf(s, "\n");
//}
//mutex_unlock(&gTimelineListLock);
return 0;
}
static int PVRSyncDebugfsOpen(struct inode *inode, struct file *file)
{
return single_open(file, PVRSyncDebugfsShow, inode->i_private);
}
static const struct file_operations gsDebugfsFOps =
{
.open = PVRSyncDebugfsOpen,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release
};
static
IMG_VOID PVRSyncUpdateAllTimelines(PVRSRV_CMDCOMP_HANDLE hCmdCompHandle)
{
IMG_BOOL bSignal;
LIST_HEAD(sTlToSignalList);
struct PVR_SYNC_TL_TO_SIGNAL *psTlToSignal;
struct PVR_SYNC_TIMELINE *psPVRTl;
struct list_head *psTlEntry, *psPtEntry, *n;
unsigned long flags;
PVR_UNREFERENCED_PARAMETER(hCmdCompHandle);
mutex_lock(&gTlListLock);
list_for_each(psTlEntry, &gTlList)
{
bSignal = IMG_FALSE;
psPVRTl =
container_of(psTlEntry, struct PVR_SYNC_TIMELINE, sTlList);
spin_lock_irqsave(&psPVRTl->obj.active_list_lock, flags);
list_for_each(psPtEntry, &psPVRTl->obj.active_list_head)
{
struct sync_pt *psPt =
container_of(psPtEntry, struct sync_pt, active_list);
if(psPt->parent->ops != &gsPVR_SYNC_TIMELINE_ops)
continue;
DPF("%s: check # %s", __func__,
_debugInfoPt(psPt));
/* Check for any points which weren't signaled before, but are now.
* If so, mark it for signaling and stop processing this timeline. */
if ( ((struct PVR_SYNC_PT *)psPt)->bSignaled == IMG_FALSE
&& PVRSyncHasSignaled(psPt))
{
DPF("%s: signal # %s", __func__,
_debugInfoPt(psPt));
/* Create a new entry for the list of timelines which needs to
* be signaled. There are two reasons for not doing it right
* now: It is not possible to signal the timeline while holding
* the spinlock or the mutex. PVRSyncReleaseTimeline may be
* called by timeline_signal which will acquire the mutex as
* well and the spinlock itself is also used within
* timeline_signal. */
bSignal = IMG_TRUE;
break;
}
}
spin_unlock_irqrestore(&psPVRTl->obj.active_list_lock, flags);
if (bSignal)
{
psTlToSignal = OSAllocMem(sizeof(struct PVR_SYNC_TL_TO_SIGNAL));
if (!psTlToSignal)
break;
psTlToSignal->psPVRTl = psPVRTl;
list_add_tail(&psTlToSignal->sList, &sTlToSignalList);
}
}
mutex_unlock(&gTlListLock);
/* It is safe to call timeline_signal at this point without holding the
* timeline mutex. We know the timeline can't go away until we have called
* timeline_signal cause the current active point still holds a kref to the
* parent. However, when timeline_signal returns the actual timeline
* structure may be invalid. */
list_for_each_safe(psTlEntry, n, &sTlToSignalList)
{
psTlToSignal =
container_of(psTlEntry, struct PVR_SYNC_TL_TO_SIGNAL, sList);
sync_timeline_signal((struct sync_timeline *)psTlToSignal->psPVRTl);
list_del(psTlEntry);
OSFreeMem(psTlToSignal);
}
}
IMG_INTERNAL
PVRSRV_ERROR PVRFDSyncDeviceInitKM(void)
{
PVRSRV_ERROR eError;
int err;
DPF("%s", __func__);
OSAcquireBridgeLock();
/*
note: if/when we support multiple concurrent devices, multiple GPUs or GPU plus
other services managed devices then we need to acquire more devices
*/
eError = PVRSRVAcquireDeviceDataKM(0, PVRSRV_DEVICE_TYPE_RGX, &gsPVRSync.hDevCookie);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to initialise services (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_out;
}
eError = PVRSRVRegisterCmdCompleteNotify(&gsPVRSync.hCmdCompHandle,
&PVRSyncUpdateAllTimelines,
&gsPVRSync.hDevCookie);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to register MISR notification (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_out;
}
gsPVRSync.psWorkQueue = create_freezable_workqueue("pvr_sync_workqueue");
if (!gsPVRSync.psWorkQueue)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to create pvr_sync workqueue",
__func__));
goto err_out;
}
INIT_WORK(&gsPVRSync.sWork, PVRSyncWorkQueueFunction);
err = misc_register(&sPVRSyncDev);
if (err)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to register pvr_sync device "
"(%d)", __func__, err));
eError = PVRSRV_ERROR_RESOURCE_UNAVAILABLE;
goto err_out;
}
eError = PVRSRVServerSyncRequesterRegisterKM(&gsPVRSync.ui32SyncRequesterId);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to register sync requester "
"(%d)", __func__, err));
goto err_out;
}
atomic_set(&gsPVRSync.sTimelineId, 0);
/* Optional */
gpsDebugfsDentry =
debugfs_create_file("pvr_sync", S_IRUGO, NULL, NULL, &gsDebugfsFOps);
if(!gpsDebugfsDentry)
{
PVR_DPF((PVR_DBG_WARNING, "%s: Failed to create pvr_sync debugfs "
"entry", __func__));
/* Fall-thru */
}
err_out:
OSReleaseBridgeLock();
return eError;
}
IMG_INTERNAL
void PVRFDSyncDeviceDeInitKM(void)
{
DPF("%s", __func__);
OSAcquireBridgeLock();
PVRSRVServerSyncRequesterUnregisterKM(gsPVRSync.ui32SyncRequesterId);
PVRSRVUnregisterCmdCompleteNotify(gsPVRSync.hCmdCompHandle);
destroy_workqueue(gsPVRSync.psWorkQueue);
if(gpsDebugfsDentry)
debugfs_remove(gpsDebugfsDentry);
misc_deregister(&sPVRSyncDev);
OSReleaseBridgeLock();
}
static
PVRSRV_ERROR PVRFDSyncQueryFenceKM(IMG_INT32 i32FDFence,
IMG_BOOL bUpdate,
IMG_UINT32 ui32MaxNumSyncs,
IMG_UINT32 *pui32NumSyncs,
PVR_SYNC_POINT_DATA *aPts)
{
struct list_head *psEntry;
struct sync_fence *psFence = sync_fence_fdget(i32FDFence);
struct PVR_SYNC_TIMELINE *psPVRTl;
struct PVR_SYNC_PT *psPVRPt = IMG_NULL;
IMG_UINT32 ui32Dummy;
PVRSRV_ERROR eError = PVRSRV_OK;
IMG_BOOL bHaveForeignSync = IMG_FALSE;
DPF("%s: fence %d ('%s')",
__func__,
i32FDFence, psFence->name);
if (!psFence)
return PVRSRV_ERROR_HANDLE_NOT_FOUND;
*pui32NumSyncs = 0;
/* Optimization: If the fence itself or a single sync point is
* already signaled, then don't return the entry. It makes no real sense to
* send CHECK commands down to the firmware when we already know they are
* fulfilled. */
list_for_each(psEntry, &psFence->pt_list_head)
{
struct sync_pt *psPt =
container_of(psEntry, struct sync_pt, pt_list);
if (*pui32NumSyncs == ui32MaxNumSyncs)
{
PVR_DPF((PVR_DBG_WARNING, "%s: To less space on fence query for all "
"the sync points in this fence", __func__));
goto err_put;
}
if(psPt->parent->ops != &gsPVR_SYNC_TIMELINE_ops)
{
/* If there are foreign sync points in this fence we will add a
* shadow sync prim for them. */
bHaveForeignSync = IMG_TRUE;
}
else
{
psPVRTl = (struct PVR_SYNC_TIMELINE *)psPt->parent;
psPVRPt = (struct PVR_SYNC_PT *)psPt;
DPF("%s: %d # %s", __func__,
*pui32NumSyncs,
_debugInfoPt(psPt));
#if 0
/* Actually the following can happen. E.g. when the CCB is full
* (happens with PDUMP=1) a KickTA3D could return RETRY even when
* PVRFDSyncQueryFenceKM was called already before. In this case
* the sync prim wasn't put onto the FW for update, so its allowed
* to be here again. I keep this for now, so we can turn on this
* check for debugging other scenarios. */
if ( bUpdate
&& psPVRPt->bUpdated)
{
PVR_DPF((PVR_DBG_ERROR, "%s: sync point used for update more than once!",
__func__));
}
#endif
/* If this is an request for CHECK and the sync point is already
* signalled, don't return it to the caller. The operation is
* already fulfilled in this case and needs no waiting on. */
if ( !bUpdate
&& psPVRPt->bSignaled)
continue;
/* Save this within the sync point. */
aPts[*pui32NumSyncs].ui32FWAddr = psPVRPt->psSyncData->psSyncKernel->ui32SyncPrimVAddr;
aPts[*pui32NumSyncs].ui32Flags = (bUpdate ? PVRSRV_CLIENT_SYNC_PRIM_OP_UPDATE :
PVRSRV_CLIENT_SYNC_PRIM_OP_CHECK);
aPts[*pui32NumSyncs].ui32FenceValue = psPVRPt->psSyncData->psSyncKernel->ui32SyncValue;
aPts[*pui32NumSyncs].ui32UpdateValue = psPVRPt->psSyncData->psSyncKernel->ui32SyncValue;
++*pui32NumSyncs;
/* We will use the above sync for "check" only. In this case also
* insert a "cleanup" update command into the opengl stream. This
* can later be used for checking if the sync prim could be freed. */
if (!bUpdate)
{
if (*pui32NumSyncs == ui32MaxNumSyncs)
{
PVR_DPF((PVR_DBG_WARNING, "%s: To less space on fence query for all "
"the sync points in this fence", __func__));
goto err_put;
}
/* We returning for "check" only. Create the clean up sync on
* demand and queue an update operation. */
if (!psPVRPt->psSyncData->psSyncKernel->psCleanUpSync)
{
IMG_UINT32 ui32FWAddr, ui32CurrOp, ui32NextOp;
eError = PVRSRVServerSyncAllocKM(gsPVRSync.hDevCookie,
&psPVRPt->psSyncData->psSyncKernel->psCleanUpSync,
&psPVRPt->psSyncData->psSyncKernel->ui32CleanUpVAddr);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to allocate cleanup prim server sync (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_put;
}
eError = PVRSRVServerSyncGetStatusKM(1, &psPVRPt->psSyncData->psSyncKernel->psCleanUpSync,
&psPVRPt->psSyncData->psSyncKernel->ui32CleanUpId,
&ui32FWAddr,
&ui32CurrOp, &ui32NextOp);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to get status of cleanup prim server "
"sync (%s)", __func__, PVRSRVGetErrorStringKM(eError)));
goto err_put;
}
}
eError = PVRSRVServerSyncQueueHWOpKM(psPVRPt->psSyncData->psSyncKernel->psCleanUpSync,
IMG_TRUE,
&ui32Dummy,
&psPVRPt->psSyncData->psSyncKernel->ui32CleanUpValue);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to queue cleanup prim server sync hw operation (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
goto err_put;
}
/* Save this within the sync point. */
aPts[*pui32NumSyncs].ui32FWAddr = psPVRPt->psSyncData->psSyncKernel->ui32CleanUpVAddr;
aPts[*pui32NumSyncs].ui32Flags = PVRSRV_CLIENT_SYNC_PRIM_OP_UPDATE;
aPts[*pui32NumSyncs].ui32FenceValue = psPVRPt->psSyncData->psSyncKernel->ui32CleanUpValue;
aPts[*pui32NumSyncs].ui32UpdateValue = psPVRPt->psSyncData->psSyncKernel->ui32CleanUpValue;
++*pui32NumSyncs;
}
if (bUpdate)
psPVRPt->bUpdated = IMG_TRUE;
}
}
/* Add one shadow sync prim for "all" foreign sync points. We are only
* interested in a signaled fence not individual signaled sync points. */
if (bHaveForeignSync)
{
struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel;
/* Create a shadow sync prim for the foreign sync point. */
psSyncKernel = PVRSyncCreateWaiterForForeignSync(i32FDFence);
/* This could be zero when the sync has signaled already. */
if (psSyncKernel)
{
if (*pui32NumSyncs == ui32MaxNumSyncs - 1)
{
PVR_DPF((PVR_DBG_WARNING, "%s: To less space on fence query for all "
"the sync points in this fence", __func__));
goto err_put;
}
aPts[*pui32NumSyncs].ui32FWAddr = psSyncKernel->ui32SyncPrimVAddr;
aPts[*pui32NumSyncs].ui32Flags = PVRSRV_CLIENT_SYNC_PRIM_OP_CHECK;
aPts[*pui32NumSyncs].ui32FenceValue = psSyncKernel->ui32SyncValue;
aPts[*pui32NumSyncs].ui32UpdateValue = psSyncKernel->ui32SyncValue;
++*pui32NumSyncs;
aPts[*pui32NumSyncs].ui32FWAddr = psSyncKernel->ui32CleanUpVAddr;
aPts[*pui32NumSyncs].ui32Flags = PVRSRV_CLIENT_SYNC_PRIM_OP_UPDATE;
aPts[*pui32NumSyncs].ui32FenceValue = psSyncKernel->ui32CleanUpValue;
aPts[*pui32NumSyncs].ui32UpdateValue = psSyncKernel->ui32CleanUpValue;
++*pui32NumSyncs;
}
}
err_put:
sync_fence_put(psFence);
return eError;
}
IMG_INTERNAL
PVRSRV_ERROR PVRFDSyncQueryFencesKM(IMG_UINT32 ui32NumFDFences,
IMG_INT32 *ai32FDFences,
IMG_BOOL bUpdate,
IMG_UINT32 *pui32NumFenceSyncs,
PRGXFWIF_UFO_ADDR **ppuiFenceFWAddrs,
IMG_UINT32 **ppui32FenceValues,
IMG_UINT32 *pui32NumUpdateSyncs,
PRGXFWIF_UFO_ADDR **ppuiUpdateFWAddrs,
IMG_UINT32 **ppui32UpdateValues)
{
PVR_SYNC_POINT_DATA aPts[PVR_SYNC_MAX_QUERY_FENCE_POINTS];
IMG_UINT32 ui32NumSyncs;
PRGXFWIF_UFO_ADDR auiFenceFWAddrsTmp[PVR_SYNC_MAX_QUERY_FENCE_POINTS * ui32NumFDFences];
IMG_UINT32 aui32FenceValuesTmp[PVR_SYNC_MAX_QUERY_FENCE_POINTS * ui32NumFDFences];
PRGXFWIF_UFO_ADDR auiUpdateFWAddrsTmp[PVR_SYNC_MAX_QUERY_FENCE_POINTS * ui32NumFDFences];
IMG_UINT32 aui32UpdateValuesTmp[PVR_SYNC_MAX_QUERY_FENCE_POINTS * ui32NumFDFences];
IMG_UINT32 i, a, f = 0, u = 0;
PVRSRV_ERROR eError = PVRSRV_OK;
*ppuiFenceFWAddrs = IMG_NULL;
*ppui32FenceValues = IMG_NULL;
*ppuiUpdateFWAddrs = IMG_NULL;
*ppui32UpdateValues = IMG_NULL;
*pui32NumFenceSyncs = 0;
*pui32NumUpdateSyncs = 0;
for (i = 0; i < ui32NumFDFences; i++)
{
eError = PVRFDSyncQueryFenceKM(ai32FDFences[i],
bUpdate,
PVR_SYNC_MAX_QUERY_FENCE_POINTS,
&ui32NumSyncs,
aPts);
if (eError != PVRSRV_OK)
{
PVR_DPF((PVR_DBG_ERROR, "%s: query fence %d failed (%s)",
__func__, ai32FDFences[i], PVRSRVGetErrorStringKM(eError)));
goto err_out;
}
for (a = 0; a < ui32NumSyncs; a++)
{
if (aPts[a].ui32Flags & PVRSRV_CLIENT_SYNC_PRIM_OP_CHECK)
{
auiFenceFWAddrsTmp[f].ui32Addr = aPts[a].ui32FWAddr;
aui32FenceValuesTmp[f] = aPts[a].ui32FenceValue;
if (++f == (PVR_SYNC_MAX_QUERY_FENCE_POINTS * ui32NumFDFences))
{
PVR_DPF((PVR_DBG_WARNING, "%s: To less space on fence query for all "
"the sync points in this fence", __func__));
goto err_copy;
}
}
if (aPts[a].ui32Flags & PVRSRV_CLIENT_SYNC_PRIM_OP_UPDATE)
{
auiUpdateFWAddrsTmp[u].ui32Addr = aPts[a].ui32FWAddr;
aui32UpdateValuesTmp[u] = aPts[a].ui32UpdateValue;
if (++u == (PVR_SYNC_MAX_QUERY_FENCE_POINTS * ui32NumFDFences))
{
PVR_DPF((PVR_DBG_WARNING, "%s: To less space on fence query for all "
"the sync points in this fence", __func__));
goto err_copy;
}
}
}
}
err_copy:
if (f)
{
*ppuiFenceFWAddrs = OSAllocMem(sizeof(PRGXFWIF_UFO_ADDR) * f);
if (!*ppuiFenceFWAddrs)
{
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto err_out;
}
*ppui32FenceValues = OSAllocMem(sizeof(IMG_UINT32) * f);
if (!*ppui32FenceValues)
{
OSFreeMem(*ppuiFenceFWAddrs);
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto err_out;
}
OSMemCopy(*ppuiFenceFWAddrs, auiFenceFWAddrsTmp, sizeof(IMG_UINT32) * f);
OSMemCopy(*ppui32FenceValues, aui32FenceValuesTmp, sizeof(IMG_UINT32) * f);
*pui32NumFenceSyncs = f;
}
if (u)
{
*ppuiUpdateFWAddrs = OSAllocMem(sizeof(PRGXFWIF_UFO_ADDR) * u);
if (!*ppuiUpdateFWAddrs)
{
OSFreeMem(*ppuiFenceFWAddrs);
OSFreeMem(*ppui32FenceValues);
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto err_out;
}
*ppui32UpdateValues = OSAllocMem(sizeof(IMG_UINT32) * u);
if (!*ppui32UpdateValues)
{
OSFreeMem(*ppuiFenceFWAddrs);
OSFreeMem(*ppui32FenceValues);
OSFreeMem(*ppuiUpdateFWAddrs);
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto err_out;
}
OSMemCopy(*ppuiUpdateFWAddrs, auiUpdateFWAddrsTmp, sizeof(IMG_UINT32) * u);
OSMemCopy(*ppui32UpdateValues, aui32UpdateValuesTmp, sizeof(IMG_UINT32) * u);
*pui32NumUpdateSyncs = u;
}
err_out:
return eError;
}
IMG_INTERNAL
PVRSRV_ERROR PVRFDSyncNoHwUpdateFenceKM(IMG_INT32 i32FDFence)
{
struct list_head *psEntry;
struct sync_fence *psFence = sync_fence_fdget(i32FDFence);
PVRSRV_ERROR eError = PVRSRV_OK;
if (!psFence)
{
PVR_DPF((PVR_DBG_ERROR, "%s: fence for fd=%d not found",
__func__, i32FDFence));
return PVRSRV_ERROR_HANDLE_NOT_FOUND;
}
list_for_each(psEntry, &psFence->pt_list_head)
{
struct sync_pt *psPt =
container_of(psEntry, struct sync_pt, pt_list);
if (psPt->parent->ops == &gsPVR_SYNC_TIMELINE_ops)
{
struct PVR_SYNC_PT *psPVRPt = (struct PVR_SYNC_PT *)psPt;
struct PVR_SYNC_KERNEL_SYNC_PRIM *psSyncKernel =
psPVRPt->psSyncData->psSyncKernel;
eError = PVRSRVServerSyncPrimSetKM(psSyncKernel->psSync,
psSyncKernel->ui32SyncValue);
if (eError != PVRSRV_OK)
PVR_DPF((PVR_DBG_ERROR, "%s: Failed to update backing sync prim. "
"This might cause lockups (%s)",
__func__, PVRSRVGetErrorStringKM(eError)));
else
sync_timeline_signal(psPt->parent);
}
}
sync_fence_put(psFence);
return eError;
}
| 29.12523 | 123 | 0.712488 |
649d876c9946f56d3b67200ffec5eef836a38341 | 3,117 | h | C | trunk/Bricksmith/Source/LDraw/Renderer/LDrawDisplayList.h | bsupnik/bricksmith | 86326773b82b0c607f53f4c87daba51a83819e89 | [
"BSD-2-Clause"
] | 11 | 2019-08-03T07:01:07.000Z | 2022-01-24T10:24:14.000Z | trunk/Bricksmith/Source/LDraw/Renderer/LDrawDisplayList.h | bsupnik/bricksmith | 86326773b82b0c607f53f4c87daba51a83819e89 | [
"BSD-2-Clause"
] | 14 | 2019-03-02T18:53:05.000Z | 2022-02-15T13:05:57.000Z | trunk/Bricksmith/Source/LDraw/Renderer/LDrawDisplayList.h | undecoded-coder/bricksmith | 105586880f50505782ff0822c3ca483417794283 | [
"BSD-2-Clause"
] | 4 | 2019-02-13T04:42:12.000Z | 2022-01-09T16:29:08.000Z | //
// LDrawDisplayList.h
// Bricksmith
//
// Created by bsupnik on 11/12/12.
// Copyright 2012 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
/*
LDrawDisplayList - THEORY OF OPERATION
This API provides display-list-like capabilities for a GL 2.0 shader/VBO-based renderer.
Our display lists consist of a mesh of lines, quads, and tris, some of which may be textured,
and all of which have normals and colors. The colors are straight RGBA tuples - the color stack
behavior that we get in the shader renderer comes from the higher level code.
Unlike the GL, we can open more than one display list for construction at a time - a
struct LDrawDLBuilder * opaque ptr gives us a context for DL creation. When we close the
builder we get a DL, or null if the DL would have been empty.
SESSIONS
We draw one or more DLs using a drawing 'session', which is also an opaque struct ptr (just
like the rest of the API). The session accumulates requests to draw with given color/transform
texture state and performs optimizations to improve drawing performance. When the session is
destroyed, any 'deferred' drawing takes place.
Besides attempting to use hw instancing, the session will also draw translucent DLs last in
back-to-front order to improve transparency performance.
FEATURES
The DL API will draw translucent geomtry back-to-front ordered (the DLs are reordered, not the
geometry in the DLs). The API dynamically detects translucency from passed in colors, including
meta-colors (Meta colors are assumed to have alpha=0.0f).
The API will draw non-textured, non-translucent geometry via instancing, either
attribute-instancing for small count or hardware instancing with attrib-array-divisor for large
numbers of bricks.
*/
// Forwrd declared from basic renderer API.
struct LDrawTextureSpec;
// Opaque structures we use as "handles".
struct LDrawDL;
struct LDrawDLBuilder;
struct LDrawDLSession;
// Display list creation API.
struct LDrawDLBuilder * LDrawDLBuilderCreate();
struct LDrawDL * LDrawDLBuilderFinish(struct LDrawDLBuilder * ctx);
void LDrawDLDestroy(struct LDrawDL * dl);
// Display list mesh accumulation APIs.
void LDrawDLBuilderSetTex(struct LDrawDLBuilder * ctx, struct LDrawTextureSpec * spec);
void LDrawDLBuilderAddTri(struct LDrawDLBuilder * ctx, const GLfloat v[9], GLfloat n[3], GLfloat c[4]);
void LDrawDLBuilderAddQuad(struct LDrawDLBuilder * ctx, const GLfloat v[12], GLfloat n[3], GLfloat c[4]);
void LDrawDLBuilderAddLine(struct LDrawDLBuilder * ctx, const GLfloat v[6], GLfloat n[3], GLfloat c[4]);
// Session/drawing APIs
struct LDrawDLSession * LDrawDLSessionCreate(const GLfloat model_view[16]);
void LDrawDLSessionDrawAndDestroy(struct LDrawDLSession * session);
void LDrawDLDraw(
struct LDrawDLSession * session,
struct LDrawDL * dl,
struct LDrawTextureSpec * spec,
const GLfloat cur_color[4],
const GLfloat cmp_color[4],
const GLfloat transform[16],
int draw_now);
| 40.480519 | 110 | 0.74238 |
645371c3156fd75b48f77a8e795929401f932562 | 1,657 | h | C | smtk/bridge/discrete/operation/vtkCMBParserV4.h | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | null | null | null | smtk/bridge/discrete/operation/vtkCMBParserV4.h | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | 4 | 2016-11-10T15:49:51.000Z | 2017-02-06T23:24:16.000Z | smtk/bridge/discrete/operation/vtkCMBParserV4.h | yumin/SMTK | d280f10c5b70953b2a0196f71832955c7fc75e7f | [
"BSD-3-Clause-Clear"
] | null | null | null | //=========================================================================
// Copyright (c) Kitware, Inc.
// All rights reserved.
// See LICENSE.txt for details.
//
// This software is distributed WITHOUT ANY WARRANTY; without even
// the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
// PURPOSE. See the above copyright notice for more information.
//=========================================================================
// .NAME vtkCMBParserV4 - Parse a vtkPolyData that was read in from a CMB version 1 file.
// .SECTION Description
// Parse a vtkPolyData that was read in from a CMB version 3 file.
#ifndef __smtkdiscrete_vtkCMBParserV4_h
#define __smtkdiscrete_vtkCMBParserV4_h
#include "smtk/bridge/discrete/Exports.h" // For export macro
#include "vtkCMBParserBase.h"
#include <vector>
class vtkDiscreteModel;
class vtkModelEntity;
class vtkPolyData;
class SMTKDISCRETESESSION_EXPORT vtkCMBParserV4 : public vtkCMBParserBase
{
public:
static vtkCMBParserV4* New();
vtkTypeMacro(vtkCMBParserV4,vtkCMBParserBase);
void PrintSelf(ostream& os, vtkIndent indent);
virtual bool Parse(vtkPolyData* MasterPoly, vtkDiscreteModel* Model,
smtk::bridge::discrete::Session* session);
protected:
vtkCMBParserV4();
virtual ~vtkCMBParserV4();
// Description:
// Set the unique persistent Id,
void SetModelEntityData(
vtkPolyData* Poly, std::vector<vtkModelEntity*> & ModelEntities,
const char* BaseArrayName, vtkDiscreteModel* Model);
private:
vtkCMBParserV4(const vtkCMBParserV4&); // Not implemented.
void operator=(const vtkCMBParserV4&); // Not implemented.
};
#endif
| 31.264151 | 89 | 0.68618 |
d99e279c83b69c599b656dc3a429e357b64f9ad6 | 2,242 | h | C | xapian/xapian-core-1.2.13/backends/flint/flint_databasereplicator.h | NeoYY/tailbench-v0.9 | cf9849c3e8c407199f25b4710c06fb8c4e2ff025 | [
"MIT"
] | 2 | 2021-01-13T21:17:42.000Z | 2021-01-13T21:17:42.000Z | xapian/xapian-core-1.2.13/backends/flint/flint_databasereplicator.h | Loslove55/tailbench | fbbf3f31e3f0af1bb7db7f07c2e7193b84abb1eb | [
"MIT"
] | null | null | null | xapian/xapian-core-1.2.13/backends/flint/flint_databasereplicator.h | Loslove55/tailbench | fbbf3f31e3f0af1bb7db7f07c2e7193b84abb1eb | [
"MIT"
] | null | null | null | /** @file flint_databasereplicator.h
* @brief Support for flint database replication
*/
/* Copyright 2008 Lemur Consulting Ltd
* Copyright 2010 Richard Boulton
* Copyright 2010 Olly Betts
*
* 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 (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
* USA
*/
#ifndef XAPIAN_INCLUDED_FLINT_DATABASEREPLICATOR_H
#define XAPIAN_INCLUDED_FLINT_DATABASEREPLICATOR_H
#include "databasereplicator.h"
class FlintDatabaseReplicator : public Xapian::DatabaseReplicator {
private:
/** Path of database.
*/
std::string db_dir;
/** The maximum number of changesets which should be kept in the
* database. */
unsigned int max_changesets;
/** Process a chunk which holds a base block.
*/
void process_changeset_chunk_base(const std::string & tablename,
std::string & buf,
RemoteConnection & conn,
double end_time,
int changes_fd) const;
/** Process a chunk which holds a list of changed blocks in the
* database.
*/
void process_changeset_chunk_blocks(const std::string & tablename,
std::string & buf,
RemoteConnection & conn,
double end_time,
int changes_fd) const;
public:
FlintDatabaseReplicator(const std::string & db_dir_);
/** Virtual methods of DatabaseReplicator. */
//@{
bool check_revision_at_least(const std::string & rev,
const std::string & target) const;
std::string apply_changeset_from_conn(RemoteConnection & conn,
double end_time,
bool valid) const;
std::string get_uuid() const;
//@}
};
#endif /* XAPIAN_INCLUDED_FLINT_DATABASEREPLICATOR_H */
| 31.577465 | 72 | 0.722123 |
fcdbd79145938b062c71d32f8138d294273b7d8f | 15,920 | h | C | modulemd/include/modulemd-1.0/modulemd-defaults.h | lubomir/libmodulemd | 8aaba79aaf72caa7045ee0252f1375798276527f | [
"MIT"
] | null | null | null | modulemd/include/modulemd-1.0/modulemd-defaults.h | lubomir/libmodulemd | 8aaba79aaf72caa7045ee0252f1375798276527f | [
"MIT"
] | null | null | null | modulemd/include/modulemd-1.0/modulemd-defaults.h | lubomir/libmodulemd | 8aaba79aaf72caa7045ee0252f1375798276527f | [
"MIT"
] | null | null | null | /*
* This file is part of libmodulemd
* Copyright (C) 2017-2018 Stephen Gallagher
*
* Fedora-License-Identifier: MIT
* SPDX-2.0-License-Identifier: MIT
* SPDX-3.0-License-Identifier: MIT
*
* This program is free software.
* For more information on the license, see COPYING.
* For more information on free software, see <https://www.gnu.org/philosophy/free-sw.en.html>.
*/
#ifndef MODULEMD_DEFAULTS_H
#define MODULEMD_DEFAULTS_H
#include <stdio.h>
#include "modulemd-intent.h"
#include "modulemd-simpleset.h"
#include <glib-object.h>
enum
{
MD_DEFAULTS_VERSION_UNSET = 0,
MD_DEFAULTS_VERSION_1 = 1,
MD_DEFAULTS_VERSION_MAX = G_MAXUINT64
};
#define MD_DEFAULTS_VERSION_LATEST MD_DEFAULTS_VERSION_1
G_BEGIN_DECLS
/**
* SECTION: modulemd-defaults
* @title: Modulemd.Defaults
* @short_description: Represents the default stream, profiles and other global
* data for a module.
*/
#define MODULEMD_DEFAULTS_ERROR modulemd_defaults_error_quark ()
GQuark
modulemd_defaults_error_quark (void);
enum ModulemdDefaultsError
{
MODULEMD_DEFAULTS_ERROR_MISSING_CONTENT,
MODULEMD_DEFAULTS_ERROR_CONFLICTING_STREAMS,
MODULEMD_DEFAULTS_ERROR_CONFLICTING_PROFILES,
MODULEMD_DEFAULTS_ERROR_CONFLICTING_INTENT_STREAM,
MODULEMD_DEFAULTS_ERROR_CONFLICTING_INTENT_PROFILE
};
#define MODULEMD_TYPE_DEFAULTS (modulemd_defaults_get_type ())
G_DECLARE_FINAL_TYPE (
ModulemdDefaults, modulemd_defaults, MODULEMD, DEFAULTS, GObject)
/**
* modulemd_defaults_new:
*
* Returns: (transfer full): A newly-allocated #ModulemdDefaults object. This
* must be freed with g_object_unref().
*
* Since: 1.1
*/
ModulemdDefaults *
modulemd_defaults_new (void);
/**
* modulemd_defaults_set_version:
* @version: The metadata file format version
*
* Sets the version of the metadata in use.
*
* Since: 1.1
*/
void
modulemd_defaults_set_version (ModulemdDefaults *self, guint64 version);
/**
* modulemd_defaults_peek_version:
*
* Retrieves the metadata file format version.
*
* Returns: a 64-bit unsigned integer containing the file format version.
*
* Since: 1.1
*/
guint64
modulemd_defaults_peek_version (ModulemdDefaults *self);
/**
* modulemd_defaults_set_module_name:
* @name: The module name to which these defaults apply
*
* Sets the "module-name" property.
*
* Since: 1.1
*/
void
modulemd_defaults_set_module_name (ModulemdDefaults *self, const gchar *name);
/**
* modulemd_defaults_peek_module_name:
*
* Retrieves the module name to which these defaults apply.
*
* Returns: a string containing the "module-name" property. This string must
* not be modified or freed. If you need to do so, use
* modulemd_defaults_dup_module_name() instead.
*
* Since: 1.1
*/
const gchar *
modulemd_defaults_peek_module_name (ModulemdDefaults *self);
/**
* modulemd_defaults_dup_module_name:
*
* Retrieves the module name to which these defaults apply.
*
* Returns: a string containing the "module-name" property. This string must be
* freed with g_free() when the caller is done with it.
*
* Since: 1.1
*/
gchar *
modulemd_defaults_dup_module_name (ModulemdDefaults *self);
/**
* modulemd_defaults_set_default_stream:
* @stream: The default stream for this module
*
* Sets the "default-stream" property.
*
* Since: 1.1
*/
void
modulemd_defaults_set_default_stream (ModulemdDefaults *self,
const gchar *stream);
/**
* modulemd_defaults_peek_default_stream:
*
* Retrieves the default stream.
*
* Returns: a string containing the "default-stream" property. This string
* must not be modified or freed. If you need to do so, use
* modulemd_defaults_dup_default_stream() instead.
*
* Since: 1.1
*/
const gchar *
modulemd_defaults_peek_default_stream (ModulemdDefaults *self);
/**
* modulemd_defaults_dup_default_stream:
*
* Retrieves the default stream.
*
* Returns: a string containing the "default-stream" property. This string must
* be freed with g_free() when the caller is done with it.
*
* Since: 1.1
*/
gchar *
modulemd_defaults_dup_default_stream (ModulemdDefaults *self);
/**
* modulemd_defaults_set_profiles_for_stream:
* @stream: The name of the stream getting default profiles
* @profiles: (array zero-terminated=1) (transfer none): The set of profile
* names to install by default when installing this stream of the module.
*
* Since: 1.1
*/
void
modulemd_defaults_set_profiles_for_stream (ModulemdDefaults *self,
const gchar *stream,
gchar **profiles);
/**
* modulemd_defaults_assign_profiles_for_stream:
* @stream: The name of the stream getting default profiles
* @profiles: A #ModulemdSimpleSet of profile names to install by default when
* installing this stream of the module.
*
* Since: 1.1
*/
void
modulemd_defaults_assign_profiles_for_stream (ModulemdDefaults *self,
const gchar *stream,
ModulemdSimpleSet *profiles);
/**
* modulemd_defaults_set_profile_defaults:
* @profile_defaults: (nullable) (element-type utf8 ModulemdSimpleSet) (transfer none):
*
* Assigns the hash table of streams and their default profiles
*
* Since: 1.1
*/
void
modulemd_defaults_set_profile_defaults (ModulemdDefaults *self,
GHashTable *profile_defaults);
/**
* modulemd_defaults_dup_profiles_for_stream:
* @stream: The name of the stream from which to retrieve defaults
*
* Returns: (array zero-terminated=1) (transfer full): A zero-terminated array
* of strings that provides the list of profiles that should be installed by
* default when this stream is specified.
*
* Since: 1.1
*/
gchar **
modulemd_defaults_dup_profiles_for_stream (ModulemdDefaults *self,
const gchar *stream);
/**
* modulemd_defaults_peek_profile_defaults:
*
* Retrieves a hash table of the profile defaults.
*
* Returns: (element-type utf8 ModulemdSimpleSet) (transfer none): A GHashTable
* containing the set of profile defaults for streams of this module. This hash
* table is maintained by the ModulemdDefaults object and must not be freed or
* modified. If modification is necessary, use
* modulemd_defaults_dup_profile_defaults() instead.
*
* Since: 1.1
*/
GHashTable *
modulemd_defaults_peek_profile_defaults (ModulemdDefaults *self);
/**
* modulemd_defaults_dup_profile_defaults:
*
* Retrieves a copy of the hash table of profile defaults.
*
* Returns: (element-type utf8 ModulemdSimpleSet) (transfer container): A
* GHashTable containing the set of profile defaults for streams of this
* module. This hash table is a copy and must be freed with
* g_hash_table_unref() when the caller is finished with it. The elements it
* contains are maintained by the hash table and will be automatically freed
* when their key is removed or the hash table is freed.
*
* Since: 1.1
*/
GHashTable *
modulemd_defaults_dup_profile_defaults (ModulemdDefaults *self);
/**
* modulemd_defaults_add_intent:
* @intent: (transfer none) (not nullable): The #ModulemdIntent to add to the
* intents table.
*
* Adds an intent object to the hash table.
*
* Since: 1.5
*/
void
modulemd_defaults_add_intent (ModulemdDefaults *self, ModulemdIntent *intent);
/**
* modulemd_defaults_set_intents:
* @intents: (element-type utf8 ModulemdIntent) (nullable) (transfer none):
* A #GHashTable containing defaults for individual system intents.
*
* Since: 1.5
*/
void
modulemd_defaults_set_intents (ModulemdDefaults *self, GHashTable *intents);
/**
* modulemd_defaults_peek_intents:
*
* Get a pointer to the intents hash table. The returned table is managed by the
* #ModulemdDefaults object and must not be modified or freed.
*
* Returns: (element-type utf8 ModulemdIntent) (transfer none): A pointer to the
* intents hash table.
*
* Since: 1.5
*/
GHashTable *
modulemd_defaults_peek_intents (ModulemdDefaults *self);
/**
* modulemd_defaults_dup_intents:
*
* Get a copy of the intents hash table. The returned table is managed by the
* caller and must be freed with g_hash_table_unref()
*
* Returns: (element-type utf8 ModulemdIntent) (transfer container): A copy of
* the intents hash table.
*
* Since: 1.5
*/
GHashTable *
modulemd_defaults_dup_intents (ModulemdDefaults *self);
/**
* modulemd_defaults_new_from_file:
* @yaml_file: A YAML file containing the module metadata and other related
* information such as default streams.
* @error: (out): A #GError containing additional information if this function
* fails.
*
* Constructs a new #ModulemdDefaults object from the first valid
* modulemd-defaults document in the given module stream. This will ignore any
* documents of other types, malformed documents and defaults that appear later
* in the stream.
*
* Returns: A #ModulemdDefaults object constructed the first valid
* modulemd-defaults document in the given module stream. This must be freed
* with g_object_unref() when no longer needed.
*
* Since: 1.2
*/
ModulemdDefaults *
modulemd_defaults_new_from_file (const gchar *yaml_file, GError **error);
/**
* modulemd_defaults_new_from_file_ext:
* @yaml_file: A YAML file containing the module metadata and other related
* information such as default streams.
* @failures: (element-type ModulemdSubdocument) (transfer container) (out):
* An array containing any subdocuments from the YAML file that failed to
* parse. This must be freed with g_ptr_array_unref().
* @error: (out): A #GError containing additional information if this function
* fails.
*
* Constructs a new #ModulemdDefaults object from the first valid
* modulemd-defaults document in the given module stream. This will ignore any
* documents of other types, malformed documents and defaults that appear later
* in the stream.
*
* Returns: A #ModulemdDefaults object constructed the first valid
* modulemd-defaults document in the given module stream. This must be freed
* with g_object_unref() when no longer needed.
*
* Since: 1.4
*/
ModulemdDefaults *
modulemd_defaults_new_from_file_ext (const gchar *yaml_file,
GPtrArray **failures,
GError **error);
/**
* modulemd_defaults_new_from_string:
* @yaml_string: A YAML string containing the module metadata and other related
* information such as default streams.
* @error: (out): A #GError containing additional information if this function
* fails.
*
* Constructs a new #ModulemdDefaults object from the first valid
* modulemd-defaults document in the given module stream. This will ignore any
* documents of other types, malformed documents and defaults that appear later
* in the stream.
*
* Returns: A #ModulemdDefaults object constructed the first valid
* modulemd-defaults document in the given module stream. This must be freed
* with g_object_unref() when no longer needed.
*
* Since: 1.2
*/
ModulemdDefaults *
modulemd_defaults_new_from_string (const gchar *yaml_string, GError **error);
/**
* modulemd_defaults_new_from_string_ext:
* @yaml_string: A YAML string containing the module metadata and other related
* information such as default streams.
* @failures: (element-type ModulemdSubdocument) (transfer container) (out):
* An array containing any subdocuments from the YAML file that failed to
* parse. This must be freed with g_ptr_array_unref().
* @error: (out): A #GError containing additional information if this function
* fails.
*
* Constructs a new #ModulemdDefaults object from the first valid
* modulemd-defaults document in the given module stream. This will ignore any
* documents of other types, malformed documents and defaults that appear later
* in the stream.
*
* Returns: A #ModulemdDefaults object constructed the first valid
* modulemd-defaults document in the given module stream. This must be freed
* with g_object_unref() when no longer needed.
*
* Since: 1.4
*/
ModulemdDefaults *
modulemd_defaults_new_from_string_ext (const gchar *yaml_string,
GPtrArray **failures,
GError **error);
/**
* modulemd_defaults_new_from_stream:
* @stream: A YAML stream containing the module metadata and other related
* information such as default streams.
* @error: (out): A #GError containing additional information if this function
* fails.
*
* Constructs a new #ModulemdDefaults object from the first valid
* modulemd-defaults document in the given module stream. This will ignore any
* documents of other types, malformed documents and defaults that appear later
* in the stream.
*
* Returns: A #ModulemdDefaults object constructed the first valid
* modulemd-defaults document in the given module stream. This must be freed
* with g_object_unref() when no longer needed.
*
* Since: 1.4
*/
ModulemdDefaults *
modulemd_defaults_new_from_stream (FILE *stream, GError **error);
/**
* modulemd_defaults_new_from_stream_ext:
* @stream: A YAML stream containing the module metadata and other related
* information such as default streams.
* @failures: (element-type ModulemdSubdocument) (transfer container) (out):
* An array containing any subdocuments from the YAML file that failed to
* parse. This must be freed with g_ptr_array_unref().
* @error: (out): A #GError containing additional information if this function
* fails.
*
* Constructs a new #ModulemdDefaults object from the first valid
* modulemd-defaults document in the given module stream. This will ignore any
* documents of other types, malformed documents and defaults that appear later
* in the stream.
*
* Returns: A #ModulemdDefaults object constructed the first valid
* modulemd-defaults document in the given module stream. This must be freed
* with g_object_unref() when no longer needed.
*
* Since: 1.4
*/
ModulemdDefaults *
modulemd_defaults_new_from_stream_ext (FILE *stream,
GPtrArray **failures,
GError **error);
/**
* modulemd_defaults_dump:
* @file_path: File path for exporting the YAML representation of this defaults
* object
*
* Exports the YAML representation of this defaults object to a file.
*
* Since: 1.1
*/
void
modulemd_defaults_dump (ModulemdDefaults *self, const gchar *file_path);
/**
* modulemd_defaults_dumps:
* @yaml_string: (out): File path for exporting the YAML representation of this defaults
* object
*
* Exports the YAML representation of this defaults object to a string. The
* caller is responsible for calling g_free() on this string when they are
* finished with it.
*
* Since: 1.1
*/
void
modulemd_defaults_dumps (ModulemdDefaults *self, gchar **yaml_string);
/**
* modulemd_defaults_copy:
* Returns a deep-copy of the defaults object.
*
* Returns: (transfer full): A deep-copied #ModulemdDefaults object. This
* object must be freed with g_object_unref().
*
* Since: 1.3
*/
ModulemdDefaults *
modulemd_defaults_copy (ModulemdDefaults *self);
/**
* modulemd_defaults_merge:
* @first: A #ModulemdDefaults object providing the base for the merge.
* @second: A #ModulemdDefaults object being merged onto @first.
* @override: In the case of a conflict, should @second completely replace the
* contents of @first.
*
* Returns: (transfer full): A merged or replaced #ModulemdDefaults object. In
* case of unresolvable merge, NULL will be returned and an error will be set.
* This object must be freed with g_object_unref().
*
* Since: 1.3
*/
ModulemdDefaults *
modulemd_defaults_merge (ModulemdDefaults *first,
ModulemdDefaults *second,
gboolean override,
GError **error);
G_END_DECLS
#endif /* MODULEMD_DEFAULTS_H */
| 29.591078 | 95 | 0.73103 |
fcdeaee653ff53ef82525e753b2bec1c51878245 | 7,780 | c | C | libweston/backend-rdp/hash.c | microsoft/weston | 1bfd5803ff7c91d2d07141648571de1d652e4058 | [
"MIT"
] | 1 | 2021-07-06T18:47:14.000Z | 2021-07-06T18:47:14.000Z | libweston/backend-rdp/hash.c | microsoft/weston | 1bfd5803ff7c91d2d07141648571de1d652e4058 | [
"MIT"
] | null | null | null | libweston/backend-rdp/hash.c | microsoft/weston | 1bfd5803ff7c91d2d07141648571de1d652e4058 | [
"MIT"
] | null | null | null | /*
* Copyright © 2009 Intel Corporation
* Copyright © 1988-2004 Keith Packard and Bart Massey.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* Except as contained in this notice, the names of the authors
* or their institutions shall not be used in advertising or
* otherwise to promote the sale, use or other dealings in this
* Software without prior written authorization from the
* authors.
*
* Authors:
* Eric Anholt <eric@anholt.net>
* Keith Packard <keithp@keithp.com>
*/
#include "config.h"
#include <stdlib.h>
#include <stdint.h>
#include "hash.h"
struct hash_entry {
uint32_t hash;
void *data;
};
struct hash_table {
struct hash_entry *table;
uint32_t size;
uint32_t rehash;
uint32_t max_entries;
uint32_t size_index;
uint32_t entries;
uint32_t deleted_entries;
};
#define ARRAY_SIZE(array) (sizeof(array) / sizeof(array[0]))
/*
* From Knuth -- a good choice for hash/rehash values is p, p-2 where
* p and p-2 are both prime. These tables are sized to have an extra 10%
* free to avoid exponential performance degradation as the hash table fills
*/
static const uint32_t deleted_data;
static const struct {
uint32_t max_entries, size, rehash;
} hash_sizes[] = {
{ 2, 5, 3 },
{ 4, 7, 5 },
{ 8, 13, 11 },
{ 16, 19, 17 },
{ 32, 43, 41 },
{ 64, 73, 71 },
{ 128, 151, 149 },
{ 256, 283, 281 },
{ 512, 571, 569 },
{ 1024, 1153, 1151 },
{ 2048, 2269, 2267 },
{ 4096, 4519, 4517 },
{ 8192, 9013, 9011 },
{ 16384, 18043, 18041 },
{ 32768, 36109, 36107 },
{ 65536, 72091, 72089 },
{ 131072, 144409, 144407 },
{ 262144, 288361, 288359 },
{ 524288, 576883, 576881 },
{ 1048576, 1153459, 1153457 },
{ 2097152, 2307163, 2307161 },
{ 4194304, 4613893, 4613891 },
{ 8388608, 9227641, 9227639 },
{ 16777216, 18455029, 18455027 },
{ 33554432, 36911011, 36911009 },
{ 67108864, 73819861, 73819859 },
{ 134217728, 147639589, 147639587 },
{ 268435456, 295279081, 295279079 },
{ 536870912, 590559793, 590559791 },
{ 1073741824, 1181116273, 1181116271},
{ 2147483648ul, 2362232233ul, 2362232231ul}
};
static int
entry_is_free(struct hash_entry *entry)
{
return entry->data == NULL;
}
static int
entry_is_deleted(struct hash_entry *entry)
{
return entry->data == &deleted_data;
}
static int
entry_is_present(struct hash_entry *entry)
{
return entry->data != NULL && entry->data != &deleted_data;
}
struct hash_table *
hash_table_create(void)
{
struct hash_table *ht;
ht = malloc(sizeof(*ht));
if (ht == NULL)
return NULL;
ht->size_index = 0;
ht->size = hash_sizes[ht->size_index].size;
ht->rehash = hash_sizes[ht->size_index].rehash;
ht->max_entries = hash_sizes[ht->size_index].max_entries;
ht->table = calloc(ht->size, sizeof(*ht->table));
ht->entries = 0;
ht->deleted_entries = 0;
if (ht->table == NULL) {
free(ht);
return NULL;
}
return ht;
}
/**
* Frees the given hash table.
*/
void
hash_table_destroy(struct hash_table *ht)
{
if (!ht)
return;
free(ht->table);
free(ht);
}
/**
* Finds a hash table entry with the given key and hash of that key.
*
* Returns NULL if no entry is found. Note that the data pointer may be
* modified by the user.
*/
static void *
hash_table_search(struct hash_table *ht, uint32_t hash)
{
uint32_t hash_address;
hash_address = hash % ht->size;
do {
uint32_t double_hash;
struct hash_entry *entry = ht->table + hash_address;
if (entry_is_free(entry)) {
return NULL;
} else if (entry_is_present(entry) && entry->hash == hash) {
return entry;
}
double_hash = 1 + hash % ht->rehash;
hash_address = (hash_address + double_hash) % ht->size;
} while (hash_address != hash % ht->size);
return NULL;
}
void
hash_table_for_each(struct hash_table *ht,
hash_table_iterator_func_t func, void *data)
{
struct hash_entry *entry;
uint32_t i;
for (i = 0; i < ht->size; i++) {
entry = ht->table + i;
if (entry_is_present(entry))
func(entry->data, data);
}
}
void *
hash_table_lookup(struct hash_table *ht, uint32_t hash)
{
struct hash_entry *entry;
entry = hash_table_search(ht, hash);
if (entry != NULL)
return entry->data;
return NULL;
}
static void
hash_table_rehash(struct hash_table *ht, unsigned int new_size_index)
{
struct hash_table old_ht;
struct hash_entry *table, *entry;
if (new_size_index >= ARRAY_SIZE(hash_sizes))
return;
table = calloc(hash_sizes[new_size_index].size, sizeof(*ht->table));
if (table == NULL)
return;
old_ht = *ht;
ht->table = table;
ht->size_index = new_size_index;
ht->size = hash_sizes[ht->size_index].size;
ht->rehash = hash_sizes[ht->size_index].rehash;
ht->max_entries = hash_sizes[ht->size_index].max_entries;
ht->entries = 0;
ht->deleted_entries = 0;
for (entry = old_ht.table;
entry != old_ht.table + old_ht.size;
entry++) {
if (entry_is_present(entry)) {
hash_table_insert(ht, entry->hash, entry->data);
}
}
free(old_ht.table);
}
/**
* Inserts the data with the given hash into the table.
*
* Note that insertion may rearrange the table on a resize or rehash,
* so previously found hash_entries are no longer valid after this function.
*/
int
hash_table_insert(struct hash_table *ht, uint32_t hash, void *data)
{
uint32_t hash_address;
if (ht->entries >= ht->max_entries) {
hash_table_rehash(ht, ht->size_index + 1);
} else if (ht->deleted_entries + ht->entries >= ht->max_entries) {
hash_table_rehash(ht, ht->size_index);
}
hash_address = hash % ht->size;
do {
struct hash_entry *entry = ht->table + hash_address;
uint32_t double_hash;
if (!entry_is_present(entry)) {
if (entry_is_deleted(entry))
ht->deleted_entries--;
entry->hash = hash;
entry->data = data;
ht->entries++;
return 0;
}
double_hash = 1 + hash % ht->rehash;
hash_address = (hash_address + double_hash) % ht->size;
} while (hash_address != hash % ht->size);
/* We could hit here if a required resize failed. An unchecked-malloc
* application could ignore this result.
*/
return -1;
}
/**
* This function deletes the given hash table entry.
*
* Note that deletion doesn't otherwise modify the table, so an iteration over
* the table deleting entries is safe.
*/
void
hash_table_remove(struct hash_table *ht, uint32_t hash)
{
struct hash_entry *entry;
entry = hash_table_search(ht, hash);
if (entry != NULL) {
entry->data = (void *) &deleted_data;
ht->entries--;
ht->deleted_entries++;
}
}
uint32_t
hash_table_num_entries(struct hash_table *ht)
{
return ht->entries;
}
| 24.542587 | 79 | 0.674422 |
e79916f32c2a57e67214524b388b00d52c6c2186 | 2,209 | h | C | System/Library/Frameworks/CoreData.framework/NSMappingModel.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | 2 | 2021-04-15T10:50:21.000Z | 2021-08-19T19:00:09.000Z | System/Library/Frameworks/CoreData.framework/NSMappingModel.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | System/Library/Frameworks/CoreData.framework/NSMappingModel.h | lechium/tvOS144Headers | e22dcf52662ae03002e3a6d57273f54e74013cb0 | [
"MIT"
] | null | null | null | /*
* This header is generated by classdump-dyld 1.5
* on Wednesday, April 14, 2021 at 2:20:21 PM Mountain Standard Time
* Operating System: Version 14.4 (Build 18K802)
* Image Source: /System/Library/Frameworks/CoreData.framework/CoreData
* classdump-dyld is licensed under GPLv3, Copyright © 2013-2016 by Elias Limneos. Updated by Kevin Bradley.
*/
#import <CoreData/CoreData-Structs.h>
#import <libobjc.A.dylib/NSSecureCoding.h>
@class NSMutableArray, NSMutableDictionary, NSArray, NSDictionary;
@interface NSMappingModel : NSObject <NSSecureCoding> {
void* _reserved;
void* _reserved1;
void* _reserved2;
NSMutableArray* _entityMappings;
NSMutableDictionary* _entityMappingsByName;
struct {
unsigned _isInUse : 1;
unsigned _reservedModelMapping : 31;
} _modelMappingFlags;
}
@property (retain) NSArray * entityMappings;
@property (copy,readonly) NSDictionary * entityMappingsByName;
+(void)initialize;
+(BOOL)supportsSecureCoding;
+(int)migrationDebugLevel;
+(void)setMigrationDebugLevel:(int)arg1 ;
+(id)_mappingModelFromBundles:(id)arg1 forSourceModel:(id)arg2 destinationModel:(id)arg3 ;
+(id)_newMappingModelFromBundles:(id)arg1 forSourceHashes:(id)arg2 destinationHashes:(id)arg3 ;
+(id)mappingModelFromBundles:(id)arg1 forSourceModel:(id)arg2 destinationModel:(id)arg3 ;
+(id)inferredMappingModelForSourceModel:(id)arg1 destinationModel:(id)arg2 error:(id*)arg3 ;
-(BOOL)isEqual:(id)arg1 ;
-(id)copyWithZone:(NSZone*)arg1 ;
-(id)description;
-(id)init;
-(void)dealloc;
-(id)initWithContentsOfURL:(id)arg1 ;
-(void)encodeWithCoder:(id)arg1 ;
-(id)initWithCoder:(id)arg1 ;
-(void)_setIsEditable:(BOOL)arg1 ;
-(void)setEntityMappings:(NSArray *)arg1 ;
-(void)_throwIfNotEditable;
-(void)_createCachesAndOptimizeState;
-(BOOL)isEditable;
-(BOOL)_hasInferredMappingNeedingValidation;
-(NSArray *)entityMappings;
-(id)_initWithEntityMappings:(id)arg1 ;
-(void)_addEntityMapping:(id)arg1 ;
-(NSDictionary *)entityMappingsByName;
-(BOOL)_isInferredMappingModel;
-(id)_sourceEntityVersionHashesByName;
-(id)_destinationEntityVersionHashesByName;
@end
| 36.213115 | 130 | 0.73608 |
e7d54688bc3a0728d93a5864b6006c3a4ea5c35d | 88 | h | C | ios/RNMSAL.h | true-hamid/react-native-msal | f01a4b4aaf9362c028a32f3417e95fcbe4b9d89b | [
"MIT"
] | 63 | 2020-02-12T20:05:09.000Z | 2022-03-29T16:19:03.000Z | ios/RNMSAL.h | true-hamid/react-native-msal | f01a4b4aaf9362c028a32f3417e95fcbe4b9d89b | [
"MIT"
] | 137 | 2020-02-19T14:04:23.000Z | 2022-03-27T06:26:17.000Z | ios/RNMSAL.h | true-hamid/react-native-msal | f01a4b4aaf9362c028a32f3417e95fcbe4b9d89b | [
"MIT"
] | 40 | 2020-02-14T04:25:00.000Z | 2022-02-24T11:36:57.000Z | #import <React/RCTBridgeModule.h>
@interface RNMSAL : NSObject <RCTBridgeModule>
@end
| 14.666667 | 46 | 0.772727 |
532b9394b834616960b18803119fb12bf73c8581 | 7,152 | h | C | board/slippy/board.h | hitech95/chrome-ec | 9c2283102be1a2653731ef22d65607f88440e8ca | [
"BSD-3-Clause"
] | null | null | null | board/slippy/board.h | hitech95/chrome-ec | 9c2283102be1a2653731ef22d65607f88440e8ca | [
"BSD-3-Clause"
] | null | null | null | board/slippy/board.h | hitech95/chrome-ec | 9c2283102be1a2653731ef22d65607f88440e8ca | [
"BSD-3-Clause"
] | null | null | null | /* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/* Configuration for Slippy mainboard */
#ifndef __BOARD_H
#define __BOARD_H
/* Optional features */
#define CONFIG_BACKLIGHT_X86
#define CONFIG_BATTERY_CHECK_CONNECTED
#define CONFIG_BATTERY_SMART
#define CONFIG_BOARD_VERSION
#define CONFIG_CHARGER
#define CONFIG_CHARGER_BQ24707A
#define CONFIG_CHARGER_DISCHARGE_ON_AC
#ifdef HAS_TASK_CHIPSET
#define CONFIG_CHIPSET_HASWELL
#define CONFIG_CHIPSET_X86
#endif
#define CONFIG_CMD_GSV
#define CONFIG_EXTPOWER_GPIO
#define CONFIG_KEYBOARD_BOARD_CONFIG
#ifdef HAS_TASK_KEYPROTO
#define CONFIG_KEYBOARD_PROTOCOL_8042
#endif
#define CONFIG_LED_SLIPPY
#define CONFIG_LOW_POWER_IDLE
#define CONFIG_POWER_BUTTON
#define CONFIG_POWER_BUTTON_X86
#define CONFIG_PWM_FAN
#define CONFIG_TEMP_SENSOR
#define CONFIG_TEMP_SENSOR_G781
#define CONFIG_UART_HOST 2
#define CONFIG_USB_PORT_POWER_DUMB
#define CONFIG_WIRELESS
#ifndef __ASSEMBLER__
/* Module IDs */
/* TODO(rspangler): use this in place of enum console_channel as well */
enum module_id {
MODULE_I2C,
MODULE_LPC,
MODULE_PECI,
MODULE_PWM_FAN,
MODULE_UART,
};
/* PWM channels */
#define FAN_CH_CPU 2 /* CPU fan */
#define FAN_CH_BL_DISPLAY 4 /* LVDS backlight (from PCH, cleaned by EC) */
/* I2C ports */
#define I2C_PORT_BATTERY 0
#define I2C_PORT_CHARGER 0
#define I2C_PORT_THERMAL 5
/* There are only two I2C ports used because battery and charger share a port */
#define I2C_PORTS_USED 2
/* 13x8 keyboard scanner uses an entire GPIO bank for row inputs */
#define KB_SCAN_ROW_IRQ LM4_IRQ_GPIOK
#define KB_SCAN_ROW_GPIO LM4_GPIO_K
/* Host connects to keyboard controller module via LPC */
#define HOST_KB_BUS_LPC
/* USB ports */
#define USB_PORT_COUNT 2
/* GPIO signal definitions. */
enum gpio_signal {
/* Inputs with interrupt handlers are first for efficiency */
GPIO_POWER_BUTTON_L = 0, /* Power button */
GPIO_LID_OPEN, /* Lid switch */
GPIO_AC_PRESENT, /* AC power present */
GPIO_PCH_BKLTEN, /* Backlight enable signal from PCH */
GPIO_PCH_SLP_S0_L, /* SLP_S0# signal from PCH */
GPIO_PCH_SLP_S3_L, /* SLP_S3# signal from PCH */
GPIO_PCH_SLP_S5_L, /* SLP_S5# signal from PCH */
GPIO_PCH_SLP_SUS_L, /* SLP_SUS# signal from PCH */
GPIO_PP1050_PGOOD, /* Power good on 1.05V */
GPIO_PP1350_PGOOD, /* Power good on 1.35V (DRAM) */
GPIO_PP5000_PGOOD, /* Power good on 5V */
GPIO_VCORE_PGOOD, /* Power good on core VR */
GPIO_PCH_EDP_VDD_EN, /* PCH wants EDP enabled */
GPIO_RECOVERY_L, /* Recovery signal from servo */
GPIO_WP_L, /* Write protect input */
GPIO_JTAG_TCK, /* JTAG clock input */
GPIO_UART0_RX, /* UART0 RX input */
/* Other inputs */
GPIO_FAN_ALERT_L, /* From thermal sensor */
GPIO_PCH_SUSWARN_L, /* SUSWARN# signal from PCH */
GPIO_USB1_OC_L, /* USB port overcurrent warning */
GPIO_USB2_OC_L, /* USB port overcurrent warning */
GPIO_BOARD_VERSION1, /* Board version stuffing resistor 1 */
GPIO_BOARD_VERSION2, /* Board version stuffing resistor 2 */
GPIO_BOARD_VERSION3, /* Board version stuffing resistor 3 */
GPIO_CPU_PGOOD, /* Power good to the CPU */
GPIO_BAT_DETECT_L, /* Battery detect. Repurposed BAT_TEMP */
/* Outputs */
GPIO_CPU_PROCHOT, /* Force CPU to think it's overheated */
GPIO_PP1350_EN, /* Enable 1.35V supply */
GPIO_PP3300_DSW_GATED_EN, /* Enable DSW rails */
GPIO_PP3300_DX_EN, /* Enable power to lots of peripherals */
GPIO_PP3300_LTE_EN, /* Enable LTE radio */
GPIO_PP3300_WLAN_EN, /* Enable WiFi power */
GPIO_SUSP_VR_EN, /* Enable 1.05V regulator */
GPIO_VCORE_EN, /* Stuffing option - not connected */
GPIO_PP5000_EN, /* Enable 5V supply */
GPIO_SYS_PWROK, /* EC thinks everything is up and ready */
GPIO_WLAN_OFF_L, /* Disable WiFi radio */
GPIO_CHARGE_L, /* Allow battery to charge when on AC */
GPIO_ENABLE_BACKLIGHT, /* Enable backlight power */
GPIO_ENABLE_TOUCHPAD, /* Enable touchpad power */
GPIO_ENTERING_RW, /* Indicate when EC is entering RW code */
GPIO_PCH_DPWROK, /* Indicate when VccDSW is good */
GPIO_PCH_HDA_SDO, /* HDA_SDO signal to PCH; when high, ME
* ignores security descriptor */
GPIO_PCH_WAKE_L, /* Wake signal from EC to PCH */
GPIO_PCH_NMI_L, /* Non-maskable interrupt pin to PCH */
GPIO_PCH_PWRBTN_L, /* Power button output to PCH */
GPIO_PCH_PWROK, /* PWROK / APWROK signals to PCH */
GPIO_PCH_RCIN_L, /* RCIN# line to PCH (for 8042 emulation) */
GPIO_PCH_RSMRST_L, /* Reset PCH resume power plane logic */
GPIO_PCH_SMI_L, /* System management interrupt to PCH */
GPIO_TOUCHSCREEN_RESET_L, /* Reset touch screen */
GPIO_EC_EDP_VDD_EN, /* Enable EDP (passthru from PCH) */
GPOI_LPC_CLKRUN_L, /* Dunno. Probably important, though. */
GPIO_USB1_ENABLE, /* USB port 1 output power enable */
GPIO_USB2_ENABLE, /* USB port 2 output power enable */
GPIO_PCH_SUSACK_L, /* Acknowledge PCH SUSWARN# signal */
GPIO_PCH_RTCRST_L, /* Not supposed to be here */
GPIO_PCH_SRTCRST_L, /* Not supposed to be here */
GPIO_BAT_LED0_L, /* Battery charging LED - Blue */
GPIO_BAT_LED1_L, /* Battery charging LED - Amber */
/* Number of GPIOs; not an actual GPIO */
GPIO_COUNT
};
/* x86 signal definitions */
enum x86_signal {
X86_PGOOD_PP5000 = 0,
X86_PGOOD_PP1350,
X86_PGOOD_PP1050,
X86_PGOOD_VCORE,
X86_PCH_SLP_S0n_DEASSERTED,
X86_PCH_SLP_S3n_DEASSERTED,
X86_PCH_SLP_S5n_DEASSERTED,
X86_PCH_SLP_SUSn_DEASSERTED,
/* Number of X86 signals */
X86_SIGNAL_COUNT
};
/* Charger module */
#define CONFIG_CHARGER_SENSE_RESISTOR 10 /* Charge sense resistor, mOhm */
#define CONFIG_CHARGER_SENSE_RESISTOR_AC 10 /* Input sensor resistor, mOhm */
#define CONFIG_CHARGER_INPUT_CURRENT 4032 /* mA, about half max */
enum adc_channel {
/* EC internal die temperature in degrees K. */
ADC_CH_EC_TEMP = 0,
/* HEY: Be prepared to read this (ICMNT). */
/* Charger current in mA. */
ADC_CH_CHARGER_CURRENT,
ADC_CH_COUNT
};
enum temp_sensor_id {
/* CPU die temperature via PECI */
TEMP_SENSOR_CPU_PECI = 0,
/* EC internal temperature sensor */
TEMP_SENSOR_EC_INTERNAL,
/* G781 internal and external sensors */
TEMP_SENSOR_I2C_G781_INTERNAL,
TEMP_SENSOR_I2C_G781_EXTERNAL,
TEMP_SENSOR_COUNT
};
/**
* Board-specific g781 power state.
*/
int board_g781_has_power(void);
/* Wireless signals */
#define WIRELESS_GPIO_WLAN GPIO_WLAN_OFF_L
#define WIRELESS_GPIO_WWAN GPIO_PP3300_LTE_EN
#define WIRELESS_GPIO_WLAN_POWER GPIO_PP3300_WLAN_EN
/* Discharge battery when on AC power for factory test. */
int board_discharge_on_ac(int enable);
#endif /* !__ASSEMBLER__ */
#endif /* __BOARD_H */
| 33.895735 | 80 | 0.700923 |
bba1ad09c7add4821d35497e5941c6fcc04949f3 | 266 | c | C | archives/Others/CPrimerPlus/exercises/6/15.c | everything411/BIT_Exercises | 2d0e31dca2b9607dce0bb43340ebeaa2c42c4a43 | [
"Unlicense"
] | null | null | null | archives/Others/CPrimerPlus/exercises/6/15.c | everything411/BIT_Exercises | 2d0e31dca2b9607dce0bb43340ebeaa2c42c4a43 | [
"Unlicense"
] | null | null | null | archives/Others/CPrimerPlus/exercises/6/15.c | everything411/BIT_Exercises | 2d0e31dca2b9607dce0bb43340ebeaa2c42c4a43 | [
"Unlicense"
] | null | null | null | #include <stdio.h>
int main(void)
{
char word[256];
int count = 0;
printf("Enter something in a line:");
do
{
scanf("%c", &word[count++]);
} while (word[count - 1] == '\n');
while (count-- > 0)
{
printf("%c", word[count]);
}
printf("\n");
return 0;
}
| 14.777778 | 38 | 0.545113 |
6324224af0f67d58cdd517492acbdf7c08d8f640 | 657 | h | C | Server/AutomationActions/Query/Specifiers/QuerySpecifierByCoordinate.h | pr4bh4sh/DeviceAgent.iOS | f50deca89dfe3db26f54812f9845a56e4db0747a | [
"MIT",
"BSD-Source-Code",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 15 | 2018-05-19T16:07:59.000Z | 2020-07-14T10:28:53.000Z | Server/AutomationActions/Query/Specifiers/QuerySpecifierByCoordinate.h | pr4bh4sh/DeviceAgent.iOS | f50deca89dfe3db26f54812f9845a56e4db0747a | [
"MIT",
"BSD-Source-Code",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 43 | 2018-06-06T03:29:11.000Z | 2021-04-29T12:35:11.000Z | Server/AutomationActions/Query/Specifiers/QuerySpecifierByCoordinate.h | pr4bh4sh/DeviceAgent.iOS | f50deca89dfe3db26f54812f9845a56e4db0747a | [
"MIT",
"BSD-Source-Code",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 17 | 2018-07-17T08:31:13.000Z | 2020-04-07T23:29:25.000Z |
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
#import <Foundation/Foundation.h>
#import "QuerySpecifier.h"
/**
@name Overview
Stub specifiers for coordinate queries.
## NOTE
Currently, coordinate-based queries are only supported in conjunction with Gestures,
so these don't work for actual element queries.
## WARNING
** Instantiation will throw a CBXException. **
*/
/** Coordinate specifier stub */
@interface QuerySpecifierByCoordinate : QuerySpecifier<QuerySpecifier>
@end
/** Coordinates specifier stub */
@interface QuerySpecifierByCoordinates : QuerySpecifier<QuerySpecifier>
@end
| 24.333333 | 86 | 0.765601 |
498f91b1a7d4dfd1bbe6f601d3cdb0f554a0d0f9 | 107 | c | C | src/curses/newpad.c | ung-org/lib-c | 55fc64c7ffd7792bc88451a736c2e94e5865282f | [
"MIT"
] | null | null | null | src/curses/newpad.c | ung-org/lib-c | 55fc64c7ffd7792bc88451a736c2e94e5865282f | [
"MIT"
] | null | null | null | src/curses/newpad.c | ung-org/lib-c | 55fc64c7ffd7792bc88451a736c2e94e5865282f | [
"MIT"
] | null | null | null | #include <curses.h>
WINDOW * newpad(int nlines, int ncols)
{
return NULL;
}
/*
XOPEN(4)
LINK(curses)
*/
| 8.916667 | 38 | 0.64486 |
6f0caa07b808acf613a393ad7e8a265960a15175 | 1,378 | h | C | proj/alog/639. Decode Ways II/639. Decode Ways II.h | andy-sheng/leetcode | 1fa070036f31d0bd18a9a11a5c771641f3cd9a03 | [
"MIT"
] | null | null | null | proj/alog/639. Decode Ways II/639. Decode Ways II.h | andy-sheng/leetcode | 1fa070036f31d0bd18a9a11a5c771641f3cd9a03 | [
"MIT"
] | null | null | null | proj/alog/639. Decode Ways II/639. Decode Ways II.h | andy-sheng/leetcode | 1fa070036f31d0bd18a9a11a5c771641f3cd9a03 | [
"MIT"
] | null | null | null | //
// 639. Decode Ways II.h
// leetcode
//
// Created by andysheng on 2021/8/19.
// Copyright © 2021 Andy. All rights reserved.
//
#ifndef _39__Decode_Ways_II_h
#define _39__Decode_Ways_II_h
#include "DataStructures.h"
namespace P639 {
class Solution {
public:
int numDecodings(string s) {
long n_2 = 1;
long n_1 = s.back() == '*' ? 9 : s.back() != '0';
for (int i = (int)s.size() - 2; i > -1; --i) {
long tmp = 0;
if (s[i] == '*') {
tmp = 9 * n_1;
if (s[i+1] == '*') {
tmp += 15 * n_2;
} else {
tmp += ((s[i+1] <= '6') ? 2 : 1) * n_2;
}
}
else if (s[i] != '0') {
tmp = n_1;
if (s[i + 1] == '*') {
if (s[i] == '1') {
tmp += 9 * n_2;
} else if (s[i] == '2') {
tmp += 6 * n_2;
}
} else {
int val = (s[i] - '0') * 10 + s[i + 1] - '0';
if (val <= 26) {
tmp += n_2;
}
}
}
n_2 = n_1;
n_1 = tmp % 1000000007;
}
return n_1;
}
};
}
#endif /* _39__Decode_Ways_II_h */
| 24.175439 | 65 | 0.323657 |
6f272ec20e92ca4de1af975664cfe5e00d76ff34 | 759 | h | C | src/debug/src/gui/dialog/IDialog.h | sagpant/simpleai | db3acd891f46f67ae70c271bf88a46e6e6b28b0f | [
"Zlib"
] | 173 | 2015-01-01T23:01:47.000Z | 2022-03-05T23:12:24.000Z | src/debug/src/gui/dialog/IDialog.h | mgerhardy/simpleai | db3acd891f46f67ae70c271bf88a46e6e6b28b0f | [
"Zlib"
] | 31 | 2015-01-24T08:07:50.000Z | 2019-10-08T19:12:30.000Z | src/debug/src/gui/dialog/IDialog.h | mgerhardy/simpleai | db3acd891f46f67ae70c271bf88a46e6e6b28b0f | [
"Zlib"
] | 14 | 2015-08-23T21:25:32.000Z | 2022-03-02T05:33:38.000Z | /**
* @file
*/
#pragma once
#include <QDialog>
#include <QBoxLayout>
#include <QDebug>
#include <QList>
#define DIALOG_NO_APPLY_BUTTON (1 << 0)
class IDialog: public QDialog {
Q_OBJECT
protected:
QString _title;
QPushButton *_applyButton;
QPushButton *_closeButton;
QHBoxLayout *_buttonLayout;
QWidget *_buttons;
QVBoxLayout *_mainLayout;
int _flags;
private slots:
void apply() {
onApply();
emit accept();
}
public:
IDialog(const QString &title, int flags = 0);
virtual ~IDialog();
const QString& getTitle() const;
int run();
virtual void addButtons(QBoxLayout& layout);
virtual void onApply() {}
virtual void addMainWidgets(QBoxLayout& /* layout */) = 0;
};
inline const QString& IDialog::getTitle() const {
return _title;
}
| 16.5 | 59 | 0.711462 |
177c3d30a9ad610ad7c8a3d5330e4219c23bfedb | 2,458 | h | C | EagleSDK.framework/Versions/A/Headers/Eagle_macros.h | guxs1129/eagleSDK | c1ba73239df23c03bc35063aa7ce75c142b57750 | [
"MIT"
] | null | null | null | EagleSDK.framework/Versions/A/Headers/Eagle_macros.h | guxs1129/eagleSDK | c1ba73239df23c03bc35063aa7ce75c142b57750 | [
"MIT"
] | null | null | null | EagleSDK.framework/Versions/A/Headers/Eagle_macros.h | guxs1129/eagleSDK | c1ba73239df23c03bc35063aa7ce75c142b57750 | [
"MIT"
] | null | null | null | //
// Eagle_ macros.h
// Eagle
//
// Created by 潘涛 on 2017/10/23.
// Copyright © 2017年 pantao. All rights reserved.
//
#ifndef Eagle__macros_h
#define Eagle__macros_h
/**********************************LOG*****************************************/
#ifdef DEBUG //调试阶段
#define EagleLog(...) NSLog(__VA_ARGS__)
#else //发布阶段
#define EagleLog(...)
#endif
/**********************************LOG*****************************************/
/**********************************weak、strong*****************************************/
#define weakify( x ) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
autoreleasepool{} __weak __typeof__(x) __weak_##x##__ = x; \
_Pragma("clang diagnostic pop")
#define strongify( x ) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshadow\"") \
try{} @finally{} __typeof__(x) x = __weak_##x##__; \
_Pragma("clang diagnostic pop")
/**********************************weak、strong*****************************************/
/**********************************EGSize*****************************************/
struct EGSize {
BOOL usePercent;// YES -- 使用百分比布局,反之使用固定值布局
CGFloat horizontal;
CGFloat vertical;
CGFloat width;
CGFloat height;
};
typedef struct CG_BOXABLE EGSize EGSize;
//CG_EXTERN const CGSize EGSizeZero
//CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0);
CG_INLINE EGSize EGSizeMake(BOOL usePercent,
CGFloat horizontal,
CGFloat vertical,
CGFloat width,
CGFloat height);
CG_INLINE EGSize
EGSizeMake(BOOL usePercent,
CGFloat horizontal,
CGFloat vertical,
CGFloat width,
CGFloat height)
{
EGSize size; size.usePercent = usePercent; size.horizontal = horizontal; size.vertical = vertical; size.width = width; size.height = height; return size;
}
/**********************************EGSize*****************************************/
/**********************************random*****************************************/
#define random(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0]
#define randomColor random(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256))
/**********************************random*****************************************/
#endif /* Eagle__macros_h */
| 35.114286 | 157 | 0.502034 |
a5bf6a1833f2e41b8fa00fe4da8930d6e06dd2e4 | 2,624 | h | C | cusp/graph/vertex_coloring.h | Raman-sh/cusplibrary | 99dcde05991ef59cbc4546aeced6eb3bd49c90c9 | [
"Apache-2.0"
] | 270 | 2015-01-12T19:40:50.000Z | 2022-03-28T00:58:21.000Z | cusp/graph/vertex_coloring.h | njh19/cusplibrary | 4f72f152804dee592fec86719049af2b5469295a | [
"Apache-2.0"
] | 41 | 2015-01-08T18:07:42.000Z | 2022-02-27T02:37:38.000Z | cusp/graph/vertex_coloring.h | njh19/cusplibrary | 4f72f152804dee592fec86719049af2b5469295a | [
"Apache-2.0"
] | 106 | 2015-02-27T19:30:58.000Z | 2022-03-29T13:55:53.000Z | /*
* Copyright 2008-2014 NVIDIA Corporation
*
* 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.
*/
/*! \file vertex_coloring.h
* \brief Breadth-first traversal of a graph
*/
#pragma once
#include <cusp/detail/config.h>
#include <cusp/detail/execution_policy.h>
#include <cstddef>
namespace cusp
{
namespace graph
{
/*! \addtogroup algorithms Algorithms
* \addtogroup graph_algorithms Graph Algorithms
* \brief Algorithms for processing graphs represented in CSR and COO formats
* \ingroup algorithms
* \{
*/
/*! \cond */
template <typename DerivedPolicy,
typename MatrixType,
typename ArrayType>
size_t vertex_coloring(const thrust::detail::execution_policy_base<DerivedPolicy>& exec,
const MatrixType& G,
ArrayType& colors);
/*! \endcond */
/**
* \brief Performs a vertex coloring a graph.
*
* \tparam MatrixType Type of input matrix
* \tparam ArrayType Type of colors array
*
* \param G A symmetric matrix that represents the graph
* \param colors Contains to the color associated with each vertex
* computed during the coloring routine
*
* \see http://en.wikipedia.org/wiki/Graph_coloring
*
* \par Example
*
* \code
* #include <cusp/csr_matrix.h>
* #include <cusp/print.h>
* #include <cusp/gallery/grid.h>
*
* //include coloring header file
* #include <cusp/graph/vertex_coloring.h>
*
* int main()
* {
* // Build a 2D grid on the device
* cusp::csr_matrix<int,float,cusp::device_memory> G;
* cusp::gallery::grid2d(G, 4, 4);
*
* cusp::array1d<int,cusp::device_memory> colors(G.num_rows);
*
* // Execute vertex coloring on the device
* cusp::graph::vertex_coloring(G, colors);
*
* // Print the vertex colors
* cusp::print(colors);
*
* return 0;
* }
* \endcode
*/
template<typename MatrixType,
typename ArrayType>
size_t vertex_coloring(const MatrixType& G,
ArrayType& colors);
/*! \}
*/
} // end namespace graph
} // end namespace cusp
#include <cusp/graph/detail/vertex_coloring.inl>
| 26.24 | 88 | 0.671494 |
a5eb4e80626241b57f2cbf10664f06a520b80030 | 1,560 | c | C | lib/my/src/my_printf/src/fmt/width.c | thomasarbona/raytracer | d477a8cd38659d7d95830c0911c79c30b3f7f354 | [
"MIT"
] | 1 | 2019-01-10T17:51:36.000Z | 2019-01-10T17:51:36.000Z | lib/my/src/my_printf/src/fmt/width.c | thomasarbona/raytracer | d477a8cd38659d7d95830c0911c79c30b3f7f354 | [
"MIT"
] | null | null | null | lib/my/src/my_printf/src/fmt/width.c | thomasarbona/raytracer | d477a8cd38659d7d95830c0911c79c30b3f7f354 | [
"MIT"
] | null | null | null | /*
** width.c for my_printf in /home/arbona/Projects/PSU_2016_my_printf
**
** Made by Thomas ARBONA
** Login <arbona@epitech.net>
**
** Started on Thu Nov 17 11:24:17 2016 Thomas ARBONA
** Last update Fri Mar 3 13:30:56 2017 Thomas ARBONA
*/
#include "../../include/fmt.h"
static char *format_width(t_specs_data *sdata,
char *out,
char wchar,
char *padding)
{
if ((sdata->conv == 'i' || sdata->conv == 'd') &&
(out[0] == '-' || out[0] == '+') && sdata->flags & ZEROFLAG)
{
wchar = out[0];
out[0] = '0';
out = my_str_concat(padding, out);
out[0] = wchar;
return (out);
}
if ((sdata->conv == 'x' || sdata->conv == 'X') &&
(sdata->flags & ALTFLAG) && (sdata->flags & ZEROFLAG))
{
wchar = out[1];
out[1] = '0';
out = my_str_concat(padding, out);
out[1] = wchar;
return (out);
}
return ((sdata->flags & LEFTFLAG)
? my_str_concat(out, padding)
: my_str_concat(padding, out));
}
char *set_width(t_specs_data *sdata, char *str)
{
char wchar;
int len;
char *padding;
char *out;
if (sdata->width <= my_strlen(str) || sdata->conv == '%')
return (my_strdup(str));
wchar = (sdata->flags & ZEROFLAG && sdata->prec < 0 &&
my_str_contain("dibouxX", sdata->conv) >= 0) ? '0' : ' ';
len = sdata->width - my_strlen(str) + 1;
if (!(padding = malloc(sizeof(char) * len)))
return (NULL);
my_memset(padding, len, wchar);
out = format_width(sdata, str, wchar, padding);
free(padding);
return (out);
}
| 26.440678 | 68 | 0.562179 |
991ec9fb530b836847bc0243bfa405004202cc08 | 1,046 | h | C | chaos/common/caching_system/common_buffer/helper/IdFactory.h | fast01/chaosframework | 28194bcca5f976fd5cf61448ca84ce545e94d822 | [
"Apache-2.0"
] | 2 | 2020-04-16T13:20:57.000Z | 2021-06-24T02:05:25.000Z | chaos/common/caching_system/common_buffer/helper/IdFactory.h | fast01/chaosframework | 28194bcca5f976fd5cf61448ca84ce545e94d822 | [
"Apache-2.0"
] | null | null | null | chaos/common/caching_system/common_buffer/helper/IdFactory.h | fast01/chaosframework | 28194bcca5f976fd5cf61448ca84ce545e94d822 | [
"Apache-2.0"
] | null | null | null | /*
* IdFactory.h
* !CHOAS
* Created by Flaminio Antonucci.
*
* Copyright 2012 INFN, National Institute of Nuclear Physics
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef CachingSystem_IdFactory_h
#define CachingSystem_IdFactory_h
namespace chaos {
namespace caching_system {
namespace helper {
static int lastNumber=0;
static int getNewId(){
return __sync_fetch_and_add(&lastNumber,1);
}
}
}
}
#endif
| 26.820513 | 79 | 0.669216 |
3e51dbdb46de85993e057f14e10e4f064dcba984 | 1,044 | c | C | src/vec/normalize.c | gmzorz/Fils-De-Fer | a42d1f757255151466b2f57947b3abca35839f70 | [
"MIT"
] | 3 | 2021-11-18T21:57:39.000Z | 2021-11-19T02:31:31.000Z | src/vec/normalize.c | gmzorz/Fils-De-Fer | a42d1f757255151466b2f57947b3abca35839f70 | [
"MIT"
] | null | null | null | src/vec/normalize.c | gmzorz/Fils-De-Fer | a42d1f757255151466b2f57947b3abca35839f70 | [
"MIT"
] | null | null | null | /* ************************************************************************** */
/* */
/* :::::::: */
/* normalize.c :+: :+: */
/* +:+ */
/* By: goosterl <goosterl@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2021/05/27 14:36:07 by goosterl #+# #+# */
/* Updated: 2021/06/21 14:33:32 by goosterl ######## odam.nl */
/* */
/* ************************************************************************** */
#include <vec.h>
void normalize(t_vec *vector)
{
*vector /= length(*vector);
}
t_vec normalized(t_vec vector)
{
return (vector / length(vector));
}
| 43.5 | 80 | 0.204023 |
8523be95da4a12d7055c6087a3fd4f7f0313c958 | 3,782 | c | C | src/request_message.c | xSHAD0Wx/eznot | 069ab268a0b6636039732ae123ad613090418e7c | [
"Apache-2.0"
] | null | null | null | src/request_message.c | xSHAD0Wx/eznot | 069ab268a0b6636039732ae123ad613090418e7c | [
"Apache-2.0"
] | null | null | null | src/request_message.c | xSHAD0Wx/eznot | 069ab268a0b6636039732ae123ad613090418e7c | [
"Apache-2.0"
] | null | null | null | #include "request_message.h"
#include "log.h"
#include <assert.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <regex.h>
#define VALID_TAGS_PATTERN "^([a-zA-Z0-9_-]+,?)+$"
/******************************************************************************/
uint32_t
eznot_calculate_checksum(const uint8_t* buff, size_t len)
{
uint32_t checksum = 0;
for (int i = 0; i < len; ++i)
checksum += buff[i];
return checksum;
}
/******************************************************************************/
int
eznot_encode_request_message(const request_message_t* msg,
char* buff,
size_t len)
{
assert(buff != NULL);
assert(msg != NULL);
log_trace("eznot_encode_request_message()");
if (len < UDP_PACKET_SIZE) {
log_error("Buffer size must be %d, got %d.", UDP_PACKET_SIZE, len);
return -1;
}
/* Zero the msg buffer */
memset(buff, 0, UDP_PACKET_SIZE);
/* Calculate checksums */
uint16_t hchecksum = msg->header.message_type + msg->header.flags;
uint32_t pchecksum =
eznot_calculate_checksum(msg->payload.tags,
REQUEST_MESSAGE_PAYLOAD_TAGS_SIZE) +
eznot_calculate_checksum(msg->payload.data,
REQUEST_MESSAGE_PAYLOAD_DATA_SIZE);
/* Convert checksums to big endian */
hchecksum = HTOBE16(hchecksum);
pchecksum = HTOBE32(pchecksum);
/* Encode header */
int pos = 0;
buff[pos++] = msg->header.message_type;
buff[pos++] = msg->header.flags;
memcpy(buff + pos, (void*)&hchecksum, sizeof(hchecksum));
pos += sizeof(hchecksum);
memcpy(buff + pos, (void*)&pchecksum, sizeof(pchecksum));
pos += sizeof(pchecksum);
/* Encode payload */
memcpy(buff + pos, msg->payload.tags, REQUEST_MESSAGE_PAYLOAD_TAGS_SIZE);
pos += REQUEST_MESSAGE_PAYLOAD_TAGS_SIZE;
memcpy(buff + pos, msg->payload.data, REQUEST_MESSAGE_PAYLOAD_DATA_SIZE);
pos += REQUEST_MESSAGE_PAYLOAD_DATA_SIZE;
return pos;
}
/******************************************************************************/
int
eznot_decode_request_message(const char* buff,
size_t len,
request_message_t* msg)
{
assert(buff != NULL);
assert(msg != NULL);
log_trace("eznot_decode_request_message()");
if (len < UDP_PACKET_SIZE) {
log_error("Buffer size must be %d, got %d.", UDP_PACKET_SIZE, len);
return -1;
}
/* Decode Header */
int pos = 0;
msg->header.message_type = buff[pos++];
msg->header.flags = buff[pos++];
/* Decode checksums */
uint16_t hchecksum;
uint32_t pchecksum;
memcpy((void*)&hchecksum, buff + pos, sizeof(hchecksum));
pos += sizeof(hchecksum);
memcpy((void*)&pchecksum, buff + pos, sizeof(pchecksum));
pos += sizeof(pchecksum);
msg->header.__hchecksum = HTOBE16(hchecksum);
msg->header.__pchecksum = HTOBE32(pchecksum);
/* Decode body */
memcpy(msg->payload.tags, buff + pos, REQUEST_MESSAGE_PAYLOAD_TAGS_SIZE);
pos += REQUEST_MESSAGE_PAYLOAD_TAGS_SIZE;
memcpy(msg->payload.data, buff + pos, REQUEST_MESSAGE_PAYLOAD_DATA_SIZE);
pos += REQUEST_MESSAGE_PAYLOAD_DATA_SIZE;
return pos;
}
/******************************************************************************/
bool
eznot_are_valid_tags(const char *tags, size_t len)
{
log_trace("eznot_are_valid_tags()");
if (tags == NULL) {
return true;
}
static bool inited = false;
static regex_t patt;
if (!inited) {
if (regcomp(&patt, VALID_TAGS_PATTERN, REG_EXTENDED) != 0) {
log_error("Could not initialize matching regex pattern!");
return false;
}
inited = true;
}
char buff[len + 1];
memcpy(buff, tags, len);
buff[len] = '\0';
return regexec(&patt, buff, 0, NULL, 0) != REG_NOMATCH;
}
/******************************************************************************/
| 26.082759 | 80 | 0.599154 |
87f343d0a68ab9932eed924b9e1e5882a4042940 | 2,664 | h | C | Source/Services/Social/WinRT/XboxUserProfile_WinRT.h | blgrossMS/xbox-live-api | 17c586336e11f0fa3a2a3f3acd665b18c5487b24 | [
"MIT"
] | 2 | 2021-07-17T13:34:20.000Z | 2022-01-09T00:55:51.000Z | Source/Services/Social/WinRT/XboxUserProfile_WinRT.h | blgrossMS/xbox-live-api | 17c586336e11f0fa3a2a3f3acd665b18c5487b24 | [
"MIT"
] | null | null | null | Source/Services/Social/WinRT/XboxUserProfile_WinRT.h | blgrossMS/xbox-live-api | 17c586336e11f0fa3a2a3f3acd665b18c5487b24 | [
"MIT"
] | 1 | 2018-11-18T08:32:40.000Z | 2018-11-18T08:32:40.000Z | //*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
#pragma once
#include "shared_macros.h"
#include "xsapi/profile.h"
#include "Macros_WinRT.h"
NAMESPACE_MICROSOFT_XBOX_SERVICES_SOCIAL_BEGIN
/// <summary>
/// Represents a user's Xbox Live profile.
/// </summary>
public ref class XboxUserProfile sealed
{
public:
/// <summary>
/// The user's display name to be used in application UI. This value is privacy gated and could
/// be a user's real name or their gamertag.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(ApplicationDisplayName, app_display_name)
/// <summary>
/// Uri for the user's display picture to be used in application UI.
/// The Uri is a resizable Uri. It can be used to specify one of the following sizes and formats by appending '&format={format}&w={width}&h={height}:
/// Format: png
/// Width Height
/// 64 64
/// 208 208
/// 424 424
/// </summary>
DEFINE_PROP_GET_URI_OBJ(ApplicationDisplayPictureResizeUri, app_display_picture_resize_uri)
/// <summary>
/// The user's display name to be used in game UI. This value is privacy gated and could
/// be a user's real name or their gamertag.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(GameDisplayName, game_display_name)
/// <summary>
/// Uri for the user's display picture to be used in games.
/// The Uri is a resizable Uri. It can be used to specify one of the following sizes and formats by appending '&format={format}&w={width}&h={height}:
/// Format: png
/// Width Height
/// 64 64
/// 208 208
/// 424 424
/// </summary>
DEFINE_PROP_GET_URI_OBJ(GameDisplayPictureResizeUri, game_display_picture_resize_uri)
/// <summary>
/// The user's gamerscore.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(Gamerscore, gamerscore)
/// <summary>
/// The user's gamertag.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(Gamertag, gamertag)
/// <summary>
/// The user's Xbox user ID.
/// </summary>
DEFINE_PROP_GET_STR_OBJ(XboxUserId, xbox_user_id)
internal:
XboxUserProfile(
_In_ xbox::services::social::xbox_user_profile cppObj
);
private:
xbox::services::social::xbox_user_profile m_cppObj;
};
NAMESPACE_MICROSOFT_XBOX_SERVICES_SOCIAL_END | 32.888889 | 165 | 0.647147 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.