⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 convention.java

📁 一个开源的组件
💻 JAVA
字号:
package org.xvolks.jnative;

/**
 * Represents the call convention of the function (STDCALL, CDECL)
 * $Id$
 * 
 * This software is released under the LGPL.
 * 
 * @author Created by Marc DENTY - (c) 2006 JNative project
 *
 */
public enum Convention {
	/**
	 * The callee cleans the stack
	 */
	STDCALL(0),
	/**
	 * The caller cleans the stack
	 */
	CDECL(1),
	
	;
	private final int value;
	
	static void setDefaultStyle(Convention convention) {
		DEFAULT = convention;
	}
	
	public static Convention DEFAULT = Convention.STDCALL;
	
	private Convention(int value) {
		this.value = value;
	}

	public int getValue() {
		return value;
	}
	
	/**
	 * 
	 * @param v
	 * @return a valid enum value (by default STDCALL)
	 */
	public static Convention fromInt(int v) {
		switch (v) {
		case 0:
			return STDCALL;
		case 1:
			return CDECL;

		default:
			return STDCALL;
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -