#ifndef ALEXCPT_H
#define ALEXCPT_H

#include <exception>
#include <string>

#include "AL/alc.h"

#ifdef __GNUC__
#define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
#else
#define ALEXCPT_FORMAT(x, y, z)
#endif

namespace al {

class backend_exception final : public std::exception {
    std::string mMessage;
    ALCenum mErrorCode;

public:
    backend_exception(ALCenum code, const char *msg, ...) ALEXCPT_FORMAT(printf, 3,4);

    const char *what() const noexcept override { return mMessage.c_str(); }
    ALCenum errorCode() const noexcept { return mErrorCode; }
};

} // namespace al

#define START_API_FUNC try

#ifndef _MSC_VER
#define END_API_FUNC catch(...) { std::terminate(); }
#else
/* VS 2015 complains that some of these catch statements are unreachable code,
 * due to the function body not able to throw anything. While technically true,
 * it's preferable to mark API functions just in case that ever changes, so
 * silence that warning.
 */
#define END_API_FUNC __pragma(warning(push)) \
__pragma(warning(disable : 4702))            \
catch(...) { std::terminate(); }             \
__pragma(warning(pop))
#endif

#endif /* ALEXCPT_H */

#ifndef ALEXCPT_H
#define ALEXCPT_H

#include <exception>
#include <string>

#include "AL/alc.h"

#ifdef __GNUC__
#define ALEXCPT_FORMAT(x, y, z) __attribute__((format(x, (y), (z))))
#else
#define ALEXCPT_FORMAT(x, y, z)
#endif

namespace al {

class backend_exception final : public std::exception {
    std::string mMessage;
    ALCenum mErrorCode;

public:
    backend_exception(ALCenum code, const char *msg, ...) ALEXCPT_FORMAT(printf, 3,4);

    const char *what() const noexcept override { return mMessage.c_str(); }
    ALCenum errorCode() const noexcept { return mErrorCode; }
};

} // namespace al

#define START_API_FUNC try

#define END_API_FUNC catch(...) { std::terminate(); }

#endif /* ALEXCPT_H */

Revert "Silence some unreachable code warnings on MSVC"

This reverts commit 2ab4883439b1bc96578e86cc894504b9a1d1021b.

It apparently didn't work at silencing anything.


#include <stdio.h>
#include <string.h>
#define MAX_WORDS 3000
#define STOPPER "vsmisal"

struct occurance_t {
    long hash;
    unsigned int count;
};

long hash(char*);
int index_of(char*, struct occurance_t*, int);

int main() {

    int i = 0, temp;
    char word[200];

    struct occurance_t most_common = { 0, 0 };
    struct occurance_t words[MAX_WORDS] = { { 0, 0 } };

    while (1) {

        fgets(word, 201, stdin);

        if (strcmp(word, STOPPER) != 0 && i < MAX_WORDS) {

            if ((temp = index_of(word, words, i)) != -1) {
                words[temp].count++;
            } else {
                words[i].hash = hash(word);
                words[i].count = 1;
                i++;
            }

        } else {
            break;
        }
    }

    temp = 0;
    for (int j = 0; j < i; j++) {

        if (words[j].count > temp) {
            temp = words[j].count;
            most_common.hash = words[j].hash;
            most_common.count = words[j].count;
        }
    }

    printf("%d %ld", most_common.count, most_common.hash);

    return 0;
}

long hash(char *word) {

    long result = 42;
    int length = strlen(word);

    for (int i = 0; i < length; i++) {
        result += word[i] * (i + 1);
    }

    return result;
}

int index_of(char *word, struct occurance_t *words, int length) {

    for (int i = 0; i < length; i++) {
        if (hash(word) == words[i].hash) {
            return i;
        }
    }

    return -1;
}

Add Task 02 for Homework 01

Add Task 02 for Homework 01


//
//  BoxLog.h
//  BoxSDK
//
//  Created on 2/21/13.
//  Copyright (c) 2013 Box. All rights reserved.
//

#ifndef BoxSDK_BoxLog_h
#define BoxSDK_BoxLog_h

#ifdef DEBUG
#define BOXLogFunction()		NSLog(@"%s", __FUNCTION__)
#define BOXLog(...)				NSLog(@"%s: %@", __FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#else
#define BOXLogFunction(...)
#define BOXLog(...)
#endif

#ifdef DEBUG
#define BOXAssert(x, ...)		NSAssert(x, @"%s: %@", __FUNCTION__, [NSString stringWithFormat:__VA_ARGS__])
#define BOXCAssert(...)		NSCAssert(__VA_ARGS__)
#define BOXAssert1(...)		NSAssert1(__VA_ARGS__)
#define BOXAssertFail(...)	BOXAssert(NO, __VA_ARGS__)
#define BOXAbstract()		BOXAssertFail(@"Must be overridden by subclass.")
#else
#define BOXAssert(...)
#define BOXCAssert(...)
#define BOXAssert1(...)
#define BOXAssertFail(...)
#define BOXAbstract()
#endif

#endif

Align macro definitions using spaces instead of tabs


/*!
@file main.c
@brief A simple test program for the C library code.
*/

#include "stdio.h"

#include "verilog_parser.h"

int main(int argc, char ** argv)
{
    if(argc != 2)
    {
        printf("ERROR. Please supply exactly one file path argument.\n");
        return 1;
    }
    else
    {
        // Load the file.
        FILE * fh = fopen(argv[1], "r");

        // Instance the parser.
        verilog_parser parser = verilog_file_parse(fh);

        // Parse the file and store the result.
        int result = verilog_parse_buffer(parser);

        fclose(fh);

        if(result == 0)
        {
            printf("Parse successful\n");
            return 0;
        }
        else
        {
            printf("Parse failed\n");
            return 1;
        }
    }
    return 0;
}

/*!
@file main.c
@brief A simple test program for the C library code.
*/

#include "stdio.h"

#include "verilog_parser.h"

int main(int argc, char ** argv)
{
    if(argc < 2)
    {
        printf("ERROR. Please supply at least one file path argument.\n");
        return 1;
    }
    else
    {
        int F = 0;

        for(F = 1; F < argc; F++)
        {
            // Load the file.
            FILE * fh = fopen(argv[F], "r");

            // Instance the parser.
            verilog_parser parser = verilog_file_parse(fh);

            // Parse the file and store the result.
            int result = verilog_parse_buffer(parser);

            verilog_free_parser(parser);
            fclose(fh);

            if(result == 0)
            {
                printf("Parse successful for %s\n",argv[F]);
            }
            else
            {
                printf("Parse failed for %s\n",argv[F]);
                return 1;
            }
        }
    }
    return 0;
}

Allow test app to recieve as many file inputs as possible.
 On branch master
 Your branch is up-to-date with 'github/master'.

 Changes to be committed:
	modified:   ../src/main.c


#ifndef HEADER_H_
#define HEADER_H_

#include <stdint.h>
#include <stddef.h>

// * Header *
//
// | 1 byte |
// | 2 bytes ....... |
// | 4 bytes ......................... |
//
// |--------|--------|--------|--------|
// | Flags           |Version |Padding |
// |--------|--------|--------|--------|
// | Frame size (incl header)          |
// |-----------------------------------|
// | CRC32                             |
// |-----------------------------------|
// End of header
// |--------|--------|--------|--------|
// | Payload                           |
// | ...                               |
// |--------|--------|--------|--------|

struct header {
    uint16_t flags;
    uint8_t  version;
    uint8_t  pad; // not used
    uint32_t size;
    uint32_t crc32;
};

#define HEADER_FLAGS_EMPTY 0x00
#define HEADER_FLAGS_READY 0xbeef  // marks that the header and payload
                                   // is ready to be consumed

#define HEADER_VERSION     0x0

#define HEADER_PAD         0x0

struct frame {
    const struct header* hdr;
    const unsigned char* buffer;
};

void header_init(struct header*);

size_t frame_payload_size(const struct frame*);

#endif

#ifndef PROT_H_
#define PROT_H_

#include <stdint.h>
#include <stddef.h>

// * Header *
//
// | 1 byte |
// | 2 bytes ....... |
// | 4 bytes ......................... |
//
// |--------|--------|--------|--------|
// | Flags           |Version |Padding |
// |--------|--------|--------|--------|
// | Frame size (incl header)          |
// |-----------------------------------|
// | CRC32                             |
// |-----------------------------------|
// End of header
// |--------|--------|--------|--------|
// | Payload                           |
// | ...                               |
// |--------|--------|--------|--------|

struct header {
    uint16_t flags;
    uint8_t  version;
    uint8_t  pad; // not used
    uint32_t size;
    uint32_t crc32;
};

#define HEADER_FLAGS_EMPTY 0x00
#define HEADER_FLAGS_READY 0xbeef  // marks that the header and payload
                                   // is ready to be consumed

#define HEADER_VERSION     0x0

#define HEADER_PAD         0x0

struct frame {
    const struct header* hdr;
    const unsigned char* buffer;
};

void header_init(struct header*);

size_t frame_payload_size(const struct frame*);

#endif

Rename HEADER_H_ marco -> PROT_H_

Rename HEADER_H_ marco -> PROT_H_

The header guard is not consistent with the filename.


/* Copyright 2021 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.
 */

#ifndef ZEPHYR_SHIM_INCLUDE_BBRAM_H_
#define ZEPHYR_SHIM_INCLUDE_BBRAM_H_

/**
 * Layout of the battery-backed RAM region.
 * TODO (b:178807203) Migrate these values to devicetree registers.
 */
enum bbram_data_index {
	/** General-purpose scratchpad */
	BBRM_DATA_INDEX_SCRATCHPAD = 0,
	/** Saved reset flags */
	BBRM_DATA_INDEX_SAVED_RESET_FLAGS = 4,
	/** Wake reasons for hibernate */
	BBRM_DATA_INDEX_WAKE = 8,
	/** USB-PD saved port0 state */
	BBRM_DATA_INDEX_PD0 = 12,
	/** USB-PD saved port1 state */
	BBRM_DATA_INDEX_PD1 = 13,
	/** Vboot EC try slot */
	BBRM_DATA_INDEX_TRY_SLOT = 14,
	/** USB-PD saved port2 state */
	BBRM_DATA_INDEX_PD2 = 15,
	/** VbNvContext for ARM arch */
	BBRM_DATA_INDEX_VBNVCNTXT = 16,
	/** RAM log for Booter */
	BBRM_DATA_INDEX_RAMLOG = 32,
	/** Flag to indicate validity of panic data starting at index 36. */
	BBRM_DATA_INDEX_PANIC_FLAGS = 35,
	/** Panic data (index 35-63)*/
	BBRM_DATA_INDEX_PANIC_BKUP = 36,
	/** The start time of LCT(4 bytes) */
	BBRM_DATA_INDEX_LCT_TIME = 64,
};

#endif /* ZEPHYR_SHIM_INCLUDE_BBRAM_H_ */

zephyr: Add battery-backed RAM constants for npcx

Bring in the battery-backed RAM layout for npcx. This change
includes a TODO to migrate these values to devicetree registers
but since system.c is on the critical path, this will be a good
step in the right direction.

BRANCH=none
BUG=b:176828988, b:174481378
TEST=zmake testall

Signed-off-by: Yuval Peress <50dc11c009bd4d7e9d9d15a383c1743ce5ee82ef@chromium.org>
Change-Id: Ib84bf4f680c74a95a8549f57c30dab7fca3db42c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2659681
Commit-Queue: Simon Glass <c00b0378376498bd9cd974c388df8854c0131d27@chromium.org>
Reviewed-by: Simon Glass <c00b0378376498bd9cd974c388df8854c0131d27@chromium.org>


#ifndef _SPRITE_H_
#define _SPRITE_H_

#include <memory>

namespace canvas {
  class Texture;
};

#include <glm/glm.hpp>

class Sprite {
 public:
  Sprite();
  virtual ~Sprite();

  const std::shared_ptr<canvas::Texture> & getTexture() const { return texture; }
  void setTexture(const std::shared_ptr<canvas::Texture> & _texture) { texture = _texture; }

  const glm::vec2 & getPosition() const { return position; }
  float getWidth() const { return width; }
  float getHeight() const { return height; }

  void setPosition(const glm::vec2 & _position) { position = _position; }
  void setWidth(float _width) { width = _width; }
  void setHeight(float _height) { height = _height; }

 protected:
  glm::vec2 position;

 private:
  float width = 0, height = 0;
  std::shared_ptr<canvas::Texture> texture;
};

#endif

#ifndef _SPRITE_H_
#define _SPRITE_H_

#include <memory>
#include <Texture.h>

#include <glm/glm.hpp>

class Sprite {
 public:
  Sprite();
  virtual ~Sprite();

  const std::shared_ptr<Texture> & getTexture() const { return texture; }
  void setTexture(const std::shared_ptr<Texture> & _texture) { texture = _texture; }

  const glm::vec2 & getPosition() const { return position; }
  float getWidth() const { return width; }
  float getHeight() const { return height; }

  void setPosition(const glm::vec2 & _position) { position = _position; }
  void setWidth(float _width) { width = _width; }
  void setHeight(float _height) { height = _height; }

 protected:
  glm::vec2 position;

 private:
  float width = 0, height = 0;
  std::shared_ptr<Texture> texture;
};

#endif

Change reference from removed canvas::texture


/*=========================================================================
 *
 *  Copyright Insight Software Consortium
 *
 *  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.txt
 *
 *  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 itkTextProgressBarCommand_h
#define itkTextProgressBarCommand_h

#include "itkCommand.h"

#include <string>

namespace itk
{

/** \class TextProgressBarCommand
 *
 * \brief A simple command that outputs a text progress bar the associated filter.
 *
 * \ingroup Ultrasound
 * */
class TextProgressBarCommand:
  public Command
{
public:
  typedef TextProgressBarCommand Self;
  typedef Command                Superclass;
  typedef SmartPointer< Self >   Pointer;

  itkNewMacro( Self );

protected:
  TextProgressBarCommand();

  void Execute(itk::Object *caller, const itk::EventObject & event) override;

  void Execute(const itk::Object * object, const itk::EventObject & event) override;

  std::string m_Progress;
};

} // end namespace itk

#endif

/*=========================================================================
 *
 *  Copyright Insight Software Consortium
 *
 *  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.txt
 *
 *  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 itkTextProgressBarCommand_h
#define itkTextProgressBarCommand_h

#include "itkCommand.h"

#include "UltrasoundExport.h"

#include <string>

namespace itk
{

/** \class TextProgressBarCommand
 *
 * \brief A simple command that outputs a text progress bar the associated filter.
 *
 * \ingroup Ultrasound
 * */
class Ultrasound_EXPORT TextProgressBarCommand:
  public Command
{
public:
  typedef TextProgressBarCommand Self;
  typedef Command                Superclass;
  typedef SmartPointer< Self >   Pointer;

  itkNewMacro( Self );

protected:
  TextProgressBarCommand();

  void Execute(itk::Object *caller, const itk::EventObject & event) override;

  void Execute(const itk::Object * object, const itk::EventObject & event) override;

  std::string m_Progress;
};

} // end namespace itk

#endif

COMP: Add missing export specification for TextProgressBarCommand


// Copyright eeGeo Ltd (2012-2015), All Rights Reserved

#pragma once

#include "IWatermarkDataRepository.h"
#include "Watermark.h"

#include <map>
#include <string>

namespace ExampleApp
{
    namespace Watermark
    {
        namespace View
        {
            class WatermarkDataRepository : public IWatermarkDataRepository
            {
            public:
                void AddWatermarkData(const std::string& key,
                                      const WatermarkData& watermarkData);

                void RemoveWatermarkDataWithKey(const std::string& key);

                bool HasWatermarkDataForKey(const std::string& key) const;
                WatermarkData GetWatermarkDataWithKey(const std::string& key) const;

            private:
                typedef std::map<std::string, WatermarkData> TWatermarkDataMap;
                TWatermarkDataMap m_watermarkDataMap;
            };
        }
    }
}

// Copyright eeGeo Ltd (2012-2015), All Rights Reserved

#pragma once

#include "IWatermarkDataRepository.h"
#include "Watermark.h"

#include <map>
#include <string>

namespace ExampleApp
{
    namespace Watermark
    {
        namespace View
        {
            class WatermarkDataRepository : public IWatermarkDataRepository
            {
            public:
                void AddWatermarkData(const std::string& key,
                                      const WatermarkData& watermarkData);

                void RemoveWatermarkDataWithKey(const std::string& key);

                bool HasWatermarkDataForKey(const std::string& key) const;
                WatermarkData GetWatermarkDataWithKey(const std::string& key) const;

            private:
                struct CaseInsensitiveCompare
                {
                    bool operator()(const std::string& l, const std::string& r) const
                    {
                        return std::lexicographical_compare(l.begin(), l.end(), r.begin(), r.end(),
                                                            [](const char c1, const char c2)
                                                            {
                                                                return std::tolower(c1) < std::tolower(c2);
                                                            });
                    }
                };

                typedef std::map<std::string, WatermarkData, CaseInsensitiveCompare> TWatermarkDataMap;
                TWatermarkDataMap m_watermarkDataMap;
            };
        }
    }
}

Fix MPLY-8362: check watermark building id case insensitively.


/*
 * Copyright 2016 Adam Chyła, adam@chyla.org
 * All rights reserved. Distributed under the terms of the MIT License.
 */

#ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H
#define SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H

namespace apache
{

namespace analyzer
{

namespace detail
{

constexpr int SESSION_LENGTH = 3600;

}

}

}

#endif /* SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H */

/*
 * Copyright 2016 Adam Chyła, adam@chyla.org
 * All rights reserved. Distributed under the terms of the MIT License.
 */

#ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H
#define SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H

namespace apache
{

namespace analyzer
{

namespace detail
{

constexpr int SESSION_LENGTH = 3 * 60;

}

}

}

#endif /* SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H */

Change session length to 3 minutes

Change session length to 3 minutes


#ifndef AINOD_METHODS_H
#define AINOD_METHODS_H

/** Invalid JSON was received by the server. **/
#define JSON_SCHEMA_ERROR_PARSE_ERROR -32700

/** The JSON sent is not a valid Request object. */
#define JSON_SCHEMA_ERROR_INVALID_REQUEST -32600

/** The method does not exist / is not available. **/
#define JSON_SCHEMA_ERROR_METHOD_NOT_FOUND -32601

/** Invalid method parameter(s). */
#define JSON_SCHEMA_ERROR_INVALID_PARAMS -32602

/** Internal JSON-RPC error. */
#define JSON_SCHEMA_ERROR_INTERNAL_ERROR -32603

/** Reserved for implementation-defined server-errors. */
#define JSON_SCHEMA_ERROR_SERVER_ERROR -32000

char *get_id(void);
int process_buffer(char *buf);

#endif /* AINOD_METHODS_H */

Add Json schema error parse errors.

Add Json schema error parse errors.


//
//  RXArchiveManager.h
//  rivenx
//
//  Created by Jean-Francois Roy on 02/02/2008.
//  Copyright 2005-2010 MacStorm. All rights reserved.
//

#import "Base/RXBase.h"
#import <MHKKit/MHKKit.h>

@interface RXArchiveManager : NSObject {
    NSString* patches_directory;
    MHKArchive* extras_archive;
}

+ (RXArchiveManager*)sharedArchiveManager;

+ (NSPredicate*)anyArchiveFilenamePredicate;
+ (NSPredicate*)dataArchiveFilenamePredicate;
+ (NSPredicate*)soundsArchiveFilenamePredicate;
+ (NSPredicate*)extrasArchiveFilenamePredicate;

- (NSArray*)dataArchivesForStackKey:(NSString*)stack_key error:(NSError**)error;
- (NSArray*)soundArchivesForStackKey:(NSString*)stack_key error:(NSError**)error;
- (MHKArchive*)extrasArchive:(NSError**)error;

@end

//
//  RXArchiveManager.h
//  rivenx
//
//  Created by Jean-Francois Roy on 02/02/2008.
//  Copyright 2005-2010 MacStorm. All rights reserved.
//

#import "Base/RXBase.h"
#import <MHKKit/MHKKit.h>

@interface RXArchiveManager : NSObject {
    NSString* patches_directory;
    MHKArchive* extras_archive;
}

+ (RXArchiveManager*)sharedArchiveManager;

+ (NSPredicate*)anyArchiveFilenamePredicate;
+ (NSPredicate*)dataArchiveFilenamePredicate;
+ (NSPredicate*)soundsArchiveFilenamePredicate;
+ (NSPredicate*)extrasArchiveFilenamePredicate;

// NOTE: these methods return the archives sorted in the order they should be searched; code should always forward-iterate the returned array

- (NSArray*)dataArchivesForStackKey:(NSString*)stack_key error:(NSError**)error;
- (NSArray*)soundArchivesForStackKey:(NSString*)stack_key error:(NSError**)error;
- (MHKArchive*)extrasArchive:(NSError**)error;

@end

Add note about the order of archives returned by the archive manager.


//
//  CSSTypeSelector.h
//  HTMLKit
//
//  Created by Iska on 13/05/15.
//  Copyright (c) 2015 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CSSSelector.h"
#import "CSSSimpleSelector.h"

@interface CSSTypeSelector : CSSSelector <CSSSimpleSelector>

@property (nonatomic, copy) NSString *type;

+ (instancetype)universalSelector;

- (instancetype)initWithType:(NSString *)type;

@end

//
//  CSSTypeSelector.h
//  HTMLKit
//
//  Created by Iska on 13/05/15.
//  Copyright (c) 2015 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "CSSSelector.h"
#import "CSSSimpleSelector.h"

@interface CSSTypeSelector : CSSSelector <CSSSimpleSelector>

@property (nonatomic, copy) NSString * _Nonnull type;

+ (nullable instancetype)universalSelector;

- (nullable instancetype)initWithType:(nonnull NSString *)type;

@end

Add nullability specifiers to type selector


#ifndef ANIMATION_H
#define ANIMATION_H

#include <vector>

#include "Blittable.h"

namespace hm
{
	class Animation
	{
		public:
			Animation();
			~Animation();

			void add(const Blittable& b);
			void remove(const Blittable& b);
			void removeAll();

			virtual void animate() = 0;

		protected:
			std::vector<Blittable*> targets;
	}
}

#endif

#ifndef ANIMATION_H
#define ANIMATION_H

#include <vector>

#include "Blittable.h"
#include "Logger.h"

namespace hm
{
	class Animation
	{
		public:
			Animation();
			~Animation();

			void add(Blittable& b);
			void remove(Blittable& b);
			void removeAll();

			virtual void animate() = 0;

		protected:
			std::vector<Blittable*> targets;
	};
}

#endif

Fix a couple of header issues.

Fix a couple of header issues.


#ifndef FLASH_WRITER_H
#define FLASH_WRITER_H

#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

/** Unlocks the flash for programming. */
void flash_writer_unlock(void);

/** Locks the flash */
void flash_writer_lock(void);

/** Erases the flash page at given address. */
void flash_writer_page_erase(void *page);

/** Writes data to given location in flash. */
void flash_writer_page_write(void *page, uint8_t *data, size_t len);

#ifdef __cplusplus
}
#endif

#endif /* FLASH_WRITER_H */

#ifndef FLASH_WRITER_H
#define FLASH_WRITER_H

#include <stdint.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

/** Unlocks the flash for programming. */
void flash_writer_unlock(void);

/** Locks the flash */
void flash_writer_lock(void);

/** Erases the flash page at given address. */
void flash_writer_page_erase(void *page);

/** Writes data to given location in flash. */
void flash_writer_page_write(void *page, void *data, size_t len);

#ifdef __cplusplus
}
#endif

#endif /* FLASH_WRITER_H */

Convert data source adress type to void *

This should be the standard, as done for example in memcpy(3).


// Copyright 2018 Google LLC
//
// 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 RIEGELI_BASE_STR_ERROR_H_
#define RIEGELI_BASE_STR_ERROR_H_

#include "absl/strings/string_view.h"
#include "riegeli/base/status.h"

namespace riegeli {

// Converts errno value to Status.
Status ErrnoToCanonicalStatus(int error_number, absl::string_view message);

}  // namespace riegeli

#endif  // RIEGELI_BASE_STR_ERROR_H_

// Copyright 2018 Google LLC
//
// 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 RIEGELI_BASE_ERRNO_MAPPING_H_
#define RIEGELI_BASE_ERRNO_MAPPING_H_

#include "absl/strings/string_view.h"
#include "riegeli/base/status.h"

namespace riegeli {

// Converts errno value to Status.
Status ErrnoToCanonicalStatus(int error_number, absl::string_view message);

}  // namespace riegeli

#endif  // RIEGELI_BASE_ERRNO_MAPPING_H_

Fix include guard to match the current filename.

PiperOrigin-RevId: 256006893


/*  chardata.h
 *
 *
 */

#ifndef XML_CHARDATA_H
#define XML_CHARDATA_H 1

#ifndef XML_VERSION
#include "expat.h"                      /* need XML_Char */
#endif

typedef struct {
    int count;                          /* # of chars, < 0 if not set */
    XML_Char data[1024];
} CharData;

void CharData_Init(CharData *storage);

void CharData_AppendString(CharData *storage, const char *s);

void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);

int CharData_CheckString(CharData *storage, const char *s);

int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);

#endif  /* XML_CHARDATA_H */

/* chardata.h

   Interface to some helper routines used to accumulate and check text
   and attribute content.
*/

#ifndef XML_CHARDATA_H
#define XML_CHARDATA_H 1

#ifndef XML_VERSION
#include "expat.h"                      /* need XML_Char */
#endif

typedef struct {
    int count;                          /* # of chars, < 0 if not set */
    XML_Char data[1024];
} CharData;

void CharData_Init(CharData *storage);

void CharData_AppendString(CharData *storage, const char *s);

void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);

int CharData_CheckString(CharData *storage, const char *s);

int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);

#endif  /* XML_CHARDATA_H */

Add a small comment to tell what this is.


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "sw/device/lib/dif/dif_edn.h"

#include "edn_regs.h"  // Generated

dif_result_t dif_edn_init(mmio_region_t base_addr, dif_edn_t *edn) {
  if (edn == NULL) {
    return kDifBadArg;
  }

  edn->base_addr = base_addr;

  return kDifOk;
}

Add init DIF for EDN

[sw/dif/edn] Add init DIF for EDN

This enables EDN irqs to be tested with the automated irq test.

Signed-off-by: Srikrishna Iyer <2803d640feace36379942447842f26c7747b4dc3@google.com>


#include "test_parser_p.h"

void optional_some(void **state) {
  grammar_t *grammar = grammar_init(
    non_terminal("Option"),
    rule_init(
      "Option",
      optional(
        terminal("opt")
      )
    ), 1
  );

  parse_t *result = parse("opt", grammar);
  assert_non_null(result);
  assert_int_equal(result->length, 3);
  assert_int_equal(result->n_children, 1);
}

void optional_none(void **state) {
  grammar_t *grammar = grammar_init(
    non_terminal("Option"),
    rule_init(
      "Option",
      optional(
        terminal("opt")
      )
    ), 1
  );

  parse_t *result = parse("nope", grammar);
  assert_non_null(result);
  assert_int_equal(result->length, 0);
  assert_int_equal(result->n_children, 0);
}

#include "test_parser_p.h"

void optional_some(void **state) {
  grammar_t *grammar = grammar_init(
    non_terminal("Option"),
    rule_init(
      "Option",
      optional(
        terminal("opt")
      )
    ), 1
  );

  parse_result_t *result = parse("opt", grammar);
  assert_non_null(result);
  assert_true(is_success(result));

  parse_t *suc = result->data.result;
  assert_int_equal(suc->length, 3);
  assert_int_equal(suc->n_children, 1);
}

void optional_none(void **state) {
  grammar_t *grammar = grammar_init(
    non_terminal("Option"),
    rule_init(
      "Option",
      optional(
        terminal("opt")
      )
    ), 1
  );

  parse_result_t *result = parse("nope", grammar);
  assert_non_null(result);
  assert_true(is_success(result));

  parse_t *suc = result->data.result;
  assert_int_equal(suc->length, 0);
  assert_int_equal(suc->n_children, 0);
}

Use new API in optional tests

Use new API in optional tests


#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

int __llvm_profile_runtime = 0;
uint64_t __llvm_profile_get_size_for_buffer(void);
int __llvm_profile_write_buffer(char *);
void __llvm_profile_reset_counters(void);
int __llvm_profile_check_compatibility(const char *, uint64_t);

int gg = 0;
void bar(char c) {
  if (c == '1')
    gg++;
  else
    gg--;
}

/* Returns 0 (size) when an error occurs. */
uint64_t libEntry(char *Buffer, uint64_t MaxSize) {

  uint64_t Size = __llvm_profile_get_size_for_buffer();
  if (Size > MaxSize)
    return 1;

  __llvm_profile_reset_counters();

  bar('1');

  if (__llvm_profile_write_buffer(Buffer))
    return 0;

  /* Now check compatibility. Should return 0.  */
  if (__llvm_profile_check_compatibility(Buffer, Size))
    return 0;

  return Size;
}

#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

int __llvm_profile_runtime = 0;
uint64_t __llvm_profile_get_size_for_buffer(void);
int __llvm_profile_write_buffer(char *);
void __llvm_profile_reset_counters(void);
int __llvm_profile_check_compatibility(const char *, uint64_t);

int gg = 0;
void bar(char c) {
  if (c == '1')
    gg++;
  else
    gg--;
}

/* Returns 0 (size) when an error occurs. */
uint64_t libEntry(char *Buffer, uint64_t MaxSize) {

  uint64_t Size = __llvm_profile_get_size_for_buffer();
  if (Size > MaxSize)
    return 0;

  __llvm_profile_reset_counters();

  bar('1');

  if (__llvm_profile_write_buffer(Buffer))
    return 0;

  /* Now check compatibility. Should return 0.  */
  if (__llvm_profile_check_compatibility(Buffer, Size))
    return 0;

  return Size;
}

Fix a minor bug in test

Fix a minor bug in test

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@263028 91177308-0d34-0410-b5e6-96231b3b80d8


C $Header: /u/gcmpack/MITgcm/pkg/dic/DIC_ATMOS.h,v 1.4 2010/04/11 20:59:27 jmc Exp $
C $Name:  $

       COMMON /INTERACT_ATMOS_NEEDS/
     &              co2atmos,
     &              total_atmos_carbon, total_ocean_carbon,
     &              total_atmos_carbon_year,
     &              total_ocean_carbon_year,
     &              total_atmos_carbon_start,
     &              total_ocean_carbon_start,
     &              atpco2

       _RL co2atmos(1000)
       _RL total_atmos_carbon
       _RL total_ocean_carbon
       _RL total_atmos_carbon_year
       _RL total_atmos_carbon_start
       _RL total_ocean_carbon_year
       _RL total_ocean_carbon_start
       _RL atpco2

C $Header: /u/gcmpack/MITgcm/pkg/dic/DIC_ATMOS.h,v 1.4 2010/04/11 20:59:27 jmc Exp $
C $Name:  $

       COMMON /INTERACT_ATMOS_NEEDS/
     &              co2atmos,
     &              total_atmos_carbon, total_ocean_carbon,
     &              total_atmos_carbon_year,
     &              total_ocean_carbon_year,
     &              total_atmos_carbon_start,
     &              total_ocean_carbon_start,
     &              atpco2,total_atmos_moles

       _RL co2atmos(1000)
       _RL total_atmos_carbon
       _RL total_ocean_carbon
       _RL total_atmos_carbon_year
       _RL total_atmos_carbon_start
       _RL total_ocean_carbon_year
       _RL total_ocean_carbon_start
       _RL atpco2
       _RL total_atmos_moles

Add ability to specify CO2 emissions (dic_int1=4)


// RUN: %crabllvm -O0 --crab-dom=w-int --crab-check=assert "%s" 2>&1 | OutputCheck %s
// CHECK: ^1  Number of total safe checks$
// CHECK: ^0  Number of total error checks$
// CHECK: ^0  Number of total warning checks$

extern int nd(void);
extern void process(char);
extern void __CRAB_assert(int);

int main() {
  char x,y;

  y=-10;
  if(nd()) x=0;
  else  x=100;
  while (x >= y){
    x = x-y;
  }
  __CRAB_assert(x >= -128 && x <= -119);
  return 0;
}

Add a test for the wrapped interval domain


#pragma once
#include <mix/computer_listener.h>

#include <gmock/gmock.h>

struct ComputerListenerMock :
	public mix::IComputerListener
{
	MOCK_METHOD1(on_memory_set, void (int));
	MOCK_METHOD0(on_ra_set, void ());
	MOCK_METHOD0(on_rx_set, void ());
	MOCK_METHOD1(on_ri_set, void (std::size_t));
	MOCK_METHOD0(on_overflow_flag_set, void ());
};

#pragma once
#include <mix/computer_listener.h>

#include <gmock/gmock.h>

struct ComputerListenerMock :
	public mix::IComputerListener
{
	MOCK_METHOD1(on_memory_set, void (int));
	MOCK_METHOD0(on_ra_set, void ());
	MOCK_METHOD0(on_rx_set, void ());
	MOCK_METHOD1(on_ri_set, void (std::size_t));
	MOCK_METHOD0(on_overflow_flag_set, void ());
	MOCK_METHOD0(on_comparison_state_set, void ());
};

Add missed on_comparison_state_set() function to ComputerListenerMock


//===-- llvm/Bytecode/Writer.h - Writer for VM bytecode files ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This functionality is implemented by the lib/BytecodeWriter library.
// This library is used to write VM bytecode files to an iostream.  First, you
// have to make a BytecodeStream object, which you can then put a class into
// by using operator <<.
//
// This library uses the Analysis library to figure out offsets for
// variables in the method tables...
//
// Note that performance of this library is not as crucial as performance of the
// bytecode reader (which is to be used in JIT type applications), so we have
// designed the bytecode format to support quick reading.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_BYTECODE_WRITER_H
#define LLVM_BYTECODE_WRITER_H

#include <iosfwd>

namespace llvm {
  class Module;
  void WriteBytecodeToFile(const Module *M, std::ostream &Out,
                           bool compress = false);
} // End llvm namespace

#endif

//===-- llvm/Bytecode/Writer.h - Writer for VM bytecode files ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This functionality is implemented by the lib/BytecodeWriter library.
// This library is used to write VM bytecode files to an iostream.  First, you
// have to make a BytecodeStream object, which you can then put a class into
// by using operator <<.
//
// This library uses the Analysis library to figure out offsets for
// variables in the method tables...
//
// Note that performance of this library is not as crucial as performance of the
// bytecode reader (which is to be used in JIT type applications), so we have
// designed the bytecode format to support quick reading.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_BYTECODE_WRITER_H
#define LLVM_BYTECODE_WRITER_H

#include <iosfwd>

namespace llvm {
  class Module;
  void WriteBytecodeToFile(const Module *M, std::ostream &Out,
                           bool compress = true);
} // End llvm namespace

#endif

Make compression the default on writing.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@17577 91177308-0d34-0410-b5e6-96231b3b80d8


#pragma once
#include "3rdparty/sol2/sol/forward.hpp"

namespace augs {
	template <class Archive, class Serialized>
	void write_lua(Archive&, const Serialized& from);

	template <class Archive, class Serialized>
	void read_lua(const Archive&, Serialized& into);

	template <class Archive, class Serialized>
	void write_lua_no_overload(Archive&, const Serialized& from);

	template <class Archive, class Serialized>
	void read_lua_no_overload(const Archive&, Serialized& into);

	template <class T, class K>
	void write_table_or_field(sol::table& output_table, const T& from, K&& key);

	template <class T>
	void general_from_lua_value(const sol::object& object, T& into);
}

#pragma once
#include <sol/forward.hpp>

namespace augs {
	template <class Archive, class Serialized>
	void write_lua(Archive&, const Serialized& from);

	template <class Archive, class Serialized>
	void read_lua(const Archive&, Serialized& into);

	template <class Archive, class Serialized>
	void write_lua_no_overload(Archive&, const Serialized& from);

	template <class Archive, class Serialized>
	void read_lua_no_overload(const Archive&, Serialized& into);

	template <class T, class K>
	void write_table_or_field(sol::table& output_table, const T& from, K&& key);

	template <class T>
	void general_from_lua_value(const sol::object& object, T& into);
}

Fix another broken sol include

Fix another broken sol include


#ifndef PYPOC_H
#define PYPOC_H

#include <Windows.h>
#include "EmoStateDLL.h"
#include "edk.h"
#include "edkErrorCode.h"

class EPOC {
private:
	EmoEngineEventHandle eEvent;
	EmoStateHandle eState;
	DataHandle hData;
	int nChannels;
	EE_DataChannel_t *channels;
	unsigned int userId;
	double *samples;
	BOOL ready;
	BOOL closed;
public:
	EPOC();
	~EPOC();
	BOOL open();
	BOOL init(const int);
	BOOL start();
	BOOL acquire();
	void getdata(int *data, int n);
	BOOL stop();
	BOOL close();
};

#endif

#ifndef PYPOC_H
#define PYPOC_H

#include <Windows.h>
#include "EmoStateDLL.hpp"
#include "edk.hpp"
#include "edkErrorCode.hpp"

class EPOC {
private:
	EmoEngineEventHandle eEvent;
	EmoStateHandle eState;
	DataHandle hData;
	int nChannels;
	EE_DataChannel_t *channels;
	unsigned int userId;
	double *samples;
	BOOL ready;
	BOOL closed;
public:
	EPOC();
	~EPOC();
	BOOL open();
	BOOL init(const int);
	BOOL start();
	BOOL acquire();
	void getdata(int *data, int n);
	BOOL stop();
	BOOL close();
};

#endif

Make legacy header reference old code.

Make legacy header reference old code.


#ifndef VRPSOLVER_CUSTOMER_H
#define VRPSOLVER_CUSTOMER_H

namespace VrpSolver {

    class Customer {
    public:
        Customer(unsigned int id, unsigned int demand)
            : id_(id), demand_(demand) {}

        unsigned int id() const {
            return id_;
        }

        unsigned int demand() const {
            return demand_;
        }

    private:
        Customer();
        unsigned int id_;
        unsigned int demand_;
    };

} // namespace VrpSolver

#endif // VRPSOLVER_CUSTOMER_H

#ifndef VRPSOLVER_CUSTOMER_H
#define VRPSOLVER_CUSTOMER_H

namespace VrpSolver {

    class Customer {
    public:
        Customer(unsigned int id, std::size_t demand)
            : id_(id), demand_(demand) {}

        unsigned int id() const {
            return id_;
        }

        std::size_t demand() const {
            return demand_;
        }

    private:
        Customer();
        unsigned int id_;
        std::size_t demand_;
    };

} // namespace VrpSolver

#endif // VRPSOLVER_CUSTOMER_H

Change the type of Customer::demand to std::size_t


#include <Ogre.h>
#include <OgreMeshFileFormat.h>
#include <OgreOptimisedUtil.h>

#ifdef WIN32
#include <OgreD3D9RenderSystem.h>
#include <OgreD3D9HLSLProgram.h>
#endif

#include <OgreGLRenderSystem.h>
#include <OgreGLGpuProgram.h>
#include <OgreGLSLGpuProgram.h>
#include <OgreGLSLLinkProgramManager.h>
#include <OgreGLSLProgram.h>

#include <OgreOctreePlugin.h>
#include <OgreOctreeSceneManager.h>

#include <OgreCgPlugin.h>
#include <OgreCgProgram.h>

#include <Ogre.h>
#include <OgreMeshFileFormat.h>
#include <OgreOptimisedUtil.h>
#include <OgrePredefinedControllers.h>

#ifdef WIN32
#include <OgreD3D9RenderSystem.h>
#include <OgreD3D9HLSLProgram.h>
#endif

#include <OgreGLRenderSystem.h>
#include <OgreGLGpuProgram.h>
#include <OgreGLSLGpuProgram.h>
#include <OgreGLSLLinkProgramManager.h>
#include <OgreGLSLProgram.h>

#include <OgreOctreePlugin.h>
#include <OgreOctreeSceneManager.h>

#include <OgreCgPlugin.h>
#include <OgreCgProgram.h>

Add header for FrameController to pch

Add header for FrameController to pch


#include <sys/types.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>

/* a re-implementation of cat(1), to learn the basic Unix syscalls.
  by tlehman at 1383415046
*/

void usage(const char *progname) {
    printf("%s filename\n", progname);
    exit(EXIT_FAILURE);
}

void print_file_contents(const char *filename) {
    int fd;
    ssize_t b;
    char buf[BUFSIZ];

    fd = open(filename, O_RDONLY);

    while ( (b = read(fd, buf, BUFSIZ)) != 0 ) {
        write(STDOUT_FILENO, buf, b);
    }

    close(fd);
}

int main(int argc, char const *argv[]) {
    int i;

    if (argc > 1) {
        for(i = 1; i < argc; i++) {
            print_file_contents(argv[i]);
        }
    } else {
      usage(argv[0]);
    }
    return 0;
}

#include <sys/types.h>
#include <sys/select.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <fcntl.h>

/* a re-implementation of cat(1), to learn the basic Unix syscalls.
  by tlehman at 1383415046
*/

void usage(const char *progname) {
    printf("%s filename\n", progname);
    exit(EXIT_FAILURE);
}

void print_file_contents(int fd) {
    ssize_t b;
    char buf[BUFSIZ];

    while ( (b = read(fd, buf, BUFSIZ)) != 0 ) {
        write(STDOUT_FILENO, buf, b);
    }
}

int stdin_non_empty() {
    fd_set fds;
    FD_SET(STDIN_FILENO, &fds);
    return select(1, &fds, NULL, NULL, NULL);
}

int main(int argc, char const *argv[]) {
    int i;
    int fd;

    if (argc > 1) {
        for(i = 1; i < argc; i++) {
            fd = open(argv[i], O_RDONLY);
            print_file_contents(fd);
            close(fd);
        }
    } else if (stdin_non_empty()) {
        print_file_contents(STDIN_FILENO);
    } else {
      usage(argv[0]);
    }
    return 0;
}

Read from STDIN when no filename is given


// Copyright (c) 2011 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 CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_
#define CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_

#include "base/i18n/base_i18n_export.h"
#include "base/string16.h"

// Trims |text| to contain only the range from |start| to |end| and |keep| words
// on either side of the range. The |start| and |end| parameters are character
// indexes into |text|. The |keep| parameter is the number of words to keep on
// either side of the |start|-|end| range. The function updates |start| in
// accordance with the trimming.
//
// Example:
//
//  size_t start = 14;
//  size_t end = 23;
//  string16 text = ASCIIToUTF16("one two three four five six seven eight");
//  int keep = 2;
//  string16 trimmed = TrimWords(&start, end, text, keep);
//  DCHECK(trimmed == ASCIIToUTF16("two three four five six seven"));
//  DCHECK(start == 10);
//
string16 TrimWords(
    size_t* start,
    size_t end,
    const string16& text,
    size_t keep);

#endif  // CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_

// Copyright (c) 2011 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 CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_
#define CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_

#include "base/string16.h"

// Trims |text| to contain only the range from |start| to |end| and |keep| words
// on either side of the range. The |start| and |end| parameters are character
// indexes into |text|. The |keep| parameter is the number of words to keep on
// either side of the |start|-|end| range. The function updates |start| in
// accordance with the trimming.
//
// Example:
//
//  size_t start = 14;
//  size_t end = 23;
//  string16 text = ASCIIToUTF16("one two three four five six seven eight");
//  int keep = 2;
//  string16 trimmed = TrimWords(&start, end, text, keep);
//  DCHECK(trimmed == ASCIIToUTF16("two three four five six seven"));
//  DCHECK(start == 10);
//
string16 TrimWords(
    size_t* start,
    size_t end,
    const string16& text,
    size_t keep);

#endif  // CHROME_BROWSER_SPELLCHECKER_WORD_TRIMMER_H_

Remove unnecessary include in spellcheck word trimmer

TBR=groby
BUG=170514

Review URL: https://chromiumcodereview.appspot.com/14273022

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@196650 0039d316-1c4b-4281-b951-d872f2087c98


/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2010 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k19"

/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2010 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k20"

Update driver version to 5.02.00-k20

[SCSI] qla4xxx: Update driver version to 5.02.00-k20

Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


//Trie data structure testing
//All code written my Nathaniel Thompson

#include <stdio.h>
#include <stdlib.h>

//trie structure
typedef struct _trie
{
    char letter; //the letter that the node holds
    _trie *next[26];//pointers to the rest of the letters
}trie;

//main function
int main(void)
{

}

//Trie data structure testing
//All code written my Nathaniel Thompson

#include <stdio.h>
#include <stdlib.h>

//trie structure
typedef struct _trie{
    char letter; //the letter that the node holds
    struct _trie *next[26];//pointers to the rest of the letters
}trie;

//fucntion prototypes
void initialize(trie *);

//main function
int main(void)
{
  int i=0;
  trie *root=malloc(sizeof(trie)); //this is the root of the tree
  root->letter=0;//it doesn't contain a letter
  initialize(root);

  for(i=0;i<26;i++)
  {
    printf("%c",root->next[i]->letter);
  }

}

void initialize(trie *root)
{
  int i;
  int j;
  for(i=0;i<26;i++) //initialize all of the letters
  {
    root->next[i]=malloc(sizeof(trie)); // get memory for each letter
    root->next[i]->letter='a'+i; //give the letters the proper values
    for(j=0;j<26;j++)
      root->next[i]->next[j]=NULL;          //Set all the letters pointers to null
  }
  printf("good fucntion call\n");
}

Structure was properly set up, TODO Create a small dictionary load dictionary into the trie


// RUN: %ucc -fsyntax-only %s

struct A
{
	char i, j;
} __attribute((aligned(8)));

struct A a;

_Static_assert(_Alignof(a) == 8, "misaligned/attr not picked up");

Test parsing __attribute__ after a struct definition


// bindgen-flags: --rustified-enum ".*" --enable-cxx-namespaces -- -x c++

namespace foo {
  enum class Bar : unsigned {
    Foo = 0,
    Foo1 = 0,
    Foo2,
    Foo3 = Foo2,
  };
}

// bindgen-flags: --rustified-enum ".*" --enable-cxx-namespaces -- -x c++ -std=c++11

namespace foo {
  enum class Bar : unsigned {
    Foo = 0,
    Foo1 = 0,
    Foo2,
    Foo3 = Foo2,
  };
}

Fix a pre-existing failing test?

Fix a pre-existing failing test?


/*
 * Copyright (C) 2016, Michiel Sikma <michiel@sikma.org>
 * MIT License
 */

#include <stdio.h>

#include "game.h"
#include "jukebox.h"

/**
 * Starts the jukebox.
 */
void start_jukebox() {
    start_game();
}

/*
 * Copyright (C) 2016, Michiel Sikma <michiel@sikma.org>
 * MIT License
 */

#include <stdio.h>

#include "src/game.h"
#include "src/jukebox.h"

/**
 * Starts the jukebox.
 */
void start_jukebox() {
    start_game();
}

Use correct paths relative to root

Use correct paths relative to root


// RUN: %ucc -o %t %s vla/check_align_asm.s
// RUN: %t

extern void check_align() __asm("check_align");

a()
{
	int i = 1;
	short c[i];

	c[0] = 0;

	check_align(c, i);
}

b()
{
	int i = 3;
	char c[i];

	c[0] = 0;
	c[1] = 0;
	c[2] = 0;

	check_align(c, i);
}

main()
{
	a();
	b();

	return 0;
}

// RUN: %ucc -o %t %s "$(dirname %s)"/check_align_asm.s
// RUN: %t

extern void check_align() __asm("check_align");

a()
{
	int i = 1;
	short c[i];

	c[0] = 0;

	check_align(c, i);
}

b()
{
	int i = 3;
	char c[i];

	c[0] = 0;
	c[1] = 0;
	c[2] = 0;

	check_align(c, i);
}

main()
{
	a();
	b();

	return 0;
}

Fix VLA stack alignment test / path

Fix VLA stack alignment test / path


#include "vm.h"

int* read_from_file(FILE* file) {
    int *instructions, idx = 0, count = 0;

    while (fgetc(file) != EOF) count++;

    rewind(file);

    instructions = malloc(count * sizeof(int));

    for (idx=0; idx < count; idx++) {
        instructions[idx] = fgetc(file);
    }

    return instructions;
}

int main(int argc, const char* argv[]) {
    if (argc != 2) {
        fprintf(stderr, "Invalid args\n");
        return -1;

    } else {
        printf(
            "%d\n",
            evaluate(
                read_from_file(
                    fopen(argv[1], "rb")
                )
            )
        );

        return 0;
    }
}

Add code to read opcodes from file :P

Add code to read opcodes from file :P


// PARAM: --sets ana.activated[+] octApron
#include <pthread.h>
#include <assert.h>

int g = 1;
int h = 1;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  int x; // rand
  pthread_mutex_lock(&A);
  g = x;
  h = x;
  assert(g == h);
  pthread_mutex_unlock(&A);
  pthread_mutex_lock(&A);
  pthread_mutex_unlock(&A);
  return NULL;
}

void *t2_fun(void *arg) {
  int x, y; // rand
  pthread_mutex_lock(&A);
  g = x;
  h = x;
  assert(g == h);
  pthread_mutex_unlock(&A);
  pthread_mutex_lock(&A);
  pthread_mutex_unlock(&A);
  pthread_mutex_lock(&A);
  if (y)
    g = x;
  else
    h = x;
  pthread_mutex_unlock(&A);
  return NULL;
}

int main(void) {
  pthread_t id, id2;
  pthread_create(&id, NULL, t_fun, NULL);
  pthread_create(&id2, NULL, t2_fun, NULL);

  assert(g == h); // UNKNOWN!
  pthread_mutex_lock(&A);
  assert(g == h); // UNKNOWN!
  pthread_mutex_unlock(&A);
  return 0;
}

// PARAM: --sets ana.activated[+] octApron
#include <pthread.h>
#include <assert.h>

int g = 1;
int h = 1;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  int x; // rand
  pthread_mutex_lock(&A);
  g = x;
  h = x;
  assert(g == h);
  pthread_mutex_unlock(&A);
  pthread_mutex_lock(&A);
  pthread_mutex_unlock(&A);
  return NULL;
}

void *t2_fun(void *arg) {
  int x, y; // rand
  pthread_mutex_lock(&A);
  g = x;
  h = x;
  assert(g == h);
  pthread_mutex_unlock(&A);
  pthread_mutex_lock(&A);
  pthread_mutex_unlock(&A);
  pthread_mutex_lock(&A);
  if (y)
    g = x;
  else
    h = x;
  assert(g == h); // UNKNOWN!
  pthread_mutex_unlock(&A);
  return NULL;
}

int main(void) {
  pthread_t id, id2;
  pthread_create(&id, NULL, t_fun, NULL);
  pthread_create(&id2, NULL, t2_fun, NULL);

  assert(g == h); // UNKNOWN!
  pthread_mutex_lock(&A);
  assert(g == h); // UNKNOWN!
  pthread_mutex_unlock(&A);
  return 0;
}

Add extra assert to 36/13

Add extra assert to 36/13


#include <stdio.h>
#include <stdint.h>

static inline uint8_t rev8(uint8_t d)
{
    int i;
    uint8_t out = 0;

    /* (from left to right) */
    for (i = 0; i < 8; i++)
        if (d & (1 << i))
            out |= (1 << (7 - i));

    return out;
}

/* http://www.onsemi.com/pub_link/Collateral/ADP3208D.PDF */
static inline uint32_t encode_voltage(uint32_t v)
{
	return rev8((0x78 - v / 125) << 1 | 1) << 8;
}

static inline uint32_t decode_voltage(uint32_t v)
{
	return (0x78 - (rev8(v >> 8) >> 1)) * 125;
}

int main()
{
	int v = 0;
	while (v < 15000) {
		printf("%d --> %04x | %d\n", v, encode_voltage(v), encode_voltage(v));
		v += 125;
	}
}

Add a simple voltage encode/decode c code


#pragma once

#include <functional>

#include <glbinding/AbstractFunction.h>

namespace
{

template <typename ReturnType, typename... Arguments> struct FunctionHelper;

template <typename ReturnType, typename... Arguments>
struct CallbackType
{
    using type = std::function<void(Arguments..., ReturnType)>;
};

template <typename... Arguments>
struct CallbackType<void, Arguments...>
{
    using type = std::function<void(Arguments...)>;
};

}

namespace glbinding
{

template <typename ReturnType, typename... Arguments>
class Function : public AbstractFunction
{
    friend struct FunctionHelper<ReturnType, Arguments...>;

    using Signature = ReturnType(*) (Arguments...);

    using BeforeCallback = std::function<void(Arguments...)>;
    using AfterCallback = typename CallbackType<ReturnType, Arguments...>::type;

public:
    Function(const char * name);

    ReturnType operator()(Arguments&... arguments) const;

    //void addBeforeCallback(BeforeCallback callback);
    //void addAfterCallback(AfterCallback callback);

protected:
//    std::vector<BeforeCallback> m_beforeCallbacks;
//    std::vector<AfterCallback> m_afterCallbacks;
};

} // namespace glbinding

#include <glbinding/Function.hpp>

#pragma once

#include <functional>

#include <glbinding/AbstractFunction.h>

#ifndef WINAPI
#ifdef _WIN32
#define WINAPI __stdcall
#else
#define WINAPI
#endif
#endif

namespace
{

template <typename ReturnType, typename... Arguments> struct FunctionHelper;

template <typename ReturnType, typename... Arguments>
struct CallbackType
{
    using type = std::function<void(Arguments..., ReturnType)>;
};

template <typename... Arguments>
struct CallbackType<void, Arguments...>
{
    using type = std::function<void(Arguments...)>;
};

}

namespace glbinding
{

template <typename ReturnType, typename... Arguments>
class Function : public AbstractFunction
{
    friend struct FunctionHelper<ReturnType, Arguments...>;

    using Signature = ReturnType(WINAPI *) (Arguments...);

    using BeforeCallback = std::function<void(Arguments...)>;
    using AfterCallback = typename CallbackType<ReturnType, Arguments...>::type;

public:
    Function(const char * name);

    ReturnType operator()(Arguments&... arguments) const;

    //void addBeforeCallback(BeforeCallback callback);
    //void addAfterCallback(AfterCallback callback);

protected:
//    std::vector<BeforeCallback> m_beforeCallbacks;
//    std::vector<AfterCallback> m_afterCallbacks;
};

} // namespace glbinding

#include <glbinding/Function.hpp>

Add calling convention on windows

Add calling convention on windows


/*
 * Copyright (c) 2013, Court of the University of Glasgow
 * All rights reserved.

 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:

 * - Redistributions of source code must retain the above copyright notice,
 *   this list of conditions and the following disclaimer.
 *
 * - Redistributions in binary form must reproduce the above copyright notice,
 *   this list of conditions and the following disclaimer in the documentation
 *   and/or other materials provided with the distribution.
 *
 * - Neither the name of the University of Glasgow nor the names of its
 *   contributors may be used to endorse or promote products derived from this
 *   software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

/*
 * node.h - type definition for node in a table
 */
#ifndef _NODE_H_
#define _NODE_H_

#include "table.h"
#include "timestamp.h"

typedef struct node {
    struct node *next;		/* link to next node in the table */
    struct node *prev;		/* link to previous node in the table */
    struct node *younger;	/* link to next younger node */
    unsigned char *tuple;	/* pointer to Tuple in circ buffer */
    unsigned short alloc_len;	/* bytes allocated for tuple in circ buffer */
    unsigned short real_len;	/* actual lengthof the tuple in bytes */
    struct table *parent;	/* table to which node belongs */
    tstamp_t tstamp;		/* timestamp when entered into database
                                   nanoseconds since epoch */
} Node;

#endif /* _NODE_H_ */

Add BSD 3-clause open source header

Add BSD 3-clause open source header


Add check for empty matrix in constructor.


#ifndef CPU_STATE_H
#define CPU_STATE_H

struct cpu_state {
    // Pushed by pusha
    uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
    uint32_t eip, cs, eflags, useresp, ss;
};
#endif

Define x86 CPU state structure

Define x86 CPU state structure


//
// Created by Dawid Drozd aka Gelldur on 03.02.16.
//

#pragma once

#include <android/log.h>

#ifdef DEBUG

#define  DLOG(...)  __android_log_print(ANDROID_LOG_DEBUG,"JNI",__VA_ARGS__)
#define  ILOG(...)  __android_log_print(ANDROID_LOG_INFO,"JNI",__VA_ARGS__)
#define  WLOG(...)  __android_log_print(ANDROID_LOG_WARN,"JNI",__VA_ARGS__)
#define  ELOG(...)  __android_log_print(ANDROID_LOG_ERROR,"JNI",__VA_ARGS__)
#define  FLOG(...)  __android_log_print(ANDROID_LOG_FATAL,"JNI",__VA_ARGS__)

#else

#define  DLOG(...)
#define  ILOG(...)
#define  WLOG(...)  __android_log_print(ANDROID_LOG_WARN,"JNI",__VA_ARGS__)
#define  ELOG(...)  __android_log_print(ANDROID_LOG_ERROR,"JNI",__VA_ARGS__)
#define  FLOG(...)  __android_log_print(ANDROID_LOG_FATAL,"JNI",__VA_ARGS__)

#endif

//
// Created by Dawid Drozd aka Gelldur on 03.02.16.
//

#pragma once

#include <android/log.h>

#ifndef NDEBUG

#define  DLOG(...)  __android_log_print(ANDROID_LOG_DEBUG,"JNI",__VA_ARGS__)
#define  ILOG(...)  __android_log_print(ANDROID_LOG_INFO,"JNI",__VA_ARGS__)
#define  WLOG(...)  __android_log_print(ANDROID_LOG_WARN,"JNI",__VA_ARGS__)
#define  ELOG(...)  __android_log_print(ANDROID_LOG_ERROR,"JNI",__VA_ARGS__)
#define  FLOG(...)  __android_log_print(ANDROID_LOG_FATAL,"JNI",__VA_ARGS__)

#else

#define  DLOG(...)
#define  ILOG(...)
#define  WLOG(...)  __android_log_print(ANDROID_LOG_WARN,"JNI",__VA_ARGS__)
#define  ELOG(...)  __android_log_print(ANDROID_LOG_ERROR,"JNI",__VA_ARGS__)
#define  FLOG(...)  __android_log_print(ANDROID_LOG_FATAL,"JNI",__VA_ARGS__)

#endif

Fix compile for debug on Android

Fix compile for debug on Android


#include <linux/init.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/power_supply.h>

static int __init battery_status_init(void)
{
	char name[] = "BAT0";
	int result = 0;
	struct power_supply *psy = power_supply_get_by_name(name);
	union power_supply_propval chargenow, chargefull;
	result = psy->get_property(psy, POWER_SUPPLY_PROP_CHARGE_NOW, &chargenow);
	if (!result) {
		printk(KERN_INFO "The charge level is %d\n", chargenow.intval);
	}
	result = psy->get_property(psy, POWER_SUPPLY_PROP_CHARGE_FULL, &chargefull);
	if (!result) {
		printk(KERN_INFO "The charge level is %d\n", chargefull.intval);
	}
	return 0;
}

static void __exit battery_status_exit(void)
{
	printk(KERN_INFO "Unload battery_status module\n");
}

module_init(battery_status_init);
module_exit(battery_status_exit);

MODULE_LICENSE("GPL");
MODULE_AUTHOR("Miroslav Tisma <tisma.etf@gmail.com>");
MODULE_DESCRIPTION("Battery status level module.");
MODULE_VERSION("0.0.1");

Add battery info kernel module.

Add battery info kernel module.


#ifndef __INTEGRATEFULLORBIT_H__
#define __INTEGRATEFULLORBIT_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#include <Python.h>
#endif
#include <galpy_potentials.h>
void parse_leapFuncArgs_Full(int, struct potentialArg *,int **,double **);
#ifdef _WIN32
// On Windows, *need* to define this function to allow the package to be imported
#if PY_MAJOR_VERSION >= 3
PyMODINIT_FUNC PyInit_galpy_integrate_c(void) // Python 3
#else
PyMODINIT_FUNC initgalpy_integrate_c(void) // Python 2
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* integrateFullOrbit.h */

#ifndef __INTEGRATEFULLORBIT_H__
#define __INTEGRATEFULLORBIT_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#include <Python.h>
#endif
#include <galpy_potentials.h>
void parse_leapFuncArgs_Full(int, struct potentialArg *,int **,double **);
#ifdef _WIN32
// On Windows, *need* to define this function to allow the package to be imported
#if PY_MAJOR_VERSION >= 3
  PyMODINIT_FUNC PyInit_galpy_integrate_c(void); // Python 3
#else
  PyMODINIT_FUNC initgalpy_integrate_c(void); // Python 2
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* integrateFullOrbit.h */

Add semicolon to function declarations [travis skip]


// @(#)root/thread:$Id$
// Author: Philippe Canal   09/30/2011

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TThreadSlots
#define ROOT_TThreadSlots

namespace ROOT {

   enum EThreadSlotReservation {
      // Describe the system wide slot pre-allocation in the TThread
      // 'special data' storage array ; meant to be used as thread local
      // storage.  (See TThread::Tsd)
      //
      // Slot 0 through 19 can be used for user application
      // Slot 20 and above are reserved for the global system
      kMaxUserThreadSlot   = 20,

      // Slot reserved by ROOT's packages.
      kPadThreadSlot       = 20,
      kClassThreadSlot     = 21,
      kDirectoryThreadSlot = 22,
      kFileThreadSlot      = 23,

      kMaxThreadSlot       = 24  // Size of the array of thread local slots in TThread
   };
}

#ifndef __CINT__
R__EXTERN void **(*gThreadTsd)(void*,Int_t);
#endif

#endif // ROOT_TThreadSlots

// @(#)root/base:$Id$
// Author: Philippe Canal   09/30/2011

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TThreadSlots
#define ROOT_TThreadSlots

namespace ROOT {

   enum EThreadSlotReservation {
      // Describe the system wide slot pre-allocation in the TThread
      // 'special data' storage array ; meant to be used as thread local
      // storage.  (See TThread::Tsd)
      //
      // Slot 0 through 19 can be used for user application
      // Slot 20 and above are reserved for the global system
      kMaxUserThreadSlot   = 20,

      // Slot reserved by ROOT's packages.
      kPadThreadSlot       = 20,
      kClassThreadSlot     = 21,
      kDirectoryThreadSlot = 22,
      kFileThreadSlot      = 23,

      kMaxThreadSlot       = 24  // Size of the array of thread local slots in TThread
   };
}

#ifndef __CINT__
R__EXTERN void **(*gThreadTsd)(void*,Int_t);
#endif

#endif // ROOT_TThreadSlots

Fix module loc.
Add missing final newline.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@41534 27541ba8-7e3a-0410-8455-c3a389f83636


Fix module loc.
Add missing final newline.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@41534 27541ba8-7e3a-0410-8455-c3a389f83636


#ifndef CONFIGREADER_H
#define CONFIGREADER_H

/*forward declarations*/
extern FILE *configreaderin;

struct config_ssid {
    char ssid_name[32];
    char ssid_user[32];
    char ssid_pass[32];
    char ssid_bssid[25];
    int ssid_8021x;
    struct config_ssid *next;
};

struct config_interfaces {
    char if_name[32];
    struct config_ssid *ssids;
    struct config_interfaces *next;
};

extern struct config_interfaces *config;

#endif // CONFIGREADER_H

#ifndef CONFIGREADER_H
#define CONFIGREADER_H

/*forward declarations*/
extern FILE *configreaderin;

struct config_ssid {
    char ssid_name[32];
    char ssid_user[32];
    char ssid_pass[32];
    char ssid_bssid[20];
    char ssid_auth[10];
    struct config_ssid *next;
};

struct config_interfaces {
    char if_name[32];
    struct config_ssid *ssids;
    struct config_interfaces *next;
};

extern struct config_interfaces *config;

#endif // CONFIGREADER_H

Change to config file struct

Change to config file struct


// PARAM: --set ana.ctx_insens[+] base
#include <stdlib.h>
#include <assert.h>

void foo(int cond) {
  assert(cond); // TODO to match assert
}

int main() {
  int *p = malloc(sizeof(int)); // blob is initially Bot
  while (1) { // blob joins Bot and 42 -> 42
    // TODO: both should actually be UNKNOWN! to be sound
    assert(*p == 42);
    foo(*p == 42); // Bot -> Top, so foo has unknown and cannot narrow
    *p = 42; // blob becomes 42
  }
  return 0;
}

Add test for surprising imprecision with ctx_insens base

Minimized from instrumented_cp_comb.c with __VERIFIER_assert function (not macro).


#ifndef __GNOME_POPT_H__
#define __GNOME_POPT_H__ 1

#include <popt.h>
#include "gnome-defs.h"

BEGIN_GNOME_DECLS
void gnomelib_register_popt_table(const struct poptOption *options,
				  const char *description);

poptContext gnomelib_parse_args(int argc, char *argv[],
				int popt_flags);

/* Some systems, like Red Hat 4.0, define these but don't declare
   them.  Hopefully it is safe to always declare them here.  */
extern char *program_invocation_short_name;
extern char *program_invocation_name;
END_GNOME_DECLS

#endif /* __GNOME_HELP_H__ */

#ifndef __GNOME_POPT_H__
#define __GNOME_POPT_H__ 1

#include <popt-gnome.h>
#include "gnome-defs.h"

BEGIN_GNOME_DECLS
void gnomelib_register_popt_table(const struct poptOption *options,
				  const char *description);

poptContext gnomelib_parse_args(int argc, char *argv[],
				int popt_flags);

/* Some systems, like Red Hat 4.0, define these but don't declare
   them.  Hopefully it is safe to always declare them here.  */
extern char *program_invocation_short_name;
extern char *program_invocation_name;
END_GNOME_DECLS

#endif /* __GNOME_HELP_H__ */

Update popt, and always use the gnome-libs version instead of any system

Update popt, and always use the gnome-libs version instead of any system
version.


////
//    __|  |  | _ _| __  /  __|   \ |
//  \__ \  __ |   |     /   _|   .  |
//  ____/ _| _| ___| ____| ___| _|\_|
//
// Copyright (c) 2016 Jacob Hauberg Hansen
//
// This library is free software; you can redistribute and modify it
// under the terms of the MIT license. See LICENSE for details.
//

#ifndef internal_h
#define internal_h

#define GLFW_INCLUDE_NONE

#include <GL/gl3w.h>
#include <GLFW/glfw3.h>

typedef struct {
    bool is_initialized;
    bool is_focused;

    bool should_finish;

    GLFWwindow *window;
} SHIZGraphicsContext;

#endif // internal_h

Include GLFW/gl3w and add base graphics context


// Copyright (c) 2011 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 VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
#define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_

namespace views {
namespace internal {

class NativeMenuHostDelegate {
 public:
  virtual ~NativeMenuHostDelegate() {}
};

}  // namespace internal
}  // namespace views

#endif  // VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_

Add newline to end of file.

Add newline to end of file.

git-svn-id: http://src.chromium.org/svn/trunk/src@80087 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 25bda12511d371bc9c02bf2454cce53241ee2abe


#ifndef BLUETOOTH_CONF_H__
#define BLUETOOTH_CONF_H__

// SD specific configurations.

#if (BLUETOOTH_SD == 110)

#define MICROPY_PY_BLE                  (1)
#define MICROPY_PY_BLE_NUS              (0)
#define BLUETOOTH_WEBBLUETOOTH_REPL     (0)
#define MICROPY_PY_UBLUEPY              (1)
#define MICROPY_PY_UBLUEPY_PERIPHERAL   (1)

#elif (BLUETOOTH_SD == 132)

#define MICROPY_PY_BLE                  (1)
#define MICROPY_PY_BLE_NUS              (0)
#define BLUETOOTH_WEBBLUETOOTH_REPL     (0)
#define MICROPY_PY_UBLUEPY              (1)
#define MICROPY_PY_UBLUEPY_PERIPHERAL   (1)
#define MICROPY_PY_UBLUEPY_CENTRAL      (0)

#else
#error "SD not supported"
#endif

// Default defines.

#ifndef MICROPY_PY_BLE
#define MICROPY_PY_BLE                  (0)
#endif

#ifndef MICROPY_PY_BLE_NUS
#define MICROPY_PY_BLE_NUS              (0)
#endif

#endif

#ifndef BLUETOOTH_CONF_H__
#define BLUETOOTH_CONF_H__

// SD specific configurations.

#if (BLUETOOTH_SD == 110)

#define MICROPY_PY_BLE                  (1)
#define MICROPY_PY_BLE_NUS              (0)
#define BLUETOOTH_WEBBLUETOOTH_REPL     (0)
#define MICROPY_PY_UBLUEPY              (1)
#define MICROPY_PY_UBLUEPY_PERIPHERAL   (1)

#elif (BLUETOOTH_SD == 132)

#define MICROPY_PY_BLE                  (1)
#define MICROPY_PY_BLE_NUS              (0)
#define BLUETOOTH_WEBBLUETOOTH_REPL     (0)
#define MICROPY_PY_UBLUEPY              (1)
#define MICROPY_PY_UBLUEPY_PERIPHERAL   (1)
#define MICROPY_PY_UBLUEPY_CENTRAL      (1)

#else
#error "SD not supported"
#endif

// Default defines.

#ifndef MICROPY_PY_BLE
#define MICROPY_PY_BLE                  (0)
#endif

#ifndef MICROPY_PY_BLE_NUS
#define MICROPY_PY_BLE_NUS              (0)
#endif

#endif

nrf5/drivers/bluetooth: Enable ubluepy central by default if running nrf52/s132 bluetooth stack. Maturity of the module is pretty OK now.


/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.04.00.13-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	4
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.05.00.03-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	5
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

[SCSI] qla2xxx: Update the driver version to 8.05.00.03-k.

Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com>
Signed-off-by: Saurav Kashyap <88d6fd94e71a9ac276fc44f696256f466171a3c0@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


//
// Aspia Project
// Copyright (C) 2016-2022 Dmitry Chapyshev <dmitry@aspia.ru>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

#ifndef HOST_HOST_EXPORT_H
#define HOST_HOST_EXPORT_H

#if defined(HOST_IMPLEMENTATION)
#define HOST_EXPORT __declspec(dllexport)
#else
#define HOST_EXPORT __declspec(dllimport)
#endif // defined(HOST_IMPLEMENTATION)

#endif // HOST_HOST_EXPORT_H

//
// Aspia Project
// Copyright (C) 2016-2022 Dmitry Chapyshev <dmitry@aspia.ru>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
//

#ifndef HOST_HOST_EXPORT_H
#define HOST_HOST_EXPORT_H

#include "build/build_config.h"

#if defined(OS_WIN)

#if defined(HOST_IMPLEMENTATION)
#define HOST_EXPORT __declspec(dllexport)
#else
#define HOST_EXPORT __declspec(dllimport)
#endif // defined(HOST_IMPLEMENTATION)

#else

#if defined(HOST_IMPLEMENTATION)
#define HOST_EXPORT __attribute__((visibility("default")))
#else
#define HOST_EXPORT
#endif

#endif

#endif // HOST_HOST_EXPORT_H

Fix host building in Linux (part 2/x).

Fix host building in Linux (part 2/x).


/**
 * Copyright (c) 2017 rxi
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the MIT license. See LICENSE for details.
 */

#include "keyboard.h"
#include "luaobj.h"

int l_keyboard_setKeyRepeat(lua_State *L) {
  keyboard_setKeyRepeat( lua_toboolean(L, 1) );
  return 0;
}

int l_keyboard_isDown(lua_State *L) {
  int n = lua_gettop(L);
  int res = 0;
  int i;
  for (i = 1; i <= n; i++) {
    const char *key = luaL_checkstring(L, 1);
    res |= keyboard_isDown(key);
  }
  lua_pushboolean(L, res);
  return 1;
}

int luaopen_keyboard(lua_State *L) {
  luaL_Reg reg[] = {
    { "setKeyRepeat", l_keyboard_setKeyRepeat },
    { "isDown",       l_keyboard_isDown       },
    { 0, 0 },
  };
  luaL_newlib(L, reg);
  return 1;
}

/**
 * Copyright (c) 2017 rxi
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the MIT license. See LICENSE for details.
 */

#include "keyboard.h"
#include "luaobj.h"

int l_keyboard_setKeyRepeat(lua_State *L) {
  keyboard_setKeyRepeat( lua_toboolean(L, 1) );
  return 0;
}

int l_keyboard_isDown(lua_State *L) {
  int n = lua_gettop(L);
  int res = 0;
  int i;
  for (i = 1; i <= n; i++) {
    const char *key = luaL_checkstring(L, i);
    res |= keyboard_isDown(key);
  }
  lua_pushboolean(L, res);
  return 1;
}

int luaopen_keyboard(lua_State *L) {
  luaL_Reg reg[] = {
    { "setKeyRepeat", l_keyboard_setKeyRepeat },
    { "isDown",       l_keyboard_isDown       },
    { 0, 0 },
  };
  luaL_newlib(L, reg);
  return 1;
}

Fix keyboard.isDown check for multiple keys


//
// Copyright (c) 2013 Carson McDonald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions
// of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>

@interface OverlayContext : NSObject

@property (nonatomic, copy) NSString *bannerText;
@property (nonatomic, assign) CGFloat bannerHeightPadding;
@property (nonatomic, assign) CGSize inputImageSize;
@property (nonatomic, assign) CGSize bannerSize;
@property (nonatomic, assign) CGContextRef workingContext;
@property (nonatomic, assign) CGContextRef bannerContext;
@property (nonatomic, copy) NSString *outputFilename;

@end

//
// Copyright (c) 2013 Carson McDonald
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
// documentation files (the "Software"), to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all copies or substantial portions
// of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
// CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
//

#import <Foundation/Foundation.h>

@interface OverlayContext : NSObject

@property (nonatomic, copy) NSString *bannerText;
@property (nonatomic, assign) CGFloat bannerHeightPadding;
@property (nonatomic, assign) CGSize inputImageSize;
@property (nonatomic, assign) CGSize bannerSize;
@property (nonatomic, assign) CGContextRef workingContext;
@property (nonatomic, assign) CGContextRef bannerContext;
@property (nonatomic, copy) NSString *outputFilename;
@property (nonatomic, copy) NSString *fontName;

@end

Add font name to context.

Add font name to context.


#ifndef UTIL_H
#define UTIL_H

/*** Utility functions ***/

#define ALLOC(type) ((type*) xmalloc(sizeof(type)))
void *xmalloc(size_t);

#define STARTS_WITH(x, y) (strncmp((x), (y), sizeof(y) - 1) == 0)

#endif /* UTIL_H */

#ifndef UTIL_H
#define UTIL_H

/*** Utility functions ***/

#define ALLOC(type) ((type*) xmalloc(sizeof(type)))
void *xmalloc(size_t);

#define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0)

#endif /* UTIL_H */

Fix STARTS_WITH macro comparing 1 less character than needed


// Copyright 2019 Google LLC
//
// 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
//
//      https://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 IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_
#define IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_

#include "third_party/llvm/llvm-project/mlir//include/mlir/IR/Module.h"
#include "third_party/llvm/llvm-project/mlir//include/mlir/Pass/Pass.h"

namespace mlir {
namespace iree_compiler {
namespace IREE {

std::unique_ptr<OpPassBase<ModuleOp>> createDropCompilerHintsPass();

}  // namespace IREE
}  // namespace iree_compiler
}  // namespace mlir

#endif  // IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_

// Copyright 2019 Google LLC
//
// 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
//
//      https://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 IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_
#define IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_

#include "mlir/IR/Module.h"
#include "mlir/Pass/Pass.h"

namespace mlir {
namespace iree_compiler {
namespace IREE {

std::unique_ptr<OpPassBase<ModuleOp>> createDropCompilerHintsPass();

}  // namespace IREE
}  // namespace iree_compiler
}  // namespace mlir

#endif  // IREE_COMPILER_DIALECT_IREE_TRANSFORMS_PASSES_H_

Fix include path typo from merge conflicts

PiperOrigin-RevId: 287685318


//===-- llvm/Bitcode/BitcodeWriter.h - Bitcode writers ----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This header defines interfaces to write LLVM bitcode files/streams.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_BITCODE_BITCODEWRITER_H
#define LLVM_BITCODE_BITCODEWRITER_H

#include "llvm/IR/ModuleSummaryIndex.h"
#include <string>

namespace llvm {
  class Module;
  class raw_ostream;

  /// \brief Write the specified module to the specified raw output stream.
  ///
  /// For streams where it matters, the given stream should be in "binary"
  /// mode.
  ///
  /// If \c ShouldPreserveUseListOrder, encode the use-list order for each \a
  /// Value in \c M.  These will be reconstructed exactly when \a M is
  /// deserialized.
  ///
  /// If \c Index is supplied, the bitcode will contain the summary index
  /// (currently for use in ThinLTO optimization).
  ///
  /// \p GenerateHash enables hashing the Module and including the hash in the
  /// bitcode (currently for use in ThinLTO incremental build).
  void WriteBitcodeToFile(const Module *M, raw_ostream &Out,
                          bool ShouldPreserveUseListOrder = false,
                          const ModuleSummaryIndex *Index = nullptr,
                          bool GenerateHash = false);

  /// Write the specified module summary index to the given raw output stream,
  /// where it will be written in a new bitcode block. This is used when
  /// writing the combined index file for ThinLTO. When writing a subset of the
  /// index for a distributed backend, provide the \p ModuleToSummariesForIndex
  /// map.
  void WriteIndexToFile(const ModuleSummaryIndex &Index, raw_ostream &Out,
                        const std::map<std::string, GVSummaryMapTy>
                            *ModuleToSummariesForIndex = nullptr);
} // End llvm namespace

#endif

Add missing file from r286566

Add missing file from r286566

Add the new BitcodeWriter.h header, which was missed in my r286566
commit, and should fix all the bot failures.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@286569 91177308-0d34-0410-b5e6-96231b3b80d8


//===-- MCJITMemoryManager.h - Definition for the Memory Manager ---C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_EXECUTIONENGINE_MCJITMEMORYMANAGER_H
#define LLVM_LIB_EXECUTIONENGINE_MCJITMEMORYMANAGER_H

#include "llvm/Module.h"
#include "llvm/ExecutionEngine/JITMemoryManager.h"
#include "llvm/ExecutionEngine/RuntimeDyld.h"
#include <assert.h>

namespace llvm {

// The MCJIT memory manager is a layer between the standard JITMemoryManager
// and the RuntimeDyld interface that maps objects, by name, onto their
// matching LLVM IR counterparts in the module(s) being compiled.
class MCJITMemoryManager : public RTDyldMemoryManager {
  JITMemoryManager *JMM;

  // FIXME: Multiple modules.
  Module *M;
public:
  MCJITMemoryManager(JITMemoryManager *jmm) : JMM(jmm) {}

  // Allocate ActualSize bytes, or more, for the named function. Return
  // a pointer to the allocated memory and update Size to reflect how much
  // memory was acutally allocated.
  uint64_t startFunctionBody(const char *Name, uintptr_t &Size) {
    Function *F = M->getFunction(Name);
    assert(F && "No matching function in JIT IR Module!");
    return (uint64_t)JMM->startFunctionBody(F, Size);
  }

  // Mark the end of the function, including how much of the allocated
  // memory was actually used.
  void endFunctionBody(const char *Name, uint64_t FunctionStart,
                       uint64_t FunctionEnd) {
    Function *F = M->getFunction(Name);
    assert(F && "No matching function in JIT IR Module!");
    // The JITMemoryManager interface makes the unfortunate assumption that
    // the address space/sizes we're compiling on are the same as what we're
    // compiling for, so it uses pointer types for its addresses. Explicit
    // casts between them to deal with that.
    return JMM->endFunctionBody(F, (uint8_t*)FunctionStart,
                                (uint8_t*)FunctionEnd);
  }

};

} // End llvm namespace

#endif

Add missing file from r128851.

Add missing file from r128851.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@128856 91177308-0d34-0410-b5e6-96231b3b80d8


/* GstShark - A Front End for GstTracer
 * Copyright (C) 2016-2017 RidgeRun Engineering <michael.gruner@ridgerun.com>
 *
 * This file is part of GstShark.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __GST_BITRATE_TRACER_H__
#define __GST_BITRATE_TRACER_H__

#include "gstperiodictracer.h"

G_BEGIN_DECLS

typedef struct _GstBitrateTracer GstBitrateTracer;
G_DECLARE_FINAL_TYPE (GstBitrateTracer, gst_bitrate_tracer, GST, BITRATE_TRACER, GstPeriodicTracer)

G_END_DECLS

#endif /* __GST_BITRATE_TRACER_H__ */

/* GstShark - A Front End for GstTracer
 * Copyright (C) 2016-2017 RidgeRun Engineering <michael.gruner@ridgerun.com>
 *
 * This file is part of GstShark.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __GST_BITRATE_TRACER_H__
#define __GST_BITRATE_TRACER_H__

#include "gstperiodictracer.h"

G_BEGIN_DECLS

#define GST_TYPE_BITRATE_TRACER (gst_bitrate_tracer_get_type ())
G_DECLARE_FINAL_TYPE (GstBitrateTracer, gst_bitrate_tracer, GST, BITRATE_TRACER, GstPeriodicTracer)

G_END_DECLS

#endif /* __GST_BITRATE_TRACER_H__ */

Fix definition for bitrate tracer type

Fix definition for bitrate tracer type


#ifndef GUFUNC_SCHEDULER
#define GUFUNC_SCHEDULER

#include <stdint.h>
#if __SIZEOF_POINTER__ == 8
    #define intp int64_t
    #define uintp uint64_t
#else
    #define intp int
    #define uintp unsigned
#endif

#ifdef __cplusplus
extern "C"
{
#endif

void do_scheduling(intp num_dim, intp *dims, uintp num_threads, intp *sched, intp debug);

#ifdef __cplusplus
}
#endif

#endif

#ifndef GUFUNC_SCHEDULER
#define GUFUNC_SCHEDULER

#include <stdint.h>

#ifndef __SIZEOF_POINTER__
    /* MSVC doesn't define __SIZEOF_POINTER__ */
    #if   defined(_WIN64)
        #define intp int64_t
        #define uintp uint64_t
    #elif defined(_WIN32)
        #define intp int
        #define uintp unsigned
    #else
        #error "cannot determine size of intp"
    #endif
#elif __SIZEOF_POINTER__ == 8
    #define intp int64_t
    #define uintp uint64_t
#else
    #define intp int
    #define uintp unsigned
#endif

#ifdef __cplusplus
extern "C"
{
#endif

void do_scheduling(intp num_dim, intp *dims, uintp num_threads, intp *sched, intp debug);

#ifdef __cplusplus
}
#endif

#endif

Fix parfors on win64 due to incorrect size for intp type.


#include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;

#endif

#include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;

BST* BST_Create(void);

#endif

Add BST Create function declaration

Add BST Create function declaration


#ifdef XML_UNICODE
#ifndef XML_UNICODE_WCHAR_T
#error xmlwf requires a 16-bit Unicode-compatible wchar_t
#endif
#define T(x) L ## x
#define ftprintf fwprintf
#define tfopen _wfopen
#define fputts fputws
#define puttc putwc
#define tcscmp wcscmp
#define tcscpy wcscpy
#define tcscat wcscat
#define tcschr wcschr
#define tcsrchr wcsrchr
#define tcslen wcslen
#define tperror _wperror
#define topen _wopen
#define tmain wmain
#define tremove _wremove
#else /* not XML_UNICODE */
#define T(x) x
#define ftprintf fprintf
#define tfopen fopen
#define fputts fputs
#define puttc putc
#define tcscmp strcmp
#define tcscpy strcpy
#define tcscat strcat
#define tcschr strchr
#define tcsrchr strrchr
#define tcslen strlen
#define tperror perror
#define topen open
#define tmain main
#define tremove remove
#endif /* not XML_UNICODE */

Fix screwup in changing copyright notices


// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest -verify %s

int scanf(const char *restrict format, ...);
int getchar(void);

#define BUFSIZE 10
int Buffer[BUFSIZE];

void bufferScanfAssignment(int x) {
  int n;
  int *addr = &Buffer[0];
  scanf("%d", &n);
  addr += n;// expected-warning {{tainted}}
  *addr = n; // expected-warning {{tainted}}
}

// RUN: %clang_cc1  -analyze -analyzer-checker=experimental.security.taint,debug.TaintTest -verify %s

int scanf(const char *restrict format, ...);
int getchar(void);

#define BUFSIZE 10
int Buffer[BUFSIZE];

void bufferScanfAssignment(int x) {
  int n;
  int *addr = &Buffer[0];
  scanf("%d", &n);
  addr += n;// expected-warning {{tainted}}
  *addr = n; // expected-warning {{tainted}} expected-warning {{tainted}}
}

Add a missing taint tester warning.

[analyzer] Add a missing taint tester warning.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@145834 91177308-0d34-0410-b5e6-96231b3b80d8


// Note: %s must be preceded by --, otherwise it may be interpreted as a
// command-line option, e.g. on Mac where %s is commonly under /Users.

// RUN: %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=BUILTIN
// BUILTIN: "-internal-isystem" "{{.*lib.*clang.*[0-9]\.[0-9].*include}}"

// RUN: %clang_cl -nobuiltininc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOBUILTIN
// NOBUILTIN-NOT: "-internal-isystem" "{{.*lib.*clang.*[0-9]\.[0-9].*include}}"

// RUN: env INCLUDE=/my/system/inc %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=STDINC
// STDINC: "-internal-isystem" "/my/system/inc"

// RUN: env INCLUDE=/my/system/inc %clang_cl -nostdinc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOSTDINC
// NOSTDINC-NOT: "-internal-isystem" "/my/system/inc"

// Note: %s must be preceded by --, otherwise it may be interpreted as a
// command-line option, e.g. on Mac where %s is commonly under /Users.

// RUN: %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=BUILTIN
// BUILTIN: "-internal-isystem" "{{.*lib.*clang.*include}}"

// RUN: %clang_cl -nobuiltininc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOBUILTIN
// NOBUILTIN-NOT: "-internal-isystem" "{{.*lib.*clang.*include}}"

// RUN: env INCLUDE=/my/system/inc %clang_cl -### -- %s 2>&1 | FileCheck %s --check-prefix=STDINC
// STDINC: "-internal-isystem" "/my/system/inc"

// RUN: env INCLUDE=/my/system/inc %clang_cl -nostdinc -### -- %s 2>&1 | FileCheck %s --check-prefix=NOSTDINC
// NOSTDINC-NOT: "-internal-isystem" "/my/system/inc"

Make the clang-cl test less restrictive.

Make the test less restrictive to allow directory layout used in our test setup.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@304408 91177308-0d34-0410-b5e6-96231b3b80d8


// Copyright (c) 2011 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.

// Multiply-included file, hence no include guard.
// Inclusion of all message files present in the system.  Keep this file
// up-to-date when adding a new value to enum IPCMessageStart in
// ipc/ipc_message_utils.h to include the corresponding message file.
#include "chrome/browser/importer/profile_import_process_messages.h"
#include "chrome/common/automation_messages.h"
#include "chrome/common/common_message_generator.h"
#include "chrome/common/nacl_messages.h"
#include "content/common/content_message_generator.h"
#include "ppapi/proxy/ppapi_messages.h"

// Copyright (c) 2011 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.

// Multiply-included file, hence no include guard.
// Inclusion of all message files present in the system.  Keep this file
// up-to-date when adding a new value to enum IPCMessageStart in
// ipc/ipc_message_utils.h to include the corresponding message file.
#include "chrome/browser/importer/profile_import_process_messages.h"
#include "chrome/common/common_message_generator.h"
#include "chrome/common/nacl_messages.h"
#include "content/common/content_message_generator.h"
#include "content/common/pepper_messages.h"
#include "ppapi/proxy/ppapi_messages.h"

Fix build break from bad merge

Fix build break from bad merge

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@106741 0039d316-1c4b-4281-b951-d872f2087c98


#ifndef CPR_BODY_H
#define CPR_BODY_H

#include <string>

#include "defines.h"

namespace cpr {

class Body {
  public:
    template <typename TextType>
    Body(TextType&& p_text)
            : text{CPR_FWD(p_text)} {}

    std::string text;
};

} // namespace cpr

#endif

#ifndef CPR_BODY_H
#define CPR_BODY_H

#include <string>

#include "defines.h"

namespace cpr {

class Body : public std::string {
  public:
    Body() = default;
    Body(const Body& rhs) = default;
    Body(Body&& rhs) = default;
    Body& operator=(const Body& rhs) = default;
    Body& operator=(Body&& rhs) = default;
    explicit Body(const char* raw_string) : std::string(raw_string) {}
    explicit Body(const char* raw_string, size_t length) : std::string(raw_string, length) {}
    explicit Body(size_t to_fill, char character) : std::string(to_fill, character) {}
    explicit Body(const std::string& std_string) : std::string(std_string) {}
    explicit Body(const std::string& std_string, size_t position, size_t length = std::string::npos)
            : std::string(std_string, position, length) {}
    explicit Body(std::initializer_list<char> il) : std::string(il) {}
    template <class InputIterator>
    explicit Body(InputIterator first, InputIterator last)
            : std::string(first, last) {}
};

} // namespace cpr

#endif

Make Body an opaque typedef of std::string


int wls(double* X, int n, int p, double* y, double* w,
        double* XTX, double *sqw, double* sqwX, double* sqwy, double* coef);

int calcFitted(double* X, int n, int p,
    double* y,
    double* coef,
    double* fitted);

int calcResid(double* X, int n, int p,
    double* y,
    double* coef,
    double* resid);

Add calcFitted and calcResid definitions.


// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s 2>&1 | FileCheck -check-prefix=CHECK_LD_32 %s
// CHECK_LD_32: {{ld|ld.exe}}"
// CHECK_LD_32: "i386pe"
// CHECK_LD_32_NOT: "-flavor" "gnu"

// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 | FileCheck -check-prefix=CHECK_LLD_32 %s
// CHECK_LLD_32: "lld" "-flavor" "gnu"
// CHECK_LLD_32: "i386pe"

// RUN: %clang -### -target i686-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=link.exe 2>&1 | FileCheck -check-prefix=CHECK_LINK_32 %s
// CHECK_LINK_32: link.exe"
// CHECK_LINK_32: "i386pe"

// RUN: %clang -### -target x86_64-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 | FileCheck -check-prefix=CHECK_LLD_64 %s
// CHECK_LLD_64: "lld" "-flavor" "gnu"
// CHECK_LLD_64: "i386pep"

// RUN: %clang -### -target arm-pc-windows-gnu --sysroot=%S/Inputs/mingw_clang_tree/mingw32 %s -fuse-ld=lld 2>&1 | FileCheck -check-prefix=CHECK_LLD_ARM %s
// CHECK_LLD_ARM: "lld" "-flavor" "gnu"
// CHECK_LLD_ARM: "thumb2pe"

Add test case for mingw -fuse-ld= support introduced in r242121.

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@253066 91177308-0d34-0410-b5e6-96231b3b80d8